Re: [R] question about reshape

2010-01-28 Thread Dana TUDORASCU
Thank you very much everybody. That worked. Dana On Thu, Jan 28, 2010 at 12:23 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this: ong-reshape(as.data.frame(dataset), idvar=subject, v.names=response, varying=list(2:5), direction=long) or dataset - cbind.data.frame(y1, y2, y3, y4)

Re: [R] question on sqldf syntax

2010-01-26 Thread Christian Schulz
Maybe that's a problem with the RSQLite package , probably detaching the package help. detach(package:RSQLite) HTH, Christian trying to structure sql to merge two datasets. structure follows: dbs.possible.combos (all possible combinations of dates and places) Date Place 1/1/10 N-01 1/1/10

Re: [R] question on sqldf syntax

2010-01-25 Thread GL
Actually, better sql would likely be: dbs.final - sqldf(select * from dbs.possible.combos left join dbs.aggregate using (Date,Place)) but this still doesn't work -- View this message in context: http://n4.nabble.com/question-on-sqldf-syntax-tp1289707p1289718.html Sent from the R help mailing

Re: [R] question on sqldf syntax

2010-01-25 Thread lith
On 25 Jan., 20:26, GL pfl...@shands.ufl.edu wrote: Actually, better sql would likely be: dbs.final - sqldf(select * from dbs.possible.combos left join dbs.aggregate using (Date,Place)) but this still doesn't work I'd suspect name mangling to cause the problem:

Re: [R] question on sqldf syntax

