Re: [R] really dumb question | loop counters in

2007-09-23 Thread Petr PIKAL
Hi > Paul Hiemstra wrote: > > Hi, > > > > This works: > > > > for(i in seq(1,100,5)) { > > print(i) > > } > > > > Very similar to the way python does this kind of loop. > > > > Indeed it is - thanks for the tip. I'm still puzzled why I can't find a > single piece of the standard [R] language do

[R] Separate colour for comments in scripts

2007-09-23 Thread Sumit.Gupta
Hi, Is it possible to assign a separate colour for comments written with #, eg:- #this is a comment . I am looking to colour them differently from the program text in R-Editor (not console). Is it possible to do so? Eg. In Visual basic, the colour for remarks gets green automatically Regards S

Re: [R] nls fits by groups

2007-09-23 Thread Christian Ritz
Dear Aleksi, there are other approaches you could consider: using nls or gnls (in the package nlme): m1 <- nls(y ~ a[group]*x^b[group], start=list(a=c(1, ..., 1), b=c(1, ..., 1))) or m2 <- gnls(rate ~ a*x^b, params=list(a~group-1, b~group-1), start=list(a=c(1, ..., 1), b=c(1, ..., 1))) In

[R] What is RDA file and how to open it in R program?

2007-09-23 Thread Jittima Piriyapongsa
Hi, I have a set of gene expression data in .RDA file. I have downloaded Bioconductor and R program for analyzing these data. Anyway, I am not sure how to open this RDA file in R program (what is the command?) in order to look at these data. And which package should I use for analyzing it e.g. plo

Re: [R] Plotting numbers at a specified decimal length on a plot()

2007-09-23 Thread Marc Schwartz
On Sun, 2007-09-23 at 13:50 -0400, Matthew Dubins wrote: > Hi there, > > I want to figure out how to plot means, with 2 decimal places, of any Y > variable on a scatterplot according to any X variable (which obviously > should have limited scope). I already figured out how to plot the > means,

Re: [R] Network Construction in R

2007-09-23 Thread elw
> I am trying to construct a social network from a data frame with rows > >acra numa acrb numb yearexpab eaboimpab iabo > 10 USA2 CAN 20 1957 4017.000 0.0 3187.000 0.0 > 91 USA2 CUB 40 1957 628.000 0.0 526.000 0.0 > 144 USA2 HAI 41 1957

Re: [R] Plotting numbers at a specified decimal length on a plot()

2007-09-23 Thread P Ehlers
I find sprintf() useful for this. Compare lab <- rnorm(8) plot(1:10) text(2:9, 2:9, lab) with lab2 <- sprintf("%4.2f", lab) plot(1:10) text(2:9, 2:9, lab2) - Peter Ehlers Matthew Dubins wrote: > Hi there, > > I want to figure out how to plot means, with 2 decimal places, of any Y > variable

Re: [R] saving results under specified file name

2007-09-23 Thread Nitin Jain
On 9/23/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > > Frank E Harrell Jr wrote: > > Nitin Jain wrote: > > > >> Thanks Professor Ripley and Professor Harrell. > >> > >> Yes, save(list=newname, ...) works. > >> > >> Best, > >> Nitin > >> > > > > What I didn't see how to do with save( ) is to save

[R] Plotting numbers at a specified decimal length on a plot()

2007-09-23 Thread Matthew Dubins
Hi there, I want to figure out how to plot means, with 2 decimal places, of any Y variable on a scatterplot according to any X variable (which obviously should have limited scope). I already figured out how to plot the means, but without limiting their precision to 2 decimal places. This is

[R] Network Construction in R

2007-09-23 Thread Johannes Urpelainen
Hi, I am trying to construct a social network from a data frame with rows acra numa acrb numb yearexpab eaboimpab iabo 10 USA2 CAN 20 1957 4017.000 0.0 3187.000 0.0 91 USA2 CUB 40 1957 628.000 0.0 526.000 0.0 144 USA2 HAI 41 1957 25.00

[R] Beginners question about Percentage similarity in R?

2007-09-23 Thread Richard Price
I have been reading a paper whereby the authors took values from Sorensons dissimilarity index and values from a percentage similarity index and applies G-Testing to the table of values. This is carried out to assess the differences in spider faunas (Strattton and Uetz, 1979). I like the method b

