Re: [R] xyplot plot with groups

2010-08-20 Thread Deepayan Sarkar
On Fri, Aug 20, 2010 at 4:03 PM, array chip wrote: > What a simple way to do what I want to do! Thanks. > > But if there is missing data in variable "y", then the averaged lines is > broken > where the missing data is present. For example: > > dat$y[c(10,185,200,400,450)]<-NA > > then using type=

[R] R CMD build --binary without option --use-zip-data

2010-08-20 Thread Andrew Liu
Hello, When I run R CMD build --binary pkgname I get * checking for file 'pkgname/DESCRIPTION' ... OK * preparing 'pkgname': * checking DESCRIPTION meta-information ... OK * cleaning src * removing junk files * checking for LF line-endings in source and make files * checking for empty or unnee

Re: [R] Problem to compute a function with very large numbers

2010-08-20 Thread Hans W Borchers
Nan Zhao student.ethz.ch> writes: > > Thank you Dennis for your explanations! > > The results you found are the same as mine. with first an infinity result, > followed by NaN. It seems that, when the number becomes too small, R must > round it up to 0. Hence I was wondering if there might a way

Re: [R] Regex exercise

2010-08-20 Thread Michael Hannon
> You are essentially doing the eval and parsing by hand instead of > letting eval(parse()) do the work. I prefer the latter. Hi, Bert. Yes, I agree with both your analysis and your preference. > However, your code did something that I did not expect and for which I > can find no documentation -

[R] Package repository on Linux machine and upgrading R

2010-08-20 Thread Vinh Nguyen
Dear list, I remember running into a thread on this topic in one of the R mailing lists before but I can't seem to find it now.  Basically, I remember a discussion on how one can set up where R packages can be installed so that when we upgrade the R version on the machine, the packages are still a

Re: [R] question

2010-08-20 Thread r.ookie
I'm not sure I understand exactly what you're asking but look at the truncated normal distribution. On Aug 20, 2010, at 5:13 PM, solafah bh wrote: Hello I want to know how can i sampling from upper and lower tail of normal distribution , in two cases , if i know the upper and lower bounds of

Re: [R] Problem to compute a function with very large numbers

2010-08-20 Thread Nan Zhao
Thank you Dennis for your explanations! The results you found are the same as mine. with first an infinity result, followed by NaN. It seems that, when the number becomes too small, R must round it up to 0. Hence I was wondering if there might a way to increase the number of decimals for extremal

[R] Programmer needed

2010-08-20 Thread John Lister
Is there a list of programmers who would take on a programming project for a Bone Marrow Transplant center? It seems very hard to find people with expertise who will help or who program commercially. John Lister, MD. __ R-help@r-project.org mailing l

Re: [R] Regex exercise

2010-08-20 Thread Bert Gunter
Thanks Michael: You are essentially doing the eval and parsing by hand instead of letting eval(parse()) do the work. I prefer the latter. However, your code did something that I did not expect and for which I can find no documentation -- I would have thought it shouldn't work. ... and that is, t

[R] question

2010-08-20 Thread solafah bh
Hello   I want to know how can i sampling from upper and lower tail of normal distribution , in two cases , if i know the upper and lower bounds of distribution and if i do not.   Regards [[alternative HTML version deleted]] __ R-help@

Re: [R] if-else function

2010-08-20 Thread Laetitia Schmid
Hi Richard, thank you very much. I got the results I needed. But I am still interested to find out how it would work with a if-else function in this context. Best, Laetitia Am 20.08.2010 um 23:40 schrieb RICHARD M. HEIBERGER: > tmp <- "VariablePARPlot1Plot2

Re: [R] Regex exercise

2010-08-20 Thread Michael Hannon
> For regular expression afficianados, I'd like a cleverer solution to > the following problem (my solution works just fine for my needs; I'm > just trying to improve my regex skills): > > Given the string (entered, say, at a readline prompt): > > "1 2 -5, 3- 6 4 8 5-7 10" ## only integers wil

Re: [R] logistic regression tree

2010-08-20 Thread Frank Harrell
On Fri, 20 Aug 2010, Kay Cichini wrote: hello, my data-collection is not yet finished, but i though have started investigating possible analysis methods. below i give a very close simulation of my future data-set, however there might be more nominal explanatory variables - there will be no

Re: [R] xyplot plot with groups