2010-01-25 Thread Gabor Grothendieck
On Mon, Jan 25, 2010 at 2:17 PM, GL pfl...@shands.ufl.edu wrote: trying to structure sql to merge two datasets. structure follows: dbs.possible.combos (all possible combinations of dates and places) Date Place 1/1/10 N-01 1/1/10 S-02 1/2/10 N-01 1/2/10 S-02 etc... dbs.aggregate (the

Re: [R] Question on Merge/Lookup

2010-01-22 Thread Don MacQueen
Perhaps using the R merge() function, possibly twice in succession, will do the job. (merge() does a one to many relational join, but with only two dataframes at at time). Or, there is an R package that lets you use the SQL language on dataframes. I don't recall its name, but a search on R

Re: [R] Question on Merge/Lookup

2010-01-22 Thread Dennis Murphy
sqldf, authored by Gabor, if I read your intention correctly. D. On Fri, Jan 22, 2010 at 5:00 PM, Don MacQueen m...@llnl.gov wrote: Perhaps using the R merge() function, possibly twice in succession, will do the job. (merge() does a one to many relational join, but with only two dataframes

Re: [R] question on runif

2010-01-20 Thread Alfredo
ang-runif(20,0,2*pi) x-cos(ang) +0.4 y-sin(ang) +0.8 plot(x,y,ylim=c(-3,3),xlim=c(-3,3)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Wolfgang Amadeus Sent: Wednesday, January 20, 2010 5:26 AM To: r-help Subject: [R] question on

Re: [R] question on runif

2010-01-20 Thread Alfredo
Oops forgot to include the radius ang-runif(200,0,2*pi) x-cos(ang)*.1 +0.4 y-sin(ang)*.1 +0.8 plot(x,y) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Wolfgang Amadeus Sent: Wednesday, January 20, 2010 5:26 AM To: r-help Subject:

Re: [R] question on runif

2010-01-20 Thread Ted Harding
Alfredo's solution will provide n (=200 in his case) points uniformly distributed along the *circumference* of the circle. Wolfgang_Amadeus(!), you wanted them *in* a circle. If what you mean is uniformly distributed over the area within the circle, then you also need to generate the radii at

Re: [R] question on plot in R with mac

2010-01-20 Thread Mario Valle
You have redefined the plot function somewhere. Check your saved environment. mario On 20-Jan-10 15:36, khaz...@ceremade.dauphine.fr wrote: Hello all My computer is MacBook and I want to draw a plot in R, for example for x- c(1,3,6,9,12) y- c(1.5,2,7,8,15) I use

Re: [R] question on runif

2010-01-20 Thread Rolf Turner
Ted, Alfredo, et al: Please stop doing this expletive deleted jerk's homework for him!!! cheers, Rolf Turner ## Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

Re: [R] question on runif

2010-01-20 Thread Carl Witthoft
While I agree that this is someone's homework, it occur to me that we can mess him up a little more. He asked for 200 points *uniformly* distributed on (or in) a circle. Well, he did NOT say uniform random distribution. So in fact the plot, on a circle would be theta -seq(0,2*pi, by =

Re: [R] Question about many-to-one merge

2010-01-20 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of hongwei Sent: Wednesday, January 20, 2010 2:38 PM To: r-help@r-project.org Subject: [R] Question about many-to-one merge I have spent a whole afternoon searching for the

Re: [R] Question about many-to-one merge

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 5:37 PM, hongwei wrote: I have spent a whole afternoon searching for the solution, but got nothing so far. It should be a simple problem. I have two datasets to merge. The first one just contains two ID columns and it looks like: FromID ToID 1 2 1

Re: [R] Question about many-to-one merge

2010-01-20 Thread hongwei
Oh, yes, my bad. Merge works! I guess the reordering automatically made by Merge made me confused. I wrote my code using Merge several months ago, and just didn't feel it right today. Thanks anyway! -- View this message in context:

Re: [R] Question about many-to-one merge

2010-01-20 Thread hongwei
btw, the re-order and swap make it much clearer, so thanks again! -- View this message in context: http://n4.nabble.com/Question-about-many-to-one-merge-tp1018811p1037860.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] question about Software for Data analysis book

2010-01-20 Thread David Winsemius
On Jan 20, 2010, at 11:10 PM, Erin Hodgess wrote: Dear R People: I'm sure that this is a very silly question, but I'm reading the Software for Data analysis book by John Chambers, and I can't find the Declination data that he refers to on page 15 in the book. I did all of the usual stuff:

Re: [R] question on plot in R with mac

2010-01-19 Thread David Winsemius
On Jan 19, 2010, at 10:21 AM, khaz...@ceremade.dauphine.fr wrote: -- Hello all My computer is MacBook and I want to draw a plot in R, for example for x - c(1,3,6,9,12) y - c(1.5,2,7,8,15) I use this command plot(x,y).

Re: [R] question on 'within' and 'parse' commands

2010-01-07 Thread Romain Francois
Hello, parse just parse the text into an expression. parse(text=a-a*10; b-2:6) expression(a-a*10, b-2:6) attr(,srcfile) text If you want to evaluate the expression, you need to call eval y - within(x, eval(parse(text=a-a*10; b-2:6))) y a b 1 10 2 2 20 3 3 30 4 4 40 5 5 50 6 Or you can

Re: [R] Question on Reduce + rollmean

2010-01-07 Thread Muhammad Rahiz
Dear Gabor Henrique, Thanks for your suggestions on the above problem. The following is more traditional and unfanciful but it works. Suitable for a prodige like myself... m - matrix(1:3,3,3) x1 - list(m, m+1, m+2, m+3, m+4) out - list() for (i in 1:4){ t[[i]] - Reduce(+, x1[c(i:i+1)]) }

Re: [R] Question on Reduce + rollmean

2010-01-07 Thread Gabor Grothendieck
That gives an error when I run it. I think you want this: m - matrix(1:3,3,3) x1 - list(m, m+1, m+2, m+3, m+4) out - list() for(i in 1:4) out[[i]] - (x1[[i]] + x1[[i+1]]) / 2 On Thu, Jan 7, 2010 at 12:28 PM, Muhammad Rahiz muhammad.ra...@ouce.ox.ac.uk wrote: Dear Gabor Henrique, Thanks

Re: [R] Question on Reduce + rollmean

2010-01-07 Thread Muhammad Rahiz
Yes, should be 1. out[[i]], instead of t[[i]]. 2. x1[c(i:(i+1))] # For this case, I was trying out the rolling sum. Muhammad Rahiz | Doctoral Student in Regional Climate Modeling Climate Research Laboratory, School of Geography the Environment

Re: [R] Question regarding if statement in while loop

2010-01-06 Thread Stephanie Coffey
Stephan, Patrick Carl, Thanks very much for your help...and during the holidays no less! Putting my function within a try() worked perfectly!! Happy New Year, Stephanie On Sat, Dec 26, 2009 at 1:38 PM, Stephan Kolassa stephan.kola...@gmx.de wrote: Hi Stephanie, it sounds like R's exception

Re: [R] Question on Reduce + rollmean

2010-01-04 Thread Muhammad Rahiz
Thanks Gabor, It works alright. But is there alternative ways to perform rollmean apart from permutating the data? Possibly combining the Reduce and rollmean functions? The easiest but traditional way is (x[[1]]+x[[2]]) / 2 (x[[2]]+x[[3]]) / 2 Muhammad Rahiz | Doctoral Student in

Re: [R] Question on Reduce + rollmean

2010-01-04 Thread Gabor Grothendieck
This is due to the non-idempotent nature of apply. Instead of apply, you can use - aaply in the plyr package http://tolstoy.newcastle.edu.au/R/devel/06/06/5687.html - or the idempotent apply (iapply) posted here by Hadley Wickham: and in either case you won`t have to permute the result.

Re: [R] Question on Reduce + rollmean

2010-01-04 Thread Henrique Dallazuanna
For this example try this: lapply(lapply(list('head', 'tail'), do.call, list(x, n = -1)), function(x)Reduce('+', x)/2) On Mon, Jan 4, 2010 at 1:54 PM, Muhammad Rahiz muhammad.ra...@ouce.ox.ac.uk wrote: Thanks Gabor, It works alright. But is there alternative ways to perform rollmean apart

Re: [R] Question on Reduce + rollmean

2010-01-04 Thread Gabor Grothendieck
Here is a variation which also uses head and tail: mapply(function(x, y) (x + y)/2, tail(x, -1), head(x, -1), SIMPLIFY = FALSE) On Mon, Jan 4, 2010 at 12:37 PM, Henrique Dallazuanna www...@gmail.com wrote: For this example try this: lapply(lapply(list('head', 'tail'), do.call, list(x, n =

Re: [R] Question on Reduce + rollmean

2010-01-02 Thread milton ruser
Dear M.Rahiz, Unfortunatelly I can't reproduce your example. PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html bests milton On Sat, Jan 2, 2010 at 9:26 AM, Muhammad Rahiz muhammad.ra...@ouce.ox.ac.uk wrote: Hello useRs,

Re: [R] Question on Reduce + rollmean

2010-01-02 Thread Muhammad Rahiz
Let me rephrase; Given x as x [[1]] V1 V2 V3 [1,] 1 1 1 [2,] 2 2 2 [3,] 3 3 3 [[2]] V1 V2 V3 [1,] 4 4 4 [2,] 5 5 5 [3,] 6 6 6 [[3]] V1 V2 V3 [1,] 7 7 7 [2,] 8 8 8 [3,] 9 9 9 I'd like to calculate the moving average (interval = 2) i.e. ( x[[1]] + x[[2]] )

Re: [R] Question on Reduce + rollmean

2010-01-02 Thread Gabor Grothendieck
Try apply: library(zoo) # rollmean # test data m - matrix(1:3, 3, 3) x - list(m, m+3, m+6) # convert to array a - array(unlist(x), c(3, 3, 3)); a # apply rollmean and permute to desired form aa - apply(a, 1:2, rollmean, k = 2) aperm(aa, c(2, 3, 1)) The last line outputs: aperm(aa, c(2, 3,

Re: [R] Question regarding if statement in while loop

2009-12-26 Thread Stephan Kolassa
Hi Stephanie, it sounds like R's exception handling may help, something like this: foo - try(eblest(i, dir5, sterr5, weight5, aux5)) if ( class(foo) == try-error ) next Take a look at ?try. HTH, Stephan Stephanie Coffey schrieb: Hi all, I'm running R version 2.9.2 on a PC. I'm having a

Re: [R] Question regarding if statement in while loop

2009-12-26 Thread Carl Witthoft
Sounds like what you want is either try() or trycatch() -- check out the documentation. Basically, putting your eblest() function inside a try() call allows you to return an error message if eblest crashes without crashing your main loop. BTW, for debugging purposes, I'd recommend

Re: [R] Question to use R plot GO pie chart

2009-12-24 Thread Martin Morgan
Waverley @ Palo Alto wrote: Hi, I have a list of IPI gene IDs. I want to find out whether there is a package which can map the gene ontology to these IPIs, and plot the pie chart to demonstrate the molecular function distributions. The input is like the following gene IPI IDs:

Re: [R] Question About Repeat Random Sampling from a Data Frame

2009-12-22 Thread Adam Carr
, December 21, 2009 2:31:26 PM Subject: Re: [R] Question About Repeat Random Sampling from a Data Frame On Dec 21, 2009, at 1:01 PM, Bert Gunter wrote: Didn't read this thread in detail, so the following suggestion may just be nonsense... (caveat emptor), but: To sample from an data frame

Re: [R] Question About Repeat Random Sampling from a Data Frame

2009-12-21 Thread Gustaf Rydevik
On Mon, Dec 21, 2009 at 4:12 PM, Adam Carr adamlc...@yahoo.com wrote: Good Morning: I've read many, many posts on the r-help system and I feel compelled to quickly admit that I am relatively new to R, I do have several reference books around me, but I cannot count myself among the fortunate

Re: [R] Question About Repeat Random Sampling from a Data Frame

2009-12-21 Thread David Winsemius
On Dec 21, 2009, at 10:12 AM, Adam Carr wrote: Good Morning: I've read many, many posts on the r-help system and I feel compelled to quickly admit that I am relatively new to R, I do have several reference books around me, but I cannot count myself among the fortunate who seem to strong

Re: [R] Question About Repeat Random Sampling from a Data Frame

2009-12-21 Thread Adam Carr
the time to respond. The discussion and suggestions are very helpful. Adam From: David Winsemius dwinsem...@comcast.net Cc: r-help@r-project.org Sent: Mon, December 21, 2009 11:23:43 AM Subject: Re: [R] Question About Repeat Random Sampling from a Data Frame

Re: [R] question about invers gamma trancted

2009-12-04 Thread David Winsemius
On Dec 4, 2009, at 9:02 AM, khaz...@ceremade.dauphine.fr wrote: Hi I want to generate from invers gamma distribution truncated but when I use the rinvegamma() function, the system can not find this function. Is ther someone to help me please? Check your spledding. thanks soleiman

Re: [R] Question about R Functions

2009-12-04 Thread Uwe Ligges
Stephanie Cooke wrote: Is there a place to find the code for R functions like lsoda? Thanks Yes, all code is in the source version of the package that contains that function. Best, Uwe Ligges __ R-help@r-project.org mailing list

Re: [R] Question about R Functions

2009-12-03 Thread Ista Zahn
Yep! just do RSiteSeqarch(lsoda) -Ista On Thu, Dec 3, 2009 at 5:26 PM, Stephanie Cooke cooke.stepha...@gmail.com wrote: Is there a place to find the code for R functions like lsoda? Thanks __ R-help@r-project.org mailing list

Re: [R] Question about R Functions

2009-12-03 Thread David Winsemius
http://search.r-project.org/cgi-bin/namazu.cgi?query=lsodamax=100result=normalsort=scoreidxname=functionsidxname=Rhelp08idxname=views On Dec 3, 2009, at 5:26 PM, Stephanie Cooke wrote: Is there a place to find the code for R functions like lsoda? Thanks

Re: [R] Question about output from optim

2009-11-30 Thread Prof. John C Nash
As Ben Bolker has indicated, I am working on various improvements to the functionality of optim() along with others, esp. Ravi Varadhan and Kate Mullen. With relevance to the posts by Sebastien Bihorel and Ben Bolker about output of point/function value information on each evaluation, I am

Re: [R] question about availability of splines library for 2.10.0

2009-11-30 Thread Peter Ehlers
Have you searched your computer? Rhome/library/splines It's one of the packages automatically installed with R. -Peter Ehlers Alan Swanson wrote: Dear R gurus, I am using the gbm library under R version 2.10.0, which depends on the splines library. I have searched the various repositories

Re: [R] question about availability of splines library for 2.10.0

2009-11-30 Thread David Winsemius
On Nov 30, 2009, at 6:47 PM, Alan Swanson wrote: Dear R gurus, I am using the gbm library under R version 2.10.0, which depends on the splines library. I have searched the various repositories and can't seem to locate any current version of the splines library. This is strange because

Re: [R] question about availability of splines library for 2.10.0

2009-11-30 Thread Alan Swanson
Phil and Peter, thanks - figured it was something obvious. I had uninstalled splines to check the behavior of some other code. I just reinstalled R 2.10.0 and it shows up. Thanks! Alan Peter Ehlers wrote: Have you searched your computer? Rhome/library/splines It's one of the packages

Re: [R] Question about output from optim

2009-11-29 Thread Ben Bolker
Sébastien Bihorel pomchip at free.fr writes: Dear R-users, I am trying to port to R something that I wrote in Matlab to perform model parameter optimization using the Nelder-Mead simplex method (fminsearch). I read the help on ?optim (which seems to be the way to go) as well as a bunch

Re: [R] Question in using e1071 svm routine

2009-11-25 Thread akal
Hi all, I am encountering the same error Error in if (any(co)) { : missing value where TRUE/FALSE needed when i run:model - svm(databctrain, classesbctrain) I am not sure what this error means . is it some problem with the dataset ? Could i get some help ? Thanks, Akshatha losemind wrote:

Re: [R] Question in using e1071 svm routine

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 7:54 PM, akal wrote: Hi all, I am encountering the same error Error in if (any(co)) { : missing value where TRUE/FALSE needed when i run:model - svm(databctrain, classesbctrain) I am not sure what this error means . is it some problem with the dataset ? How do you

Re: [R] Question about S4

2009-11-23 Thread Hun S. Tesatte
PS. All class names were upper-case, I messed up while copying the code, but it has no effect on the result. Thanks for help. --Hun On Mon, 23 Nov 2009 10:28:37 +0100 Hun S. Tesatte hunsynte...@hush.com wrote: Dear R-ers, I don't understand the following, maybe someone will help me explain:

Re: [R] question about how to generate an orthogonal matrix with a known vector

2009-11-22 Thread RICHARD M. HEIBERGER
## You can do this with the qr functions. tmp - rnorm(4) tmp.qr - qr(tmp) tmp.complete - qr.Q(tmp.qr, complete=TRUE) tmp.complete[,1] / tmp __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] question about function heatmap

2009-11-18 Thread Uwe Ligges
Copied form the R-help messages' footer: PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Uwe Ligges Waverley @ Palo Alto wrote: Hi, I am using the function heatmap(stats) to draw a microarray

Re: [R] Question about simulation design...

2009-11-16 Thread Greg Snow
You should be able to do this effectively in 1 line: my.data - lapply( paste( 'data', 1:N, '.dat', sep='' ), read.table ) Then everything is in my.data, if you want them named then do a second line: names(my.data) - paste( 'data', 1:N, '.dat', sep='' ) Doing the same analysis on each dataset

Re: [R] question about the lattice package

2009-11-13 Thread RICHARD M. HEIBERGER
The first step is to make Weather a factor. Then the levels would be displayed in the strip labels. The second step would be to change the level values to the actual strings you want to see. tmp - data.frame(Weather=1:3, x=rnorm(3), y=rnorm(3)) xyplot(y ~ x | Weather, data=tmp) tmp$Weather -

Re: [R] Question about simulation design...

2009-11-12 Thread Peter Alspach
Tena koe Jeff Try something like: for (i in 1:n) { assign(paste('data', i, sep=''), read.table(paste('data', i, '.dat', sep=''), header=F)) . . . } HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] question about difference in date objects

2009-11-02 Thread Karl Ove Hufthammer
On Mon, 02 Nov 2009 06:29:54 -0500 Phil Smith philipsm...@alumni.albany.edu wrote: I want to take the difference in two dates: dt2 - dt1. But, I want the answer in months between those 2 dates. What do you mean by 'months'? The number of days in a month vary, so the number of months

Re: [R] question about difference in date objects

2009-11-02 Thread Gabor Grothendieck
Since months have different lengths the difference in months is not well defined but lets define it as the difference between the first of the month of two dates. In that case we can use as.yearmon of the zoo package. It converts to year/months, dropping days, using an internal representation of

Re: [R] question about difference in date objects

2009-11-02 Thread Prof Brian Ripley
On Mon, 2 Nov 2009, Phil Smith wrote: Hi R Community: I want to take the difference in two dates: dt2 - dt1. But, I want the answer in months between those 2 dates. Can you advise me? How long is a month? difftime() can give you an answer in days, which might suffice if you define a

Re: [R] Question about is.na for missing data

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 11:45:19 -0500 David Kaplan dkap...@education.wisc.edu wrote: asd[is.na(asd)] - mean(asd,na.rm=TRUE) This has worked quite well in the past. Now, however, I am getting the following error messsage. Error in `[-.data.frame`(`*tmp*`, is.na(asd), value =

Re: [R] Question about is.na for missing data

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 18:12:34 +0100 Karl Ove Hufthammer k...@huftis.org wrote: rhs is the wrong length for indexing by a logical matrix An inspection of the data set reveals no value of the sort give above. Any thoughts? I would venture to guess that your 'asd' object is not of the

Re: [R] Question on mixed effect models with LME

2009-10-21 Thread Kingsford Jones
On Wed, Oct 21, 2009 at 11:06 AM, Peter Flom peterflomconsult...@mindspring.com wrote: ... I have a longitudinal data set, with data on schools and their test scores over a four year period.  I have centered year, and run the following m1.mod1 - lme(fixed = math_1 ~ I(year-2007.5)*TFC_,    

Re: [R] : Question about correlation between data.

2009-10-19 Thread Lucky Strike
Lucky Strike wrote: hi everybody, I'm a student, and I'm new using R! I'm looking for statistical help hoping somebody can answer me! This is my problem: I have 2 temporal series. The firstone is a series of mesured data (height of monitorated points), the second is a series

Re: [R] question

2009-10-01 Thread David Winsemius
On Oct 1, 2009, at 4:33 AM, hassan paylakhi wrote: hi I am going to crazy.I want to use beadarray package in R, but I cant. when I want install it, I encounter to this message Loading required package: hwriter Loading required package: sma Error in library(pkg, character.only = TRUE,

Re: [R] question

2009-10-01 Thread Martin Morgan
hassan paylakhi wrote: hi I am going to crazy.I want to use beadarray package in R, but I cant. when I want install it, I encounter to this message Loading required package: hwriter Loading required package: sma Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc =

Re: [R] Question about zero-inflated poisson with REML.

2009-09-22 Thread Ben Bolker
Sunghee Kim sunghee0701 at gmail.com writes: Dear All, As you know, glmmADMB package use ML method for estimation. Is it possible to use REML estimation method for zero-inflated Poisson distribution? For ML method, poi_ML - glmm.admb(los ~ psihigh + trt.mod + trt.high +

Re: [R] Question about Factors

2009-09-14 Thread Don MacQueen
The suggestions from others to use lattice's xyplot, or ggplot2 are good. If you want an explicit loop you can do something like: for ( nm in unique(mydat$Name) ) { with( subset( mydf, Name==nm) , { plot(Time, Value, title=nm) readline('CR to continue ') } ) } At

Re: [R] Question about Factors

2009-09-13 Thread cls59
Chris Li wrote: Hi all, I am new to R and I have got a question in regards to factors. Say I have a simple dataset like the following: Name Time Value a 1:00 1.25 a 2:00 1.26 b 1:00 1.29 b 2:00 1.28 c 1:00 1.21

Re: [R] Question about Factors

2009-09-13 Thread Schalk Heunis
On Mon, Sep 14, 2009 at 5:19 AM, Schalk Heunis schalk.heu...@enerweb.co.zawrote: Chris try this (assume your dataset is in a dataframe called ms): library(lattice) xyplot(Value~Time|Name,data = ms) HTH Schalk On Mon, Sep 14, 2009 at 2:19 AM, Chris Li chri...@austwaterenv.com.auwrote:

Re: [R] Question about validating predicted probabilities

2009-08-21 Thread Frank E Harrell Jr
A parametric version is: require(Design) dd - datadist(predprob); options(datadist='dd') f - lrm(event ~ rcs(qlogis(predprob), 3)) plot(f, predprob=NA, fun=plogis) Frank Noah Silverman wrote: Hello, Frank was nice enough to point me to the val.prob function of the Design library. It

Re: [R] Question about validating predicted probabilities

2009-08-21 Thread Noah Silverman
Thanks Frank, Two quick questions: 1) I see you calculating datadist, but then not using it in the subsequent entries. Is that for a different application. 2) I'm less concerned with plotting than the values that were plotted. As mentioned in my original message, The line plotted from the

Re: [R] Question about validating predicted probabilities

2009-08-21 Thread Frank E Harrell Jr
Noah Silverman wrote: Thanks Frank, Two quick questions: 1) I see you calculating datadist, but then not using it in the subsequent entries. Is that for a different application. That's just to set default plotting limits. 2) I'm less concerned with plotting than the values that were

Re: [R] Question regarding finding credible interval using r2winbugs

2009-08-18 Thread Ben Bolker
[cc'd to list] You may need coda::HPDinterval(as.mcmc(fit),prob=0.9) SATRAJIT ROYCHOUDHURY wrote: Dear Ben, coda::HPDinterval(fit,prob=0.9) This command is keep giving me error message as; Error in HPDinterval(fit) : no applicable method for HPDinterval Can you pls tell me what

Re: [R] Question regarding finding credible interval using r2winbugs

2009-08-16 Thread Ben Bolker
coda::HPDinterval(fit,prob=0.9) SATRAJIT ROYCHOUDHURY-2 wrote: Dear I am trying to find a 90% credible interval. I am using the following code. fit-bugs( model.file=BUGScode, data=data, inits = list(geninits1,geninits2), parameters.to.save=keepers,

Re: [R] Question with apply function

2009-08-05 Thread Steve Lianoglou
On Aug 5, 2009, at 5:45 PM, Noah Silverman wrote: In my continuing quest to generate some summary data, I've come across some useful suggestions in pasts posts. The apply operation returns an error, and I can't figure out why. Can someone help me fix this? testlogdata - cbind(testlogdata,

Re: [R] Question about rpart decision trees (being used to predict customer churn)

2009-08-02 Thread Carlos J. Gil Bellosta
Hello, Isn't it totally counter-intuitive that if you penalize the error less the tree finds it? See: experience - as.factor(c(rep(good,90), rep(bad,10))) cancel - as.factor(c(rep(no,85), rep(yes,5), rep(no,5),rep(yes,5))) foo - function( i ){ tmp - rpart(cancel ~ experience,

Re: [R] Question about rpart decision trees (being used to predict customer churn)

2009-08-01 Thread Carlos J. Gil Bellosta
Hello, If you do my.tree - rpart(cancel ~ experience) and then you check my.tree$frame you will note that the complexity parameter there is 0. Check ?rpart.object to get a description of what this output means. But essentially, you will not be able to break the leaf unless you set a

Re: [R] Question about rpart decision trees (being used to predict customer churn)

2009-08-01 Thread Graham Williams
2009/7/27 Robert Smith robertpsmith2...@gmail.com Hi, I am using rpart decision trees to analyze customer churn. I am finding that the decision trees created are not effective because they are not able to recognize factors that influence churn. I have created an example situation below.

Re: [R] Question regarding sqldf

2009-07-31 Thread Rizzo . Michael
: | | | |Re: [R] Question regarding sqldf

Re: [R] Question regarding sqldf

2009-07-31 Thread Gabor Grothendieck
                                                                                                                        |  | | | Subject:   | |  |  |Re: [R

Re: [R] Question regarding sqldf

2009-07-30 Thread milton ruser
Hi Rizzi, how about a reproducible example/data.frame? :-) milton On Thu, Jul 30, 2009 at 1:46 PM, rizzo.mich...@epamail.epa.gov wrote: Hello, I am having a problem using sqldf. I'm trying to choose a subset of observations from a data set based on the date and maximum value of a

Re: [R] Question regarding sqldf

2009-07-30 Thread Rizzo . Michael
: | | | |Re: [R] Question regarding sqldf

Re: [R] Question regarding sqldf

2009-07-30 Thread milton ruser
How about update R/sqldf? require(sqlf) Loading required package: sqlf Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called 'sqlf' testframe-data.frame(sdate=rep(paste +

Re: [R] Question regarding sqldf

2009-07-30 Thread Gabor Grothendieck
I just answered essentially the same question from another person offline within the last day. Anyways: Date class variables are stored as numbers, i.e. days since the Epoch, in R and when transferred to sqlite get transferred as numbers. Try this: library(sqldf) DF - data.frame(a =

Re: [R] Question about the lars package

2009-07-24 Thread lulu9797
Thanks a lot for the reply. 1. How I compare the lars v.s. lm Your understand is correct. 2. Answer to my question. I guess in each step of lars, the coeff are not the same as the lm function returns using the same model, because the coeff of lars are the accumulated steps towards the

Re: [R] Question about the lars package

2009-07-23 Thread Steve Lianoglou
Hi, On Jul 22, 2009, at 6:18 PM, lulu9797 wrote: The returned values of lars function include R squares along the variable selection path. Correct. However, such values are always slightly different from the R squares returned by the regression function lm using the same models.

Re: [R] Question on qplot

2009-07-22 Thread baptiste auguie
try this, library(ggplot2) ggplot() + geom_histogram(aes(x=rnorm(100), fill=..count..))+ xlab(NULL)+ scale_y_continuous()+ opts(legend.position=none) HTH, baptiste 2009/7/22 RON70 ron_michae...@yahoo.com I have following code on qplot : library(ggplot2) ggplot() +

Re: [R] Question regarding package submission to CRAN

2009-07-18 Thread Martin Maechler
VG == Vikneswaran Gopal vikn...@stat.ufl.edu on Fri, 17 Jul 2009 08:51:55 -0700 writes: VG It usually gets uploaded within a day if it passes all VG the checks run by Kurt Hornik. Then the Windows version VG gets built within the next 24 hours as well. Vik Jim usually, yes

Re: [R] Question on qplot

2009-07-18 Thread smu
hey, On Sat, Jul 18, 2009 at 01:52:34AM -0700, RON70 wrote: Hi, suppose I have following codes : library(zoo); library(ggplot2) dat - matrix(rnorm(500*2), 500); dat - zooreg(dat, start = as.Date(01/01/01, %m/%d/%y), frequency=1); plot(dat) head(dat); month.no - format(index(dat), %m);

Re: [R] Question on qplot

2009-07-18 Thread RON70
the plots I am getting is here : http://www.2shared.com/file/6739681/d4c6c9d3/plot.html and http://www.2shared.com/file/6739673/bd50b430/plot.html How you are getting transposed one? smu-2 wrote: hey, On Sat, Jul 18, 2009 at 01:52:34AM -0700, RON70 wrote: Hi, suppose I have following

Re: [R] Question on qplot

2009-07-18 Thread Gabor Grothendieck
Although there is no explicit support for ggplot2 in zoo currently (hopefully there will be in the future) both your qplot commands do work for me using: packageDescription(ggplot2)$Version [1] 0.8.3 packageDescription(zoo)$Version # devel version [1] 1.6-0 R.version.string # Windows Vista [1]

Re: [R] Question on qplot

2009-07-18 Thread David Winsemius
Also get the expected behavior with: R version 2.9.1 Patched (2009-07-04 r48897) x86_64-apple-darwin9.7.0 #run as 64-bit GUI version under Mac OX X 10.5.7 ggplot2_0.8.2 #installed as CRAN binary zoo_1.5-5 #imstalled as CRAN binary chron_2.3-30 lattice_0.17-25 -- DW On Jul 18,

Re: [R] Question on qplot

2009-07-18 Thread RON70
I have updated the ggplot2 package as well as R, how got some new error. qplot(x, z) Error in get(new, env = FacetGrid, inherits = TRUE)(FacetGrid, ...) : could not find function is.formula I cannot understand what is happening with my system. Here I am providing the details of my system

Re: [R] Question on qplot

2009-07-18 Thread David Winsemius
When I try: ?is.formula I find that that one version is in package plyr. Perhaps you did not install the dependencies for ggplot2, or they weren't loaded? sessionInfo() ## ? -- DW. sessionInfo() R version 2.9.1 Patched (2009-07-04 r48897) x86_64-apple-darwin9.7.0 locale:

Re: [R] Question on qplot

2009-07-18 Thread Gabor Grothendieck
Suggest you update everything. Your ggplot2 is still not the most recent. Use the Packages | Update Packages menu and then try again. On Sat, Jul 18, 2009 at 2:32 PM, RON70ron_michae...@yahoo.com wrote: I have updated the ggplot2 package as well as R, how got some new error. qplot(x, z)

Re: [R] Question on qplot

2009-07-18 Thread RON70
Ah..now it is working as expected :) Package plyr was not loaded automatically. Is it a bug for ggplot2? All other dependencies like proto, grid, and reshape are loaded automatically. Thanks, David Winsemius wrote: When I try: ?is.formula I find that that one version is in

Re: [R] Question on qplot

2009-07-18 Thread David Winsemius
On Jul 18, 2009, at 3:13 PM, RON70 wrote: Ah..now it is working as expected :) Package plyr was not loaded automatically. Is it a bug for ggplot2? All other dependencies like proto, grid, and reshape are loaded automatically. Before throwing in the bug flag, you should start a

Re: [R] Question regarding package submission to CRAN

2009-07-17 Thread Vikneswaran Gopal
It usually gets uploaded within a day if it passes all the checks run by Kurt Hornik. Then the Windows version gets built within the next 24 hours as well. Vik Jim Lemon wrote: Gates, Michael wrote: ... Members, I recently submitted my first package to the submissions ftp site on

Re: [R] Question regarding package submission to CRAN

2009-07-16 Thread Jim Lemon
Gates, Michael wrote: ... Members, I recently submitted my first package to the submissions ftp site on CRAN (7.3.09). The package has remained on the server since with no action? Do package review/updates occur monthly? When I submitted, I sent an email to CRAN to let them know about the

Re: [R] Question regarding package submission to CRAN

2009-07-16 Thread Ben Bolker
Gates, Michael wrote: Members, I recently submitted my first package to the submissions ftp site on CRAN (7.3.09). The package has remained on the server since with no action? Do package review/updates occur monthly? When I submitted, I sent an email to CRAN to let them know about the

Re: [R] Question regarding package submission to CRAN

2009-07-16 Thread Uwe Ligges
Kurt Hornik is currently out of office and will be back soon. Moreover, CRAN was also unmanned in repspect to all other issues since all other CRAN maintainers have been attending useR! and/or DSC conferences. Just a bit more patience, CRAN will be in regular duty soon. Best, Uwe Ligges

<    7   8   9   10   11   12   13   14   15   16   >