Re: [R] saving results under specified file name

2007-09-23 Thread Duncan Murdoch
Frank E Harrell Jr wrote: > Nitin Jain wrote: > >> Thanks Professor Ripley and Professor Harrell. >> >> Yes, save(list=newname, ...) works. >> >> Best, >> Nitin >> > > What I didn't see how to do with save( ) is to save an object with a > user-specified internal name that is different from

Re: [R] find all objects of a particular class

2007-09-23 Thread Henrique Dallazuanna
Perhaps, object <- sapply(ls(), function(x)class(eval(parse(text=x object[grep("character", object)] -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 23/09/2007, Zhang Honglian <[EMAIL PROTECTED]> wrote: > > >Hello, > >I would like t

Re: [R] saving results under specified file name

2007-09-23 Thread Frank E Harrell Jr
Nitin Jain wrote: > Thanks Professor Ripley and Professor Harrell. > > Yes, save(list=newname, ...) works. > > Best, > Nitin What I didn't see how to do with save( ) is to save an object with a user-specified internal name that is different from the current name of the object. Save in Hmisc g

Re: [R] nls fits by groups

2007-09-23 Thread Ken Knoblauch
Aleksi Lehtonen gmail.com> writes: > I am trying to estimate several non-linear models simultaneously. I don't > want to use non-linear mixed model, but non-linear model with same form, but > it should be estimated separately according to variable group (I have lots > of groups that have lots of

Re: [R] saving results under specified file name

2007-09-23 Thread Nitin Jain
Thanks Professor Ripley and Professor Harrell. Yes, save(list=newname, ...) works. Best, Nitin - Original Message From: Prof Brian Ripley <[EMAIL PROTECTED]> To: Nitin Jain <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Sent: Sunday, September 23, 2007 11:14:37 AM Subject: Re: [R] saving

[R] Correlated frailty model

2007-09-23 Thread ah06981
Dear R-help, I am trying to a estimate a correlated frailty model. My dataset is made up of 4 observations. I would like to know if it is too big or I have done some mistakes in the following code. group<-paste(usa$id,usa$mob) mixed.logn<-coxme(Surv(yearspan)~ south+mod, data=usa,random= ~ 1

[R] glmpath: how to choose best lambda

2007-09-23 Thread Tirthadeep
Hi all, I am using glampath package for L1 regularized logistic regression. I have read the article " L1 regularization path algorithm for GLM" by park and Hastie (2006). One thing I can't understand that how to find best lambda for my prediction. I want to use that lambda for the prediction not

Re: [R] A weird observation from using read.table

2007-09-23 Thread Bartjoosen
Take a look at ?scan. There is an explanation for the doubling of the string Bart Jun Ding wrote: > > Hi Everyone, > > Recently I got puzzled by the function read.table, > even though I have used it for a long time. > > I have such a file (tmp.txt, 2 rows and 3 columns, > with a space am

Re: [R] find all objects of a particular class

2007-09-23 Thread Zhang Honglian
Hello, I would like to find all objects of a particular class. Is that possible to do so in R? I knew that in SPLUS, the function objects(class="classname") can do this. But in R, I cannot find the similar function to do so. Is there any way that I can distinguish where an object c

Re: [R] help with rq

2007-09-23 Thread Uwe Ligges
Vivian wrote: > I used in 2004 an earlier version of R (1.6.0 ?) for quantile regressions > > > > Now I downloaded version 2.5.1-win32 and I cannot A) read my old files (Our > exel working space was saved in csv) and also the series of instructions > does not work, see below (B) rq function i

Re: [R] nls fits by groups

2007-09-23 Thread Gabor Grothendieck
Check out the subset= argument to nls, e.g. to regress Sepal.Length on Sepal.Width separately for each Species using the built in iris data set: f <- function(s) nls(Sepal.Length ~ a*Sepal.Width, data = iris, start = c(a = 1), subset = iris$Species == s) sapply(levels(iris$Species), f, simplify

Re: [R] saving results under specified file name

2007-09-23 Thread Prof Brian Ripley
>From the help page for save: Arguments: ...: the names of the objects to be saved (as symbols or character strings). list: A character vector containing the names of objects to be saved. so you need save(list=newname, ...). On Sun, 23 Sep 2007, Nitin Jain wro

Re: [R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread Zhang Honglian
I don't know what exactly you want the program to do. But if you want to let the function to return several values in the same time, you have to put them into a list. E.g. in the following program, the function will return 4 different things, x and y are vectors, prob is a matrix and p

Re: [R] nls fits by groups

2007-09-23 Thread Katharine Mullen
It is not clear from your post what changes per-group. If only the starting values change (but the data and the model structure are the same), then you can just store the starting values you want to use for each group in a list, and then index into this list in your call to nls. e.g., modifying a

[R] nls fits by groups

2007-09-23 Thread Aleksi Lehtonen
Dear Colleagues, I am trying to estimate several non-linear models simultaneously. I don't want to use non-linear mixed model, but non-linear model with same form, but it should be estimated separately according to variable group (I have lots of groups that have lots of observations). I would

Re: [R] saving results under specified file name

2007-09-23 Thread Frank E Harrell Jr
Nitin Jain wrote: > Hello, > > I would like to save the results in a specified file name. Here is a test > example: > > > aa <- function(xx, newname) { > yy <- xx^2 > rdName <- file.path(paste(newname, ".RData", sep = "")) > assign(eval(newname), yy) > save(newname, file=rdName) ## F

Re: [R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread zhijie zhang
Dear Prof. Brian Ripley, You are absolutely right. The warning message in R for my Chinese Windows system is Chinese words, so i translate it into english, which maybe not that exact in the meanings. Thanks very much. On 9/23/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > > On Sun, 23 Se

[R] saving results under specified file name

2007-09-23 Thread Nitin Jain
Hello, I would like to save the results in a specified file name. Here is a test example: aa <- function(xx, newname) { yy <- xx^2 rdName <- file.path(paste(newname, ".RData", sep = "")) assign(eval(newname), yy) save(newname, file=rdName) ## FIXME } aa(3, "test") load("test.RData

[R] Any functions available for significant increment in R-square?

2007-09-23 Thread Xingwang Ye
Dear all, Are there any functions available for calculate significant increment in R-square? Following is a link for what's "significant increment in R2". http://www.psy.jhu.edu/~ashelton/courses/stats315/week2.pdf Thank you. Yours, sincerely, Xingwang Ye __

Re: [R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread Prof Brian Ripley
On Sun, 23 Sep 2007, Peter Dalgaard wrote: > zhijie zhang wrote: >> Dear friends, >> Now, when i use the argument return(x=x,y=y,prob=prob) , R displays the >> waring message: >> Warning message: >> The return value for multiple variables wasn't used in: return(x = x, y = >> gy, prob = prob) >>

Re: [R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread zhijie zhang
It works well. Thanks a lot. On 9/23/07, Christian Ritz <[EMAIL PROTECTED]> wrote: > > Hi! > > Use a list structure for all the components you want to have returned > by the function: > > > return(list(x=x, y=y, prob=prob)) > > > > Christian > -- With Kind Regards, oooO: (..):::

Re: [R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread Christian Ritz
Hi! Use a list structure for all the components you want to have returned by the function: return(list(x=x, y=y, prob=prob)) Christian __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread Peter Dalgaard
zhijie zhang wrote: > Dear friends, > Now, when i use the argument return(x=x,y=y,prob=prob) , R displays the > waring message: > Warning message: > The return value for multiple variables wasn't used in: return(x = x, y = > gy, prob = prob) > I used the methods of "help.search("return")" and

[R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread zhijie zhang
Dear friends, Now, when i use the argument return(x=x,y=y,prob=prob) , R displays the waring message: Warning message: The return value for multiple variables wasn't used in: return(x = x, y = gy, prob = prob) I used the methods of "help.search("return")" and "?return" to get some help, but di

Re: [R] R Extensions: Hyperlinking a pdf (not generated by Sweave/not a vignette) from a .Rd file

2007-09-23 Thread Prof Brian Ripley
On Sat, 22 Sep 2007, [EMAIL PROTECTED] wrote: > When constructing an R extension, how can a hyperlink from an .Rd file > to a pdf (not generated by Sweave, so not a vignette) located in the > inst/doc folder be constructed? With \url. I presume you mean writing a package, and installing into t