2010-08-20 Thread array chip
What a simple way to do what I want to do! Thanks. But if there is missing data in variable "y", then the averaged lines is broken where the missing data is present. For example: dat$y[c(10,185,200,400,450)]<-NA then using type='a' option will result in broken lines. xyplot(y~day|sex, groups=tr

Re: [R] Has anyone used Sweave with the Beamer poster macro for Latex ?

2010-08-20 Thread r.ookie
Good to be aware of this, thanks for mentioning it! On Aug 20, 2010, at 12:58 PM, Paul wrote: Hello, I'm trying to make a poster in Latex using the beamer poster macro (http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php), and use Sweave to add in R output. This works fine fo

Re: [R] logistic regression tree

2010-08-20 Thread Gavin Simpson
On Fri, 2010-08-20 at 14:46 -0700, Kay Cichini wrote: > hello, > > my data-collection is not yet finished, but i though have started > investigating possible analysis methods. > > below i give a very close simulation of my future data-set, however there > might be more nominal explanatory variabl

Re: [R] xyplot plot with groups

2010-08-20 Thread Dennis Murphy
Hi: Like this? xyplot(y~day|sex, groups=trt, data=dat, type=c('p','g', 'a')) The 'a' stands for average line, or 'connect the averages at different x values'. By using the groups = trt argument, you get one line per treatment group in each panel. A complete list of valid types is given on p. 75

[R] xyplot plot with groups

2010-08-20 Thread array chip
Hi, I am a beginner of xyplot() (or lattice package). On one hand, I immediately realized it's a very powerful utility. On the other hand, there are too many things for me to learn. Still haven't figure out a generalization of the syntax and usage under many different circumstances. Let me giv

Re: [R] Latex no where to be seen

2010-08-20 Thread schuster
Hi, > It amazes me that there's not a built in "report" function that can produce > the same kinds of reports that every report writer and data analysis > software in the whole word can do. (see SAS, Crystal Reports, SPSS, Oracle > Reports, Actuate, Hyperion, Cognos, ..etc) I think R is a very

Re: [R] 64 bit RSQLite

2010-08-20 Thread Steve Lianoglou
Hi Stephen, On Fri, Aug 20, 2010 at 11:25 AM, Seth Falcon wrote: > Hi, > > On 8/14/10 11:43 PM, Stephen Liu wrote: >> Could you please explain a little bid further whether after connecting the >> website I can select either 32 or 64 bit version? > > R packages come in pre-compiled binary flavors

Re: [R] Problem to compute a function with very large numbers

2010-08-20 Thread Dennis Murphy
Hi: I had no problem getting the function to 'run', but it appears the execution time starts to rise dramatically after 1: > system.time(x <- Wi(100)) user system elapsed 0.030.000.03 > system.time(x <- Wi(1000)) user system elapsed 0.280.000.28 > system.time(x <

Re: [R] logistic regression tree

2010-08-20 Thread Kay Cichini
hello, my data-collection is not yet finished, but i though have started investigating possible analysis methods. below i give a very close simulation of my future data-set, however there might be more nominal explanatory variables - there will be no continous at all (maybe some ordered nominal

Re: [R] if-else function

2010-08-20 Thread RICHARD M. HEIBERGER
> tmp <- "VariablePARPlot1Plot2 Plot3Plot4 + ParasiteA3114 + ParasiteB1235 + ParasiteC2113 + ParasiteD2

Re: [R] Regex exercise

2010-08-20 Thread Marc Schwartz
On Aug 20, 2010, at 4:16 PM, RICHARD M. HEIBERGER wrote: > Bert, > > we can save a lot of time by using paste and then only one call to eval and > parse. > >> x2 <- c("1","2:5", "3:6", "4","8","5:7", "10") >> system.time(for (i in 1:100) unlist(lapply(parse(text=x2),eval))) > u

[R] strange behavior of ifelse with factors

2010-08-20 Thread ivo welch
Dear R experts: this is probably correct behavior, but I do want to point out that it is unexpected to someone not too well versed: > test=factor("A","B","C","A") > ifelse(test=="A", as.factor("A"), test) [1] 1 2 3 1 ok, my factor was just coerced into integers, even though I have a logical vect

Re: [R] Regex exercise

2010-08-20 Thread Thomas Lumley
On Fri, 20 Aug 2010, Bert Gunter wrote: Given the string (entered, say, at a readline prompt): "1 2 -5, 3- 6 4 8 5-7 10" ## only integers will be entered Presumably only non-negative integers (Special note to Thomas Lumley: This seems one of the few instances where eval(parse..)) may a

Re: [R] R reports

2010-08-20 Thread schuster
Hi, are you looking for something like SAS ODS? (The terms "4GL" and "declarative programming" are confusing) With SAS ODS an output destination is opened at one place oft the program (e.g. HTML or PDF or both), subsequent procedures then write output to the destination(s). The procedures do

Re: [R] which one give clear picture-pdf, jpg or tiff?

2010-08-20 Thread Philipp Pagel
On Fri, Aug 20, 2010 at 09:30:18AM -0500, Stuart Luppescu wrote: > On Fri, 2010-08-20 at 01:30 -0700, Joshua Wiley wrote: > > I usually save them > > from R as a PDF or postscript file, rasterize them in GIMP (free > > answer to Photoshop) at the desired resolution, and finally choose the > > desir

Re: [R] Regex exercise

2010-08-20 Thread RICHARD M. HEIBERGER
Bert, we can save a lot of time by using paste and then only one call to eval and parse. > x2 <- c("1","2:5", "3:6", "4","8","5:7", "10") > system.time(for (i in 1:100) unlist(lapply(parse(text=x2),eval))) user system elapsed 0.060.000.03 > system.time(for (i in 1:10

[R] Package repository on Linux machine and upgrading R

2010-08-20 Thread Vinh Nguyen
Dear list, I remember running into a thread on this topic in one of the R mailing lists before but I can't seem to find it now. Basically, I remember a discussion on how one can set up where R packages can be installed so that when we upgrade the R version on the machine, the packages are still a

[R] if-else function

2010-08-20 Thread Laetitia Schmid
Hi R people! I am looking for some suggestions writing an if-else function. The idea is to characterize different plots containing counts of variables (here parasites). If a plot has a count equal or higher than 4 for any parasite the function should return a 1 else a 0. Later I can loop the

[R] Addendum to regex query

2010-08-20 Thread Bert Gunter
... I forgot to add: Base R regex functionality only. No special string packages or functions (like gsubfn). I'm sure those would help, but that's not what I'm after. -- Bert -- Bert Gunter Genentech Nonclinical Biostatistics __ R-help@r-project.org m

[R] Regex exercise

2010-08-20 Thread Bert Gunter
For regular expression afficianados, I'd like a cleverer solution to the following problem (my solution works just fine for my needs; I'm just trying to improve my regex skills): Given the string (entered, say, at a readline prompt): "1 2 -5, 3- 6 4 8 5-7 10" ## only integers will be entere

Re: [R] rollmean help (or similar function)

2010-08-20 Thread stephen sefick
I don't know if this is what you are after, but have a look at: rollmean in the zoo package hth Stephen On Fri, Aug 20, 2010 at 2:47 PM, Hall, Ken (CDC/OSELS/NCPHI) wrote: > I am working on a simple pilot project comparing the capability of SQL, > SAS and R to perform a rolling mean per the fol

Re: [R] Has anyone used Sweave with the Beamer poster macro for Latex ?

2010-08-20 Thread Peter Dalgaard
On 08/20/2010 09:58 PM, Paul wrote: > Hello, > > I'm trying to make a poster in Latex using the beamer poster macro > (http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php), > and use Sweave to add in R output. > > This works fine for adding graphics and tables, but if I want to

Re: [R] Has anyone used Sweave with the Beamer poster macro for Latex ?

2010-08-20 Thread Duncan Murdoch
On 20/08/2010 3:58 PM, Paul wrote: Hello, I'm trying to make a poster in Latex using the beamer poster macro (http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php), and use Sweave to add in R output. This works fine for adding graphics and tables, but if I want to put code i

Re: [R] Problem Installing R-Commander

2010-08-20 Thread Peter Dalgaard
On 08/20/2010 04:30 PM, Stephen P Molnar wrote: > I am trying to install R Commander in my R installation on a laptop running > the 64 bit version of Windows 7 Professional. I was running R as the > Administrator. > > > > The downloads proceed normally via CRAN, but then I get the following er

[R] Has anyone used Sweave with the Beamer poster macro for Latex ?

2010-08-20 Thread Paul
Hello, I'm trying to make a poster in Latex using the beamer poster macro (http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php), and use Sweave to add in R output. This works fine for adding graphics and tables, but if I want to put code in, the file fails to build in Latex.

Re: [R] dimnames

2010-08-20 Thread Gene Leynes
It seems like a disastrous proposition to name anything "try", because "try" is a key function used for error handling. Many functions use it internally, and I don't think you'd want to risk fouling up those mechanics! Even if it works, it's confusing to see that function being used as a variable

[R] rollmean help (or similar function)

2010-08-20 Thread Hall, Ken (CDC/OSELS/NCPHI)
I am working on a simple pilot project comparing the capability of SQL, SAS and R to perform a rolling mean per the following instructions. I have completed the SQL and SAS analysis, so now it's R's turn. Calculate mean values of x (x=count) for each date in the dataset where mean = the average c

Re: [R] change object name within for loop

2010-08-20 Thread David Winsemius
On Aug 20, 2010, at 1:07 PM, Gonçalo Ferraz wrote: Hi, I am writing a for loop that creates one object, say 'outn' on every round of the loop. I would like the name of each object to include the index of the loop as in, for example: out1, out2, out3, ... ?assign ?paste And I would l

Re: [R] loading a package within R, in a MS Windows environment?

2010-08-20 Thread Erik Iverson
Are you just looking for: library(zoo) ? Eva Nordstrom wrote: I am using R 2.11.1 in a Microsoft Windows environment. Is there a way to load a package (e.g. the zoo package) using only "written code", not menus or mouse clicks? The "code" below code brings up the "Select One" [package] menu

Re: [R] loading a package within R, in a MS Windows environment?

2010-08-20 Thread David Winsemius
On Aug 20, 2010, at 3:25 PM, Eva Nordstrom wrote: I am using R 2.11.1 in a Microsoft Windows environment. Is there a way to load a package (e.g. the zoo package) using only "written code", not menus or mouse clicks? The "code" below code brings up the "Select One" [package] menu. I just

Re: [R] loading a package within R, in a MS Windows environment?

2010-08-20 Thread Duncan Murdoch
On 20/08/2010 3:25 PM, Eva Nordstrom wrote: I am using R 2.11.1 in a Microsoft Windows environment. Is there a way to load a package (e.g. the zoo package) using only "written code", not menus or mouse clicks? The "code" below code brings up the "Select One" [package] menu. I just want to au

Re: [R] output values from within a function

2010-08-20 Thread Erik Iverson
Maas James Dr (MED) wrote: Is it possible to get R to output the value of an expression, that is being calculated within a function? I've attached a very simple example but for more complicated ones would like to be able to debug by seeing what the value of specific expressions are each time i

Re: [R] change object name within for loop

2010-08-20 Thread Gene Leynes
The quick answer is to use a list. The most simple: outlist=list() for (i in 1:10){ outlist[[i]] = matrix(rnorm(100), 10, 10) } Same example, but with naming: outlist=list() for (i in 1:10){ outlist[[i]] = data.frame(loop_number=i, matrix(rnorm(100), 10, 10)) } now if you were to do final_

Re: [R] change object name within for loop

2010-08-20 Thread Erik Iverson
Gonçalo Ferraz wrote: Hi, I am writing a for loop that creates one object, say 'outn' on every round of the loop. I would like the name of each object to include the index of the loop as in, for example: out1, out2, out3, ... And I would like the naming of the object to take place automat

[R] loading a package within R, in a MS Windows environment?

2010-08-20 Thread Eva Nordstrom
I am using R 2.11.1 in a Microsoft Windows environment. Is there a way to load a package (e.g. the zoo package) using only "written code", not menus or mouse clicks? The "code" below code brings up the "Select One" [package] menu.  I just want to automatically load the "zoo package".  local(

[R] Problem to compute a function with very large numbers

2010-08-20 Thread Nan Zhao
Dear R users, I have been trying to compute the following function and need it to work with n=15000, but it would only compute for smaller ns, such as n=1000 and not above. I was wondering if anyone would have a solution for this problem! Thank you very much for your kind support! Sincerely, Nan

[R] Multiple imputation and matching

2010-08-20 Thread moleps
Dear all, Is it possible to impute a dataset and create a summary table with summary from Hmisc and convert it to latex? I´m mostly familiar with cem and amelia hence the example from the documentation in cem. The imbalance command is not exactly what I was looking for... library (cem) if(req

[R] Mango R News

2010-08-20 Thread Sarah Lewis
Please find below the latest news and training schedules from Mango Solutions: PRODUCT NEWS MSToolkit: An R Library for Clinical Trial Simulation Mango are pleased to announce the release of MSToolkit, an R library that facilitates the simulation of clinical trials. Funded by Pfizer Inc and de

[R] output values from within a function

2010-08-20 Thread Maas James Dr (MED)
Is it possible to get R to output the value of an expression, that is being calculated within a function? I've attached a very simple example but for more complicated ones would like to be able to debug by seeing what the value of specific expressions are each time it cycles through a loop that

Re: [R] Latex no where to be seen

2010-08-20 Thread Donald Paul Winston
That is not true. ?plot() gives me the appropriate help page. (R version 2.11.1 (2010-05-31) Mac OS X) -- View this message in context: http://r.789695.n4.nabble.com/Latex-no-where-to-be-seen-tp2332139p2332577.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Can't read/write to _nonfi

2010-08-20 Thread minh
Thank you so much Mr. William for writting back to me. I apolorize about my reply becuase i did not receive your mail until late of today because it is due to the mail server of my school but now they had fixed it. Following your message, I corrected my program ny open a sinkfile and close it

[R] change object name within for loop

2010-08-20 Thread Gonçalo Ferraz
Hi, I am writing a for loop that creates one object, say 'outn' on every round of the loop. I would like the name of each object to include the index of the loop as in, for example: out1, out2, out3, ... And I would like the naming of the object to take place automatically as the loop mo

Re: [R] Problem with POSIXct in ave

2010-08-20 Thread Gabor Grothendieck
On Fri, Aug 20, 2010 at 3:09 PM, Gabor Grothendieck wrote: > On Fri, Aug 20, 2010 at 10:56 AM, Sasha Hafner wrote: >> Hi, >> >> I am having trouble using the ave function with a POSIXct object. For >> example: >> >> x<-Sys.time()+0:9*3600 >> dat<-data.frame(id=rep(c('a',' >> b','c'),each=10),dt=r

Re: [R] Problem with POSIXct in ave

2010-08-20 Thread Gabor Grothendieck
On Fri, Aug 20, 2010 at 10:56 AM, Sasha Hafner wrote: > Hi, > > I am having trouble using the ave function with a POSIXct object. For > example: > > x<-Sys.time()+0:9*3600 > dat<-data.frame(id=rep(c('a',' > b','c'),each=10),dt=rep(x,3),i=rep(1:10,3)) > dat > > # This is what I want to do: > dat$ti

Re: [R] U value from wilcox.test

2010-08-20 Thread Charles C. Berry
Issues like that in this thread can often be resolved by reading the help page for the relevant function. From: ?wilcox.test Note The literature is not unanimous about the definitions of the Wilcoxon rank sum and Mann-Whitney tests. The two most common definitions correspond to the sum

Re: [R] U value from wilcox.test

2010-08-20 Thread Cedric Laczny
Hi Chloe, first of all, I want to note, that you should be careful using the WMW-test. Even though it is often reported to be some sort of a "swiss-army-knife" for comparing two distributions, recent research on this test has revelaed that it is crucial what hypotheses you consider. Also the as

Re: [R] differecing a zoo series

2010-08-20 Thread Gabor Grothendieck
On Fri, Aug 20, 2010 at 2:19 PM, steven mosher wrote: > A quick question > >  x <- as.yearmon(2000 + seq(0, 23)/12) >  x >  [1] "Jan 2000" "Feb 2000" "Mar 2000" "Apr 2000" "May 2000" "Jun 2000" "Jul > 2000" "Aug 2000" "Sep 2000" "Oct 2000" "Nov 2000" "Dec 2000" "Jan 2001" > [14] "Feb 2001" "Mar 20

[R] differecing a zoo series

2010-08-20 Thread steven mosher
A quick question x <- as.yearmon(2000 + seq(0, 23)/12) x [1] "Jan 2000" "Feb 2000" "Mar 2000" "Apr 2000" "May 2000" "Jun 2000" "Jul 2000" "Aug 2000" "Sep 2000" "Oct 2000" "Nov 2000" "Dec 2000" "Jan 2001" [14] "Feb 2001" "Mar 2001" "Apr 2001" "May 2001" "Jun 2001" "Jul 2001" "Aug 2001" "Sep 2001

Re: [R] which one give clear picture-pdf, jpg or tiff?

2010-08-20 Thread kees duineveld
So do I. You can even convert these to MS graph format and edit some. It is sharp, because this is also vector format. On Fri, 20 Aug 2010 07:58:01 +0200, Jeff Newmiller wrote: I use Rgui and copy/paste special windows metafile. "Roslina Zakaria" wrote: Hi, I need some opinion.� I wo

[R] U value from wilcox.test

2010-08-20 Thread Chloe
Dear all, I want to compare the efficiency of 2 methods in extracting proteins from algal samples. I collected 6 independant algal samples and I extracted 3 by the method 1 and 3 others by the method 2. So I have 2 groups of 3 samples, that are not paired. I would like to know if the results obta

Re: [R] Surface generated as product of two curves

2010-08-20 Thread Bert Gunter
Essentially, you just want to fit a "smooth" surface over your grid of x,y values. Lots of ways to do this, but check out ?loess for a simple base R approach. The mgcv package does tensor product splines. Also search on "thin plate splines", "2d spatial" and the like for other approaches. There are

Re: [R] aggregate with cummax ??

2010-08-20 Thread Gabor Grothendieck
On Fri, Aug 20, 2010 at 11:38 AM, skan wrote: > > Hi > > Just in case somebody could be interested I've found that > > unlist(lapply(split(mydata,as.Date), cummax)) > > could make the job > but I don't know if it's the proper way if I want to use zoo objects. > > Any suggestion?? > See help(aggre

Re: [R] R and Java

2010-08-20 Thread Romain Francois
Le 20/08/10 17:56, Allan Freitas a écrit : Hi folks, Maybe that is not the best place to ask, No it is not, this is: http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel but I 'd like some of you could help me... I'm using jri to run R commands under Java, by its exa

Re: [R] which one give clear picture-pdf, jpg or tiff?

2010-08-20 Thread Joshua Wiley
On Fri, Aug 20, 2010 at 7:30 AM, Stuart Luppescu wrote: > On Fri, 2010-08-20 at 01:30 -0700, Joshua Wiley wrote: >> I usually save them >> from R as a PDF or postscript file, rasterize them in GIMP (free >> answer to Photoshop) at the desired resolution, and finally choose the >> desired format/co

Re: [R] Date Inconsistencies? Buglets?

2010-08-20 Thread Gavin Simpson
On Fri, 2010-08-20 at 10:35 -0400, ivo welch wrote: > The treatment of dates seems to be a little inconsistent in R 2.11.1 > (2010-05-31): > > [2] How do dates on axes work? > > > plot( c(as.Date(1:20, origin="1970-01-01")), 1:20 ) > > axis( side=3, c(as.Date(1:20, origin="1970-01-01"))) >

[R] R and Java

2010-08-20 Thread Allan Freitas
Hi folks, Maybe that is not the best place to ask, but I 'd like some of you could help me... I'm using jri to run R commands under Java, by its examples I can eval expressions, returning single values or vectors to my Java variables. But, I would like to know how to assign the values of a Java v

Re: [R] Aggregate Help

2010-08-20 Thread Hall, Ken (CDC/OSELS/NCPHI)
David pointed out that it would have helped to include the results of str(pilot) in my original post. I ran the str(pilot) and, sure enough, it revealed the problem (my error), that the column name should be "date1". Also, the editor in Outlook capitalized "Date", so that was another problem. Now

Re: [R] aggregate with cummax ??

2010-08-20 Thread skan
Hi Just in case somebody could be interested I've found that unlist(lapply(split(mydata,as.Date), cummax)) could make the job but I don't know if it's the proper way if I want to use zoo objects. Any suggestion?? -- View this message in context: http://r.789695.n4.nabble.com/aggregate-with

Re: [R] Problem with POSIXct in ave

2010-08-20 Thread David Winsemius
On Aug 20, 2010, at 10:56 AM, Sasha Hafner wrote: Hi, I am having trouble using the ave function with a POSIXct object. For example: x<-Sys.time()+0:9*3600 dat<-data.frame(id=rep(c('a',' b','c'),each=10),dt=rep(x,3),i=rep(1:10,3)) dat # This is what I want to do: dat$time.elapsed<-unsplit(la

Re: [R] 64 bit RSQLite

2010-08-20 Thread Seth Falcon
Hi, On 8/14/10 11:43 PM, Stephen Liu wrote: > Could you please explain a little bid further whether after connecting the > website I can select either 32 or 64 bit version? R packages come in pre-compiled binary flavors for some OS/architectures and always as source packages. If you are on Linu

[R] Surface generated as product of two curves

2010-08-20 Thread mau...@alice.it
I have the following data table: [,1] [,2] [,3] [,4] [,5] [1,] 2575 1927 1754 581 354 [2,] 1156 810 730 541 237 [3,] 417 297 199 125 110 [4,] 281 132 132 47 58 [5,] 152 84 87 54 19 Each column represents a time interval expressed in nano-seconds Each row represent

Re: [R] logistic regression tree

2010-08-20 Thread Frank Harrell
It would be good to tell us of the frequency of observations in each category of Y, and the number of continuous X's. Recursive partitioning will require perhaps 50,000 observations in the less frequent Y category for its structure and predicted values to validate, depending on X and the sig

Re: [R] Aggregate Help

2010-08-20 Thread William Dunlap
Ken, Your error message > Error in aggregate.date.frame(as,dat.frame(x), ...): > arguments must have same length would arise if you called the 'Date' variable 'date'. R is a case-sensitive language: 'date' is a function object (with length 1) and 'Date' is the variable in your data.frame Pi

[R] Problem with POSIXct in ave

2010-08-20 Thread Sasha Hafner
Hi, I am having trouble using the ave function with a POSIXct object. For example: x<-Sys.time()+0:9*3600 dat<-data.frame(id=rep(c('a',' b','c'),each=10),dt=rep(x,3),i=rep(1:10,3)) dat # This is what I want to do: dat$time.elapsed<-unsplit(lapply(split(dat$dt,dat$id),function(x) x-x[1]),f=dat$id

Re: [R] Date Inconsistencies? Buglets?

2010-08-20 Thread Gabor Grothendieck
On Fri, Aug 20, 2010 at 10:35 AM, ivo welch wrote: > The treatment of dates seems to be a little inconsistent in R 2.11.1 > (2010-05-31): > > [1] The choice of origins? > >  > as.integer(as.Date("1970-01-01")) > > works and assumes as origin 1970-01-01.  However, > >  > as.Date(1) The zoo package

Re: [R] Aggregate Help

2010-08-20 Thread Hall, Ken (CDC/OSELS/NCPHI)
Both of these worked great. Thanks for the quick response. Question: which of the three codes (these two and Phil's) would be preferred from a "performance in R" perspective? They all ran extremely fast. Ken -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]

Re: [R] Aggregate Help

2010-08-20 Thread Hall, Ken (CDC/OSELS/NCPHI)
The first one worked great. Thanks for the quick response. The second one, with the "with" statement, gave me the following error: Error in aggregate.date.frame(as,dat.frame(x), ...): arguments must have same length Ken PS. What is the proper etiquette? Should I respond to you individually and

[R] Date Inconsistencies? Buglets?

2010-08-20 Thread ivo welch
The treatment of dates seems to be a little inconsistent in R 2.11.1 (2010-05-31): [1] The choice of origins? > as.integer(as.Date("1970-01-01")) works and assumes as origin 1970-01-01. However, > as.Date(1) does not work. It requires an origin (as.Date(1, origin="1970-01-01")). If we

Re: [R] Latex no where to be seen

2010-08-20 Thread Michael Sumner
Fortune alert: "It's actually slightly more complicated: ?ls() really is parsed as ? of ls(), not (?ls)()." On Fri, Aug 20, 2010 at 11:53 PM, jim holtman wrote: > I will ask a variation on my favorite question that is on my signature line: > > "Tell me what you want to do, not how you want to d

[R] Problem Installing R-Commander

2010-08-20 Thread Stephen P Molnar
I am trying to install R Commander in my R installation on a laptop running the 64 bit version of Windows 7 Professional. I was running R as the Administrator. The downloads proceed normally via CRAN, but then I get the following error messages: package 'slam' successfully unpacked and MD5

Re: [R] which one give clear picture-pdf, jpg or tiff?

2010-08-20 Thread Stuart Luppescu
On Fri, 2010-08-20 at 01:30 -0700, Joshua Wiley wrote: > I usually save them > from R as a PDF or postscript file, rasterize them in GIMP (free > answer to Photoshop) at the desired resolution, and finally choose the > desired format/compression (jpeg, png, bitmap, tiff, etc.) to save it > as from

Re: [R] Deviance Residuals

2010-08-20 Thread Renzo Tascheri
Dear Dr. Iasonas, perhaps the following reference could also be useful: Dunn, P.K., Smyth, G.K., 1996. Randomized quantile residuals. J. Comput. Graph. Stat. 5, 236–244. An introduction to this residual definition and a link to the paper could be find here: http://www.statsci.org/smyth/pubs/res

Re: [R] How to make 'step' faster?

2010-08-20 Thread Martin Maechler
> "GS" == Gavin Simpson > on Fri, 20 Aug 2010 10:13:38 +0100 writes: GS> On Fri, 2010-08-20 at 12:25 +0530, sambit rath wrote: >> Dear all, >> >> I am fairly new to R. I would like to perform a step-wise logit >> regression aiming to select a model on the basis of

Re: [R] probabilities from predict.svm

2010-08-20 Thread Steve Lianoglou
Awesome! Good news, James. Thanks for letting us know. Glad you were able to sort this out. -steve On Thu, Aug 19, 2010 at 5:00 PM, Watling,James I wrote: > Hi Steve-- > > I spent some more time tuning the model with alternative gamma and cost > values, but still kept coming back to the same

Re: [R] paired samples, matching rows, merge()

2010-08-20 Thread Gabor Grothendieck
On Fri, Aug 20, 2010 at 9:59 AM, Cecilia Carmo wrote: > The last one worked! The other one, not. > Thank you very much! > > Another question about merge(): sometimes I'm merging two dataframes and the > merged dataframe has much more rows than the two merged? I think this should > not happen,does

Re: [R] paired samples, matching rows, merge()

2010-08-20 Thread Cecilia Carmo
The last one worked! The other one, not. Thank you very much! Another question about merge(): sometimes I'm merging two dataframes and the merged dataframe has much more rows than the two merged? I think this should not happen,does it? Cecília Em Fri, 20 Aug 2010 09:37:26 -0400 Gabor Grot

Re: [R] how to interpret KS test

2010-08-20 Thread Cedric Laczny
On Friday, 20. August 2010 15:19:24 Izidine Pinto wrote: > Dear R users > I am using KS test to compare two different distribution for the same > variable (temperature) for two different time periods. > H0: the two distributions are equal > H1: the two distributions are different > > ks.test (tem

Re: [R] Latex no where to be seen

2010-08-20 Thread jim holtman
I will ask a variation on my favorite question that is on my signature line: "Tell me what you want to do, not how you want to do it". On Fri, Aug 20, 2010 at 9:48 AM, David Hajage wrote: > "It amazes me that there's not a built in "report" function that can produce > the same kinds of reports t

Re: [R] handling recursion relation

2010-08-20 Thread jim holtman
Look at your first function: Grx<-function(x,r) { G0=Grx(x,0) G0=1; fu1<-function(t){exp(-t^2/(2*r*(r+1)))*Grx(x,r-1)} return(integrate(fu1,0,x)$value) } It immediately calls itself for infinite recursion. How did you expect to stop it? I would have expected some type of test before the call.

Re: [R] Latex no where to be seen

2010-08-20 Thread David Hajage
"It amazes me that there's not a built in "report" function that can produce the same kinds of reports that every report writer and data analysis software in the whole word can do. (see SAS, Crystal Reports, SPSS, Oracle Reports, Actuate, Hyperion, Cognos, ..etc)" To do some reports, most of R use

Re: [R] logistic regression tree

2010-08-20 Thread Achim Zeileis
On Fri, 20 Aug 2010, Kay Cichini wrote: hello gavin & achim, thanks for responding. by logistic regression tree i meant a regression tree for a binary response variable. but as you say i could also use a classification tree - in my case with only two outcomes. i'm not aware if there are s

Re: [R] how to interpret KS test

2010-08-20 Thread Cedric Laczny
Hi Izidine, On Friday, 20. August 2010 15:19:24 Izidine Pinto wrote: > Dear R users > I am using KS test to compare two different distribution for the same > variable (temperature) for two different time periods. > H0: the two distributions are equal > H1: the two distributions are different > >

Re: [R] paired samples, matching rows, merge()

2010-08-20 Thread Gabor Grothendieck
On Fri, Aug 20, 2010 at 9:33 AM, Gabor Grothendieck wrote: > On Fri, Aug 20, 2010 at 9:27 AM, Cecilia Carmo wrote: >> It wasn't the merge command. It doesn't create the variable x3. >> >> Cecília >> >> > > How about: > > x$k3 <- with(x, unlist(tapply(k1, k1, seq_along))) > y$k3 <- with(y, unlist(

Re: [R] how to interpret KS test

2010-08-20 Thread David Winsemius
On Aug 20, 2010, at 9:19 AM, Izidine Pinto wrote: Dear R users I am using KS test to compare two different distribution for the same variable (temperature) for two different time periods. H0: the two distributions are equal H1: the two distributions are different ks.test (temp12, temp22)

[R] Reshape package and variable assignment

2010-08-20 Thread Hosack, Michael
R Experts, I would like to create a series of variables without having to assign a separate line of code for each new variable. My abbreviated dataframe (DF) contains two groups of linked variables (SP1:SP3) and (CAU1:CAU3). Within SP1:SP3 are character codes (full dataframe contains 26 uniq

Re: [R] paired samples, matching rows, merge()

2010-08-20 Thread Gabor Grothendieck
On Fri, Aug 20, 2010 at 9:27 AM, Cecilia Carmo wrote: > It wasn't the merge command. It doesn't create the variable x3. > > Cecília > > How about: x$k3 <- with(x, unlist(tapply(k1, k1, seq_along))) y$k3 <- with(y, unlist(tapply(k1, k1, seq_along))) __

[R] handling recursion relation

2010-08-20 Thread Shant Ch
Hi, I wanted to compute the value of the function ifn at certain values of n. But I am receiving the following error when I was using the following code(given at the end). Error: evaluation nested too deeply: infinite recursion / options(expressions=)? I feel that since the function Grx is re

  1   2   >