Re: [R] update.formula drop interaction terms

2009-10-13 Thread Dieter Menne
Eleni Rapsomaniki-2 wrote: > > How do I drop multiplication terms from a formula using update? > e.g. > forml=as.formula("Surv(time, status) ~ x1+x2+A*x3+A*x4+B*x5+strata(sex)") > > The easiest way is to write the formula again without the A's. Dieter -- View this message in context: ht

Re: [R] heatmap.2

2009-10-13 Thread Dieter Menne
John Celniker wrote: > > ... > when I try to change the breaks to: >> br2 > [1] 0.000 0.5337751 1.0675502 1.6013253 2.1351003 3.000 > 3.500 4.000 4.500 > [10] 4.8039758 > > I get the correct heatmap representation but the color key does not > update correctly to reflect c

Re: [R] reference on permutation test

2009-10-13 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
It's always worthwhile to look at the articles by Pitman (and maybe the textbook by Fisher, if you have access to it); Welch is a nice paper, too, but might be pretty technical to "learn" about the area. I don't know any of the textbooks except Edgington (which is in its 4th edition now with co-aut

Re: [R] attach

2009-10-13 Thread Dieter Menne
Christophe Dutang1 wrote: > > > I would like to know what happens on the memory side when I use > attach(inputdata) > > Is there a second allocation of memory for inputdata? > Not, it just guides the syntax. Christophe Dutang1 wrote: > > Is it better not to use attach function? > A qua

[R] Error from termplot() with make.panel.svysmooth() for complex survey data

2009-10-13 Thread Christopher T. Moore
Greetings, I am using library(survey) to analyze some complex sample data. After fitting a model I tried to use termplot() with make.panel.svysmooth(), but I received an error (see below). Could someone help me interpret the error message so I can make the necessary corrections? The make.pan

Re: [R] How to read plain text documents into a vector?

2009-10-13 Thread Dieter Menne
Richard Liu wrote: > > There are actually two vignettes. Both have examples of a vector of > characters being made into a tm corpus, but neither shows how to read > documents on the file system into the vectors. I tried the other two > suggestions, but paste seemed not to "glue" the separate

Re: [R] How to read plain text documents into a vector?

2009-10-13 Thread Richard Liu
kenhorvath wrote: > > > > Paul Hiemstra wrote: >> >> >> file_list = list.files("/where/are/the/files") >> obj_list = lapply(file_list, FUN = yourfunction) >> >> yourfunction is probably either read.table or some read function from >> the tm package. So obj_list will become a list of either

[R] attach

2009-10-13 Thread Christophe Dutang
Hi all, I have a question regarding the memory usage for the attach function. Say I have a data.frame inputdat that I create with read.csv. I would like to know what happens on the memory side when I use attach(inputdata) Is there a second allocation of memory for inputdata? Then I'm using

[R] using mapply to avoid loops

2009-10-13 Thread Stephen Samaha
Hello, I would like to use mapply to avoid using a loop but for some reason, I can't seem to get it to work. I've included copies of my code below. The first set of code uses a loop (and it works fine), and the second set of code attempts to use mapply but I get a "subscript out of bounds" error

Re: [R] No funtions for character code?

2009-10-13 Thread Gabor Grothendieck
Try this: help.search(keyword = "character", package = "base") On Wed, Oct 14, 2009 at 12:01 AM, You Hyun Jo wrote: > Thnaks a lot! > > Could you recommend a manual or book or something for string manipulation in > R, > or give me a direction where I can get a list of string manipulation > fu

Re: [R] No funtions for character code?

2009-10-13 Thread You Hyun Jo
Thnaks a lot! Could you recommend a manual or book or something for string manipulation in R, or give me a direction where I can get a list of string manipulation functions? hyunjo I 2009/10/14 Duncan Murdoch > On 13/10/2009 6:44 PM, You Hyun Jo wrote: > >> Hello, >> >> Do you have a functio

Re: [R] How to get the definition of a class?

2009-10-13 Thread Martin Morgan
Peng Yu wrote: > On Tue, Oct 13, 2009 at 9:38 PM, Martin Morgan wrote: >> Peng Yu wrote: >>> Hi, >>> >>> ExonFeatureSet >>> >>> I have an object of the above class. The following document mentioned it. >>> >>> http://www.bioconductor.org/packages/2.5/bioc/vignettes/oligo/inst/doc/ClassesUsedInOlig

Re: [R] How to get the definition of a class?

2009-10-13 Thread Peng Yu
On Tue, Oct 13, 2009 at 9:38 PM, Martin Morgan wrote: > Peng Yu wrote: >> Hi, >> >> ExonFeatureSet >> >> I have an object of the above class. The following document mentioned it. >> >> http://www.bioconductor.org/packages/2.5/bioc/vignettes/oligo/inst/doc/ClassesUsedInOligo.pdf >> >> But I would l

[R] Request update on A (Not So) Short Introduction to S4

2009-10-13 Thread Peng Yu
There are several '?'s on the last page of the following document. Apparently, they are not correct. Could somebody correct it? cran.r-project.org/doc/contrib/Genolini-S4tutorialV0-5en.pdf __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

[R] heatmap.2

2009-10-13 Thread John Celniker
Hi folks, I have been working with the ellipse library and trying to use the heatmap.2 function. I have called the function as follows hh <- heatmap.2(DATA, Rowv= F, trace = "none", colsep=seq(1, 4), rowsep = seq(1,dim(GENES)[1]), col = brewer.pal(9, "YlOrRd"), lmat=rbind( c(3, 4,0)

[R] reference on permutation test

2009-10-13 Thread Peng Yu
I want learn permutation test and resampleing, etc. There are a few references listed below. I'm wondering what is the best book on this topic. Can somebody give me some advice. Thank you! http://en.wikipedia.org/wiki/Resampling_%28statistics%29#Permutation_test __

[R] Confusion matrix from cross validation in R:

2009-10-13 Thread parmee
Hey! How do I get the confusion matrix after performing 10-fold cross validation from SVM in R? When I try to print it, I get the confusion matrix without cross validation. I need to compute PPV. Should I report PPV without CV and total accuracy with CV? I am confused. > svmtrain <- svm(xtrain

Re: [R] How to get the definition of a class?

2009-10-13 Thread Martin Morgan
Peng Yu wrote: > Hi, > > ExonFeatureSet > > I have an object of the above class. The following document mentioned it. > > http://www.bioconductor.org/packages/2.5/bioc/vignettes/oligo/inst/doc/ClassesUsedInOligo.pdf > > But I would like to see its defintion. I'm wondering if there is a way > in

[R] Understanding hclust and dendrogram

2009-10-13 Thread Peng Yu
?hclust listed several references. I'm wondering what is the best resource that explained clustering algorithms, dendrogram and various clustering algorithms that are implemented in R. Thank you! __ R-help@r-project.org mailing list https://stat.ethz.ch/

[R] Invitation to connect on LinkedIn

2009-10-13 Thread Hesen Peng
LinkedIn Hesen Peng requested to add you as a connection on LinkedIn: -- Arnaud, I'd like to add you to my professional network on LinkedIn. - Hesen Accept invitation from Hesen Peng http://www.linkedin.com/e/qlt6CtWzi7sEoE_As_C0_wMfEZD2c-gG

[R] How to get the definition of a class?

2009-10-13 Thread Peng Yu
Hi, ExonFeatureSet I have an object of the above class. The following document mentioned it. http://www.bioconductor.org/packages/2.5/bioc/vignettes/oligo/inst/doc/ClassesUsedInOligo.pdf But I would like to see its defintion. I'm wondering if there is a way in R to give me the definition of any

Re: [R] plot dates in x-axis

2009-10-13 Thread Viknesh
Hi, here is a code snippet that will help you achieve what you want. With it, you can format the Date object to display any aspect of the Date on the x-axis, like dd-mm, dd-, or day, etc. See the help on strftime() for the formatting key. d1 <- "10/10/2009" d2 <- "10/11/2009" d3 <- "10/12/

Re: [R] axis labels

2009-10-13 Thread S Ellison
They probably look different because the y-axis distance is to the bottom of the number and the x-axis to the top; character adjustment is putting the actual locations in the 'same' place but with opposing orientation. Try fooling about with the mgp argument in axis(): par(mfrow=c(1,1), cex.axis

Re: [R] No funtions for character code?

2009-10-13 Thread Duncan Murdoch
On 13/10/2009 6:44 PM, You Hyun Jo wrote: Hello, Do you have a function returns codes of given characters? charToRaw() might be what you want. Duncan Murdoch Best Regards, hyunjo [[alternative HTML version deleted]] __ R-help@r-project.

Re: [R] No funtions for character code?

2009-10-13 Thread Phil Spector
hyunjo - Perhaps charToInt from the R.oo package? library(R.oo) Loading required package: R.methodsS3 R.methodsS3 v1.0.3 (2008-07-02) successfully loaded. See ?R.methodsS3 for help. R.oo v1.4.6 (2008-08-11) successfully loaded. See ?R.oo for help. charToInt('a') [1] 97 charToInt('7') [1

Re: [R] cdf

2009-10-13 Thread Duncan Murdoch
On 13/10/2009 6:43 PM, David Winsemius wrote: On Oct 13, 2009, at 5:12 PM, maram salem wrote: Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a ,00. I want to use it as the argument of the discretize function of the actuar package. So I think

Re: [R] histogram

2009-10-13 Thread joris meys
On second thought, You'll have to reorganize your data first, and then check the function histogram() in the package lattice. cheers On Wed, Oct 14, 2009 at 12:43 AM, joris meys wrote: > see ?hist > > On Tue, Oct 13, 2009 at 1:06 PM, Dmitry Gospodaryov > wrote: >> Dear R developers,How I can b

[R] No funtions for character code?

2009-10-13 Thread You Hyun Jo
Hello, Do you have a function returns codes of given characters? Best Regards, hyunjo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:

Re: [R] cdf

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 5:12 PM, maram salem wrote: Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a ,00. I want to use it as the argument of the discretize function of the actuar package. So I think I need to define this function to R so that i

[R] tm: Why does adding local metadata take so long?

2009-10-13 Thread Richard R. Liu
I'm running tm 0.5 on R 2.9.2 on a MacBook Pro 17" unibody early 2009 2.93 GHz 4GB RAM. I have a directory with 1697 plain text files on the Mac, that I want to analyze with the tm package. I have read the documents into a corpus, Corpus_3compounds, as follows: # Assign directory to a cha

Re: [R] histogram

2009-10-13 Thread joris meys
see ?hist On Tue, Oct 13, 2009 at 1:06 PM, Dmitry Gospodaryov wrote: > Dear R developers,How I can build a histogram from matrix: > > 0 0.5 1 > > 0.25 34 43 65 > 1 23 35 54 > 4 22 29 42 > 10 21 22 29 > 20 15 17 20 > > (first string is represented names of columns, > first column is represented na

[R] Possible command line bug.

2009-10-13 Thread Noah Silverman
I think I've come across a bug in the command line switches. From "R --help" --vanillaCombine --no-save, --no-restore, --no-site-file, --no-init-file and --no-environ --slave Make R run as quietly as possible -q, --quiet

Re: [R] cdf

2009-10-13 Thread Duncan Murdoch
maram salem wrote: Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a ,00. I want to use it as the argument of the discretize function of the actuar package. So I think I need to define this function to R so that if I entered a=1, I get the follo

Re: [R] cdf

2009-10-13 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of maram salem > Sent: Tuesday, October 13, 2009 2:13 PM > To: r-help > Subject: [R] cdf > > Dear all, > I have the cdf of the following power fuction distribution: > F(y)=(y/350)^a 

Re: [R] Function to find prime numbers

2009-10-13 Thread joris meys
On Tue, Oct 13, 2009 at 5:30 PM, Barry Rowlingson wrote: > On Tue, Oct 13, 2009 at 2:41 PM, Thomas Lumley > wrote: >> On Tue, 13 Oct 2009, AJ83 wrote: >> >>> >>> I need to create a function to find all the prime numbers in an array. Can >>> anyone point me in the right direction? > >  This almos

Re: [R] S4 tutorial

2009-10-13 Thread cls59
Peng Yu wrote: > > I'm looking for some tutorial on S4. I only find the following one, > which is not in English. Can somebody let me know if there is any > introductory material? I'm very familiar with OO and C++. If there is > some material that suits my background, it will be great. > > ht

Re: [R] General means of matching a color specification to an official R color name

2009-10-13 Thread Barry Rowlingson
On Tue, Oct 13, 2009 at 10:58 PM, Bryan Hanson wrote: > Works perfectly!  Thanks Barry.  I had actually seen some suggestions on > using a distance, but by then I was thinking about hcl spaces and distance > isn't so as simple there.  I'm too tired I think. > > Anyway, you've got me running again!

Re: [R] General means of matching a color specification to an official R color name

2009-10-13 Thread Bryan Hanson
Works perfectly! Thanks Barry. I had actually seen some suggestions on using a distance, but by then I was thinking about hcl spaces and distance isn't so as simple there. I'm too tired I think. Anyway, you've got me running again! Thanks, Bryan On 10/13/09 5:12 PM, "Barry Rowlingson" wrote

Re: [R] Iterating over file lines

2009-10-13 Thread Duncan Murdoch
On 13/10/2009 5:27 PM, Albert Vernon Smith wrote: I am attempting to iterate over a file, processing it line by line. In my function below, I am only getting the first item over and over and over again from my test file rather than subsequent lines. How can I modify this to read lines sequential

[R] Time Dependent Cox Model

2009-10-13 Thread quaildoc
I am having trouble formatting some survival data to use in a time dependent cox model. My time dep. variable is habitat and I have it recorded for every day (with some NAs). I think it is working properly except for calculating the death.time. This column should be 1s or 0s and as I have it only

[R] S4 tutorial

2009-10-13 Thread Peng Yu
I'm looking for some tutorial on S4. I only find the following one, which is not in English. Can somebody let me know if there is any introductory material? I'm very familiar with OO and C++. If there is some material that suits my background, it will be great. https://stat.ethz.ch/pipermail/r-he

Re: [R] axis labels

2009-10-13 Thread Don MacQueen
See the 'mgp' argument to par(). You should be able to change mgp to get what you want. -Don At 5:58 PM +0100 10/13/09, jonas garcia wrote: Dear list, why does the distance between the axis labels and the tick marks looks different for x axis and y axis in the plot (see code below). In fact, t

Re: [R] Request Infomation

2009-10-13 Thread joris meys
The easy way out is to send the file containing only the function to the people willing to use it. They can load the function from the file "foo.R" using : source ("path/foo.R") The hard way out is to write a package. For that, see : http://cran.r-project.org/doc/manuals/R-exts.html Cheers Joris

[R] Iterating over file lines

2009-10-13 Thread Albert Vernon Smith
I am attempting to iterate over a file, processing it line by line. In my function below, I am only getting the first item over and over and over again from my test file rather than subsequent lines. How can I modify this to read lines sequentially? == iteratefile <- function(file) { f.con <-

Re: [R] replacing period with a space

2009-10-13 Thread Don MacQueen
There is also the fixed argument to gsub (read the help page!) gsub('.', ' ','a.b',fixed=TRUE) [1] "a b" -Don At 2:34 PM -0300 10/13/09, Henrique Dallazuanna wrote: You need escape the period: gsub("\\.", " ", x$x) On Tue, Oct 13, 2009 at 2:26 PM, Dimitri Liakhovitski wrote: Dear R-er

Re: [R] Request Infomation

2009-10-13 Thread Duncan Murdoch
On 13/10/2009 4:07 PM, Andres Rincon wrote: Hello, I would like to know if is possible to load functions developed by users of R. I have been working in a function related to calculate some indicators to develop a credit scoring. I would like to know about the procedure to load this function

Re: [R] How to specify an ARMA(1, [1,4]) model? Solved

2009-10-13 Thread Len Vir
On Tue, Oct 13, 2009 at 5:06 PM, Rolf Turner wrote: > > Not clear to me what the OP really wants. Perhaps the seasonal > model is what's required; perhaps an arima(1,0,4) model with > theta_2 and theta_3 constrained to be 0. The latter can be > achieved with > >arima(x,order=c(1,0,4),fix

Re: [R] Request Infomation

2009-10-13 Thread stephen sefick
There is a "how to make R packages" in the document section of the cran website. On Tue, Oct 13, 2009 at 3:07 PM, Andres Rincon wrote: > Hello, I would like to know if is possible to load functions developed > by users of R. I have been working in a function related to calculate > some indicators

[R] heatmap.2

2009-10-13 Thread John Celniker
Hi folks, I have been working with the ellipse library and trying to use the heatmap.2 function. I have called the function as follows hh <- heatmap.2(DATA, Rowv= F, trace = "none", colsep=seq(1, 4), rowsep = seq(1,dim(GENES)[1]), col = brewer.pal(9, "YlOrRd"), lmat=rbind( c(3, 4,

[R] heatmap.2

2009-10-13 Thread John Celniker
Hi folks, I have been working with the ellipse library and trying to use the heatmap.2 function. I have called the function as follows hh <- heatmap.2(DATA, Rowv= F, trace = "none", colsep=seq(1, 4), rowsep = seq(1,dim(GENES)[1]), col = brewer.pal(9, "YlOrRd"), lmat=rbind( c(3,

Re: [R] lapply() reccursively

2009-10-13 Thread Kaveh Vakili
Thanks, Chuck's answer is the closest to what i want (gives the same result as cumprod()) ...but using this function seems actually slower than the loop (is it normal ?): a1<-runif(10) cadd<-function(x) Reduce("*", x, accumulate = TRUE) looop<-function(a1){ j<-length(a1) for(i in 2:j){ a1[i

Re: [R] General means of matching a color specification to an official R color name

2009-10-13 Thread Barry Rowlingson
On Tue, Oct 13, 2009 at 9:43 PM, Bryan Hanson wrote: > Hello List Dwellers: > > I¹ve looked around quite a bit, but don¹t quite see an answer that I > understand. > > I¹m looking for a way to take any kind of color specification (rgb, hsv, > hcl, hex) and match it to the n-nearest R official color

Re: [R] lapply() reccursively

2009-10-13 Thread Kaveh Vakili
Thanks,Chuck answer is the closest to what i want (gives the same result as cumprod()) ...but using this function seems actually slower than the loop (is it normal ?): a1<-runif(10) cadd<-function(x) Reduce("*", x, accumulate = TRUE) looop<-function(a1){ j<-length(a1) for(i in 2:j){ a1[i]<-

[R] cdf

2009-10-13 Thread maram salem
Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a   ,00. I want to use it as the argument of the discretize function of the actuar package. So I think I need to define this function to R so that if I entered a=1, I get the following F(y)=(y/350) and

Re: [R] lapply() reccursively

2009-10-13 Thread Kaveh Vakili
Thanks, this is the closest to what i want (gives the same result as cumprod()) ...but using this function seems actually slower than the loop (is it normal ?): a1<-runif(10) cadd<-function(x) Reduce("*", x, accumulate = TRUE) looop<-function(a1){ j<-length(a1) for(i in 2:j){ a1[i]<-a1[i-1

[R] Selecting initial numerals

2009-10-13 Thread PDXRugger
II just want to create a new object with the first two numerals of the data. Not sure why this isnt working, consider the following: EmpEst$naics=c(238321, 624410, 484121 ,238911, 81, 531110, 621399, 541613, 524210 ,236115 ,811121 ,236115 ,236115 ,621610 ,814110 ,812320) EmpEst$naics2<-form

[R] axis labels

2009-10-13 Thread jonas garcia
Dear list, why does the distance between the axis labels and the tick marks looks different for x axis and y axis in the plot (see code below). In fact, the x axis labels look furthest from the tickmarks than in the y axis. How can I make them look the same? par(mfrow=c(1,1), cex.axis = 0.5, cex.

[R] Request Infomation

2009-10-13 Thread Andres Rincon
Hello, I would like to know if is possible to load functions developed by users of R. I have been working in a function related to calculate some indicators to develop a credit scoring. I would like to know about the procedure to load this function and create a package for this kind of subj

Re: [R] How to specify an ARMA(1, [1,4]) model?

2009-10-13 Thread Rolf Turner
Not clear to me what the OP really wants. Perhaps the seasonal model is what's required; perhaps an arima(1,0,4) model with theta_2 and theta_3 constrained to be 0. The latter can be achieved with arima(x,order=c(1,0,4),fixed=c(NA,NA,0,0,NA,NA)) Or perhaps it's something else entirely

[R] General means of matching a color specification to an official R color name

2009-10-13 Thread Bryan Hanson
Hello List Dwellers: I¹ve looked around quite a bit, but don¹t quite see an answer that I understand. I¹m looking for a way to take any kind of color specification (rgb, hsv, hcl, hex) and match it to the n-nearest R official color names. Clearly it is easy to interconvert different specificatio

Re: [R] vis.gam() contour plots

2009-10-13 Thread Jason Gasper
Thanks, that is a big help. David Winsemius wrote: On Oct 13, 2009, at 3:46 PM, Gavin Simpson wrote: On Mon, 2009-10-12 at 22:20 -0400, David Winsemius wrote: On Oct 12, 2009, at 8:20 PM, Jason Gasper wrote: # contour examples vis.gam(g, view=c("x1","x2"),plot.type="contour",color="he

Re: [R] replacing period with a space

2009-10-13 Thread Gabor Grothendieck
Try chartr: > chartr(".", " ", "a.b.c") [1] "a b c" On Tue, Oct 13, 2009 at 1:26 PM, Dimitri Liakhovitski wrote: > Dear R-ers! > > I have x as a variable in a data frame x. > > x<-data.frame(x=c("aa.bb","cc.dd.ee")) > x$x<-as.character(x$x) > x > > I am sorry for such a simple question - but how

Re: [R] vis.gam() contour plots

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 3:46 PM, Gavin Simpson wrote: On Mon, 2009-10-12 at 22:20 -0400, David Winsemius wrote: On Oct 12, 2009, at 8:20 PM, Jason Gasper wrote: # contour examples vis.gam(g, view=c("x1","x2"),plot.type="contour",color="heat", nlevels=20) Warning messages: 1: In plot.window(

Re: [R] decostand

2009-10-13 Thread Gavin Simpson
On Tue, 2009-10-13 at 17:06 +0200, Rosa Manrique wrote: > Hi: > I do not know why the function decostand is not found in my vegan > library, I have downloaded the package recently, and it seems to work > well..Do you have any suggestion? Did you load it in your session for use? Try library(vegan

Re: [R] vis.gam() contour plots

2009-10-13 Thread Gavin Simpson
On Mon, 2009-10-12 at 22:20 -0400, David Winsemius wrote: > On Oct 12, 2009, at 8:20 PM, Jason Gasper wrote: > # contour examples vis.gam(g, > view=c("x1","x2"),plot.type="contour",color="heat", nlevels=20) > Warning messages: > 1: In plot.window(...) : "nlevels" is not a graphical parameter

Re: [R] Greater than less than in "ifelse"

2009-10-13 Thread Henrique Dallazuanna
Try this: with(anderson, cut(log_WBC, c(0, 2.3, 3, max(log_WBC)), labels = c('low', 'medium', 'high'))) On Tue, Oct 13, 2009 at 4:37 PM, Richardson, Patrick wrote: > I'm trying to categorize a continuous variable (yes, I know that's horrible, > but I'm trying to reproduce some exercises from a

Re: [R] Greater than less than in "ifelse"

2009-10-13 Thread Jorge Ivan Velez
Dear Patrick, Take a look at ?cut for some ideas. HTH, Jorge On Tue, Oct 13, 2009 at 3:37 PM, Richardson, Patrick <> wrote: > I'm trying to categorize a continuous variable (yes, I know that's > horrible, but I'm trying to reproduce some exercises from a textbook) and > don't really know an eff

[R] Greater than less than in "ifelse"

2009-10-13 Thread Richardson, Patrick
I'm trying to categorize a continuous variable (yes, I know that's horrible, but I'm trying to reproduce some exercises from a textbook) and don't really know an efficient way to do this. I have a data frame that looks like: surv_time relapse sex log_WBC rx 1 35 0 11.45

Re: [R] time grid for "survfit" Survival function outputs

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 12:03 PM, Muhtar Osman wrote: Dear All, Maybe it is a silly question. But I wasn't able to find it from manual or R site search. After library(survival) , the description of survfit objects will be found with: ?survfit.object I was wondering what is the correspondin

Re: [R] replacing period with a space

2009-10-13 Thread Jason Rupert
Here is one more that works: gsub("."," ","Start.Time", fixed = TRUE) "fixed = TRUE" really helps in a lot of instances for removing specific characters without accidently angering the regular expression gods. Enjoy. --- On Tue, 10/13/09, Dimitri Liakhovitski wrote: > From: Dimitri Liakho

Re: [R] How to specify an ARMA(1, [1,4]) model?

2009-10-13 Thread Duncan Murdoch
On 10/13/2009 2:35 PM, Len Vir wrote: Hi, I'm trying to model an ARMA(1,[1,4]), i.e. I want only lags 1 and 4 of the Moving Average part. It's the '[1,4]' part that is giving me a problem. I've tried different arma's and arima's in different packages, namely: packages tseries, fArma, FinTS, tim

[R] How to specify an ARMA(1, [1,4]) model?

2009-10-13 Thread Len Vir
Hi, I'm trying to model an ARMA(1,[1,4]), i.e. I want only lags 1 and 4 of the Moving Average part. It's the '[1,4]' part that is giving me a problem. I've tried different arma's and arima's in different packages, namely: packages tseries, fArma, FinTS, timeSeries, TSA, Zelig, ds1, forecast For

Re: [R] lapply() reccursively

2009-10-13 Thread Kaveh Vakili
Thanks, Chuck's answer is the closest to what i want (gives the same result as cumprod()) ...but using this function seems actually slower than the loop (is it normal ?): a1<-runif(10) cadd<-function(x) Reduce("*", x, accumulate = TRUE) looop<-function(a1){ j<-length(a1) for(i in 2:j){ a1[i

Re: [R] decostand

2009-10-13 Thread Jorge Ivan Velez
Hi Rosa, It works for me on an R-fresh session: > require(vegan) Loading required package: vegan This is vegan 1.15-4 > ?decostand > sessionInfo() R version 2.9.2 RC (2009-08-23 r49375) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=E

Re: [R] replacing period with a space

2009-10-13 Thread Dimitri Liakhovitski
Thanks a lot for your help, Henrique and Sarah! Dimitri On Tue, Oct 13, 2009 at 1:37 PM, Sarah Goslee wrote: > As you've discovered, the . means something special in regular > expressions (and R's version of them). You need to escape it with \\: > >> x<-data.frame(x=c("aa.bb","cc.dd.ee")) >> x$x<

Re: [R] replacing period with a space

2009-10-13 Thread Henrique Dallazuanna
You need escape the period: gsub("\\.", " ", x$x) On Tue, Oct 13, 2009 at 2:26 PM, Dimitri Liakhovitski wrote: > Dear R-ers! > > I have x as a variable in a data frame x. > > x<-data.frame(x=c("aa.bb","cc.dd.ee")) > x$x<-as.character(x$x) > x > > I am sorry for such a simple question - but how c

Re: [R] replacing period with a space

2009-10-13 Thread Sarah Goslee
As you've discovered, the . means something special in regular expressions (and R's version of them). You need to escape it with \\: > x<-data.frame(x=c("aa.bb","cc.dd.ee")) > x$x<-as.character(x$x) > x x 1aa.bb 2 cc.dd.ee > sub("\\.", " ", x$x) [1] "aa bb""cc dd.ee" > gsub("\\.",

[R] replacing period with a space

2009-10-13 Thread Dimitri Liakhovitski
Dear R-ers! I have x as a variable in a data frame x. x<-data.frame(x=c("aa.bb","cc.dd.ee")) x$x<-as.character(x$x) x I am sorry for such a simple question - but how can I replace all periods in x$x with spaces? sub('.', ' ', x$x) - removes all letters to the left of each period... Thanks a lo

Re: [R] Selecting initial numerals

2009-10-13 Thread Dieter Menne
PDXRugger wrote: > > II just want to create a new object with the first two numerals of the > data. Not sure why this isnt working, consider the following: > > EmpEst$naics=c(238321, 624410, 484121 ,238911, 81, 531110, 621399, > 541613, > 524210 ,236115 ,811121 ,236115 ,236115 ,621610 ,814

Re: [R] lapply() reccursively

2009-10-13 Thread Charles C. Berry
On Tue, 13 Oct 2009, Kaveh Vakili wrote: Hi all, I was wondering whether it is possible to use the lapply() function to alter the value of the input, something in the spirit of : a1<-runif(100) a2<-function(i){ a1[i]<-a1[i-1]*a1[i];a1[i] } a3<-lapply(2:100,a2) Something akin to a for() loop,

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread Kingsford Jones
see https://stat.ethz.ch/pipermail/r-sig-ecology/2008-May/000160.html hth, Kingsford On Tue, Oct 13, 2009 at 6:00 AM, Anne-Katrin Link wrote: > Normal        0        21                        false        false > false > MicrosoftInternetExplorer4 > > > Dear R-helpers, > >          I was wond

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread Jeff Laake
Another package that is not on CRAN or other R depository is RMark. It works with the software MARK which does the computation. You can find RMark at http://www.phidot.org/software/mark/rmark/ and MARK from http://www.phidot.org/software/mark/index.html From the same site you'll find a very c

[R] decostand

2009-10-13 Thread Rosa Manrique
Hi: I do not know why the function decostand is not found in my vegan library, I have downloaded the package recently, and it seems to work well..Do you have any suggestion? Rosa. [[alternative HTML version deleted]] __ R-help@r-project.org mai

[R] can anybody give suggestion on how to use survreg with 3-parameter weibull

2009-10-13 Thread Josephine Sari
Hi, I am a beginner in R. I would like to know if there is any trick in using survreg with 3-parameter weibull? I would like to do survival analysis of failure time but not using the 2-parameter weibull which is available as one of the options in the survreg but instead I would like to see the

[R] response surface designs

2009-10-13 Thread Dmitry Gospodaryov
How I can obtain graphics for response surface design, basing on data: x: 0.25, 1, 4, 10, 20. y: 0, 0.5, 1 z1 (for y = 0): 45, 35, 25, 15, 10. z2 (for y = 0.5): 50, 45, 36, 21, 17. z3 (for y = 1): 37, 34, 22, 17, 11? z-values should be scaled in colour (e. g. from red to blue). I consider to use p

[R] histogram

2009-10-13 Thread Dmitry Gospodaryov
Dear R developers,How I can build a histogram from matrix: 0 0.5 1 0.25 34 43 65 1 23 35 54 4 22 29 42 10 21 22 29 20 15 17 20 (first string is represented names of columns, first column is represented names of rows) where names of columns should be x-axis labels; respectively to this, I want t

Re: [R] how to output profile plots for groups using lattice package

2009-10-13 Thread George Kalema
A million thanks Peter, subsetting fixed it. George On Mon, Oct 12, 2009 at 11:51 PM, Peter Ehlers wrote: > Hi George, > > Your problem is not with xyplot, but with the NA occurrences in > your data. Try adding > > subset = {!is.na(MSE)}, > > to your xyplot call, or (better), subset the data be

[R] how to have tkchooseDirectory resize in windows?

2009-10-13 Thread David Gattrell
R-2.8.0 / tcltk8.5 In windows, Rgui.exe has a directory browser that can be resized, but when I call tkchooseDirectory(), it is a fixed size. In linux, when I call tkchooseDirectory() it can be resized. How do I get a windows version that I can resize? [[alternative HTML version deleted]

Re: [R] SPSS long variable names

2009-10-13 Thread Frank E Harrell Jr
Orvalho Augusto wrote: Sadlly exportation to csv or another format is not implemented yet: http://www.gnu.org/software/pspp/manual/html_node/Not-Implemented.html Caveman That would not solve the problem anyway because you would not get labels and other variable attributes. Frank On Tue,

[R] time grid for "survfit" Survival function outputs

2009-10-13 Thread Muhtar Osman
Dear All, Maybe it is a silly question. But I wasn't able to find it from manual or R site search. I was wondering what is the corresponding time axis for survival function outputs in "survfit". I think it is "survfit(...)$time", but not 100% sure. If it is, is it possible we could make surviv

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 8:00 AM, Anne-Katrin Link wrote: I was wondering whether there are any good books and/or website links that introduce mark-recapture analysis in R. In particular, I am interested in exploratory data analysis of resighting data and how to create capture histories

Re: [R] SPSS long variable names

2009-10-13 Thread Orvalho Augusto
Sadlly exportation to csv or another format is not implemented yet: http://www.gnu.org/software/pspp/manual/html_node/Not-Implemented.html Caveman On Tue, Oct 13, 2009 at 4:41 PM, joris meys wrote: > Just for clarity : the csv format will solve your problem, as the > restrictions on the variabl

Re: [R] lapply() reccursively

2009-10-13 Thread hadley wickham
> Neither a1 nor 2:100 are lists, so it would seem that sapply would be more > appropriate. The difference between lapply and sapply is the output, not the input. Hadley -- http://had.co.nz/ __ R-help@r-project.org mailing list https://stat.ethz.ch/m

[R] Free Introductory R Course Taught Over the Web

2009-10-13 Thread Paul H Geissler
Free Introductory R Course Taught Over the Web The course is designed for natural resource managers and is open to all who are interested without charge. Audio of the presentations is available either using your computer speakers and optional microphone or headset or by calling a phone bridge l

Re: [R] Counting

2009-10-13 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Ashta > Sent: Tuesday, October 13, 2009 5:20 AM > To: R help > Subject: [R] Counting > > *Hi all, > * > > *Assume that I have the following data set with tow > variables and I

Re: [R] SPSS long variable names

2009-10-13 Thread Orvalho Augusto
No! That is variable labels. Caveman On Tue, Oct 13, 2009 at 4:52 PM, Robert Baer wrote: >>> I am wondering if there is a patch for the SPSS reading >>> code on the >>> foreign package, in order to be able to read long variable >>> names. >>> Right now read.spss() just trunc the names to 8 >>

Re: [R] lapply() reccursively

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 7:33 AM, Kaveh Vakili wrote: Hi all, I was wondering whether it is possible to use the lapply() function to alter the value of the input, something in the spirit of : a1<-runif(100) a2<-function(i){ a1[i]<-a1[i-1]*a1[i];a1[i] } a3<-lapply(2:100,a2) Neither a1 nor 2:100

Re: [R] Function to find prime numbers

2009-10-13 Thread Barry Rowlingson
On Tue, Oct 13, 2009 at 2:41 PM, Thomas Lumley wrote: > On Tue, 13 Oct 2009, AJ83 wrote: > >> >> I need to create a function to find all the prime numbers in an array. Can >> anyone point me in the right direction? This almost sounds like a homework problem to me... So here's a solution that you

Re: [R] How to choose a proper smoothing spline in GAM of mgcv package?

2009-10-13 Thread Simon Wood
> I have 5 datasets. I would like to choose a basis spline with same knots in > GAM function in order to obtain same basis function for 5 datasets. > Moreover, the basis spline is used to for an interaction of two covarites. The `knots' argument to `gam' allows you to fix the knot locations used w

Re: [R] svy / weighted regression

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 6:07 AM, Laust wrote: Dear David, Thanks again for your input! I realize that I did a bad job of explaining this in my first email, but the setup is that in Finland persons who die are sampled with a different probability (1) from those who live (.5). This was done by the F

  1   2   >