[R] use bootstrap to get MLE of lamda from the exp model

2008-03-13 Thread jinjin
the data are 3,5,7,18,43,85,91,98,100,130,230,487, it follows an exp(lamda) model, how to use bootstrap to obtain MLE of lamda, bias, sd. Thanks a lot so far my code is obj<-boot(data,statistic,R=2000) here statistic should call a function to get an estimate of lamda I

Re: [R] survival curve for only certain values of a factor

2008-03-13 Thread Dieter Menne
Chang Liu hotmail.com> writes: > > data(aml) > If I use instead dummy variables: > > aml$x1 = (aml$x=="maintained")aml$x2 = (aml$x=="unmaintained") > and I want to plot the survival curve using x1, x2, and I just want the 2 levels, rather than 4 curves from: I don's understand what you want, b

Re: [R] Bessel functions of complex argument

2008-03-13 Thread baptiste Auguié
Many thanks for this information! I'm pretty sure Matlab can handle complex argument in besselj, although i haven't checked myself, < http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/ access/helpdesk/help/techdoc/ref/besselj.html > After some more thinking, it turns out my cod

[R] incomplete final line by readTableHeader?

2008-03-13 Thread Dai Nishikawa
Dear everyone I tried reading my own Excel spreadsheet data in R, but kept getting an warning message 'incomplete final line by readTableHeader'F:\mm1data.xls'. On viewing its rows and columns, only 'NA's were returned. Having difficult time with this problem for too long, any solution would be

Re: [R] Spatially Lagged Predictor Variable Models

2008-03-13 Thread Thibaut Jombart
ArunPrasad wrote: > Hi Everyone, > I am doing a project based on "Spatially Lagged Predictor > Variable Models", I would like to know which package in R would execute this > model. Also, I am new to this field of spatial statistics. Any suggestions > for a good book on spatial regressi

[R] Sealed for setGeneric

2008-03-13 Thread Christophe Genolini
Hi the list When two setGeneric occurs on the same function, the second erage the first and erase all the function previously define. Is it possible to prevent that ? Is it possible to declare a setGeneric that can not be erased later ? Something like the |sealed for setMethod...| || |Thanks| ||

[R] How to set type of censored data in coxph regression

2008-03-13 Thread Hung-Hsuan Chen (Sean)
Dear R users, I tried to analysis the hazard function of some data by coxph function in survival package. The type of the data include "left-censored", "right-censored", "both right-censored and left-censored" (btw, does this has a technical term?), and "complete" ones. I noticed that event (one p

Re: [R] howto find corresponding values in datasource?

2008-03-13 Thread bartjoosen
The x coordinate of the max y value: x[which.max(mydiff$y)] Jonas Stein wrote: > > Hi, > > > i am sure, that this is a noob-question, but i have searched for > hours without any good result. > > I want to draw a vertical line through the maximum of the first > derivation. > > Here is a

Re: [R] Specifying relative position of text in a plot

2008-03-13 Thread Prof Brian Ripley
On Thu, 13 Mar 2008, Tom La Bone wrote: > Thanks for all of the suggestions. The key key here seems to be using the > "par" function to change the coordinate system like so > > plot(rnorm(100), rnorm(100)) > op <- par("usr") > par(usr = c(0, 1, 0, 1)) > text(0.5,0.5,"TEST") > par(usr = op) > > Pro

Re: [R] Specifying relative position of text in a plot

2008-03-13 Thread Tom La Bone
Thanks for all of the suggestions. The key key here seems to be using the "par" function to change the coordinate system like so plot(rnorm(100), rnorm(100)) op <- par("usr") par(usr = c(0, 1, 0, 1)) text(0.5,0.5,"TEST") par(usr = op) Prof Ripley commented that this approach will also work on l

[R] recover masked functions?

2008-03-13 Thread Werner Wernersen
Hi, I have loaded the packages car, memisc, Hmisc and all of these implement the function recode. The order in which the packages are loaded depends on the order I execute my scripts and thus is not always the same and the syntax of the recode function changes with the package. Is there any way t

Re: [R] recover masked functions?

2008-03-13 Thread Duncan Murdoch
Werner Wernersen wrote: > Hi, > > I have loaded the packages car, memisc, Hmisc and all > of these implement the function recode. The order in > which the packages are loaded depends on the order I > execute my scripts and thus is not always the same and > the syntax of the recode function changes

[R] Compare two correlations matrices

2008-03-13 Thread Martin Kaffanke
Hi there, When I make two correlations matrices of the same size from a <- cor(el[1:20]) b <- cor(fl[1:20]) how can I compare if this matrices are equal? Thanks, Martin -- Ihr Partner für Webdesign, Webapplikationen und Webspace. http://www.roomandspace.com/ Martin Kaffanke +43 650 4514224

Re: [R] recover masked functions?

2008-03-13 Thread Henrique Dallazuanna
Use: memisc::recode() car::recode() Hmisc::recode() On 13/03/2008, Werner Wernersen <[EMAIL PROTECTED]> wrote: > Hi, > > I have loaded the packages car, memisc, Hmisc and all > of these implement the function recode. The order in > which the packages are loaded depends on the order I > execut

Re: [R] Sealed for setGeneric

2008-03-13 Thread Charilaos Skiadas
On Mar 13, 2008, at 5:04 AM, Christophe Genolini wrote: > Hi the list > > When two setGeneric occurs on the same function, the second erage the > first and erase all the function previously define. > Is it possible to prevent that ? Is it possible to declare a > setGeneric > that can not be eras

[R] R Finance

2008-03-13 Thread Ruby
Hi, I am an R novice working with financial data. I am developing a portfolio strategy evaluation technique to back-test the performance of our screens; checking how the screened stock would've performed over the period in question. I am using quantmod in R to download the historical data from ya

Re: [R] internet proxy settings (win)

2008-03-13 Thread Thomas Steiner
Thank you Philipp for your suggestions. In Rprofile.site every line is commented out and I could not find any .Rprofile. I even tried starting R with additional cmdline arguments --no-environ and --no-init-file. Still > update.packages(ask='graphics') --- Please select a CRAN mirror for use in this

Re: [R] Compare two correlations matrices

2008-03-13 Thread Henrique Dallazuanna
Try: all.equal(cor(d), cor(e)) identical(cor(d), cor(e)) cor(d) == cor(e) On 13/03/2008, Martin Kaffanke <[EMAIL PROTECTED]> wrote: > Hi there, > > When I make two correlations matrices of the same size from > > a <- cor(el[1:20]) > b <- cor(fl[1:20]) > > how can I compare if this matrices a

[R] cumsum list..

2008-03-13 Thread yoooooo
Hi all, i have the following.. a <- data.frame(data = seq(1,10)) i have indices: x <- c(1, 5, 3, 9) y <- c(2, 7, 4, 10) I want the cumsum of a[1:2], a[5:7], a[3:4]... is there an elegant way to do it without any loop? Thanks! -- View this message in context: http://www.nabble.com/cumsum-l

Re: [R] cumsum list..

2008-03-13 Thread Gabor Csardi
cumsum( mapply(function(i,j) sum(a$data[i:j]), x, y) ) Is this what you want? Gabor On Thu, Mar 13, 2008 at 06:02:13AM -0700, yoo wrote: > > Hi all, i have the following.. > > a <- data.frame(data = seq(1,10)) > > i have indices: > x <- c(1, 5, 3, 9) > y <- c(2, 7, 4, 10) > > I want the

Re: [R] R Finance

2008-03-13 Thread davidr
I guess I would create a mapping table to convert between the symbols from Bloomberg and from Yahoo. You should be able to just create it once and add to it as new symbols appear on your screens. Most of the symbols should be the same so you could omit those. If it all has to be automated, you coul

[R] joining matrices, vectors, scalars in one object

2008-03-13 Thread Gonçalo Ferraz
Hi, I have: a <- matrix(c(0,1,0,1),nrow=2) b <- matrix(c(1,1,1,0,0,0),nrow=3) c <- 1 d <- c(1,0,1) And I would like to join them in an object 'thing' so that I can access a, b, c, or d through an index in a for loop. For example: thing[4] would return [1] 1 0 1 Note however, that I have m

Re: [R] joining matrices, vectors, scalars in one object

2008-03-13 Thread Gabor Csardi
You want to do thing <- list()# empty thing for ( i in 1:100 ) { thing[[i]] <- ? } But where is ? coming from? If you can index it with an integer then it is exactly coming from the kind of object you want to create. Chicken-egg problem. No? G. On Thu, Mar 13, 2008 at 09:04:11A

Re: [R] type of object of a variable in a data frame

2008-03-13 Thread David Winsemius
Chang Liu <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > 3. The reason I want it to be a list or vector, is that I want to > fill in some blank values, i can't seem to do things like: > data$V1[1] = 3 Is it because these variables are pointers? Is there > a better way to do this? > Yo

[R] a more elegant way to get percentages?

2008-03-13 Thread Monica Pisica
Hi, I am trying to get percentages in a more elegant way. I have a data.frame with locations and values (counts) of species at that location. Each location is repeated for each species i have values for and i would like to get percentages of each species at that location. I am not sure if i am

Re: [R] joining matrices, vectors, scalars in one object

2008-03-13 Thread Dimitris Rizopoulos
I think you need: thing <- vector("list", 4) for (i in seq_along(thing)) { thing[[i]] <- # what you want to put here } Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0

[R] lmer and correlation

2008-03-13 Thread R Help
Hello list, I've been reading through the archives and it seems as though, as of right now, there is no way to specify the correlation structure in lmer. I was wondering if anyone knows if this is going to be implemented? I'm using mixed-effects models within a tree structure, so I make a lo

Re: [R] a more elegant way to get percentages?

2008-03-13 Thread Dimitris Rizopoulos
try the following: x <- read.table(textConnection("locat val 1 a 5 2 b 5 3 b 15 4 c 5 5 c 20 6 c 5 7 c 10 8 d 5 9 d 15 10 d 10"), header = TRUE) x$percent1 <- unlist(tapply(x$val, x$locat, function(x){ round(100 * x / sum(x), 2)

Re: [R] a more elegant way to get percentages?

2008-03-13 Thread Gabor Grothendieck
Assuming your x is as follows: x <- data.frame(locat = c("a", "b", "b", "c", "c", "c", "c", "d", "d", "d"), val = c(5, 5, 15, 5, 20, 5, 10, 5, 15, 10)) Try this: x$percent1 <- ave(x$val, x$locat, FUN = function(x) 100*x/sum(x)) On Thu, Mar 13, 2008 at 9:36 AM, Monica Pisica <[EMAIL PROTECT

Re: [R] a more elegant way to get percentages?

2008-03-13 Thread Christos Hatzis
Monica, You can try the following: > x.tot <- aggregate(x$val, by=list(total=x$locat), 'sum') > x.tot total x 1 a 5 2 b 20 3 c 40 4 d 30 > cbind(x, perc=x$val/rep(x.tot$x, table(x$locat)) * 100) locat val perc 1 a 5 100.0 2 b 5 25.0 3 b 15

Re: [R] Negative/ positive rolling correlation

2008-03-13 Thread David Winsemius
Rthoughts <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > There is one question I have though. I can see that worksheets and > history can be saved, however I am beat as to exactly what they > save? Do they save the command lines and associated data sheets and > graphs? There is no "da

[R] How to set type of censored data in coxph regression

2008-03-13 Thread Terry Therneau
> Dear R users, > I tried to analysis the hazard function of some data by coxph function in > survival package. >The type of the data include "left-censored", "right-censored", "both > right-censored and > left-censored" (btw, does this has a technical term?), and "complete" ones. The coxph func

Re: [R] a more elegant way to get percentages?

2008-03-13 Thread Monica Pisica
Hi everybody, I am amazed how quick i got my answer ;-) I have to recognize that Gabor's code really puts to shame my skills in doing any programming in R. Is there any book or documentation which really explains in details all these neat tricks from {stats} like ave (i even didn't know this

[R] How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ?

2008-03-13 Thread Ng Stanley
Hi, How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ? > cbind(1:2, 1:10) [,1] [,2] [1,]11 [2,]22 [3,]13 [4,]24 [5,]15 [6,]26 [7,]17 [8,]28 [9,]1

Re: [R] Sealed for setGeneric

2008-03-13 Thread Martin Morgan
Christophe Genolini <[EMAIL PROTECTED]> writes: > Hi the list > > When two setGeneric occurs on the same function, the second erage the > first and erase all the function previously define. 'erase' is only true if you attempt to define the generic in the same name space (e.g., in the global envi

Re: [R] [PS] Re: a more elegant way to get percentages? (now R books)

2008-03-13 Thread Ben Fairbank
Monica -- There has been a virtual population explosion of R books in recent years and we all have our favorites. You may wish to pick one oriented toward your specialty, but the absolute minimum lowest common denominator (by which I mean that it has the ground zero essential information that all

[R] How to manipulate data according to groups ?

2008-03-13 Thread Ng Stanley
Hi, I have a two columns data, the first column are values, and second column are the groups. For this example, there are 3 groups 1,2,3. How can I manipulate the values in the first column according to groups, say I would like to find mean, sum, and standard deviation for the different groups ?

[R] how to generate bar charts with the standard deviation

2008-03-13 Thread Ng Stanley
Hi, I have the two vectors mean and sd of individual columns, but I am unsure how to generate bar charts with the standard deviation, even after looking the help of barplot and barplot.2. [[alternative HTML version deleted]] __ R-help@r-project

Re: [R] [PS] How to manipulate data according to groups ?

2008-03-13 Thread Ben Fairbank
Look at ?tapply, based on your description, it is what you want. Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ng Stanley Sent: Thursday, March 13, 2008 9:25 AM To: r-help Subject: [PS] [R] How to manipulate data according to groups ? Hi, I have

Re: [R] a more elegant way to get percentages?

2008-03-13 Thread Liaw, Andy
From: [EMAIL PROTECTED] > > Now that people have answered Monica's query, can someone help me?!! > See below. > > On 13-Mar-08 13:36:03, Monica Pisica wrote: > > > > Hi, > > > > I am trying to get percentages in a more elegant way. I have a > > data.frame with locations and values (counts) of s

Re: [R] a more elegant way to get percentages?

2008-03-13 Thread Ted Harding
Now that people have answered Monica's query, can someone help me?!! See below. On 13-Mar-08 13:36:03, Monica Pisica wrote: > > Hi, > > I am trying to get percentages in a more elegant way. I have a > data.frame with locations and values (counts) of species at that > location. Each location is r

Re: [R] How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ?

2008-03-13 Thread Gabor Grothendieck
Try converting them to time series, cbinding and unconverting: cbind(x = ts(x), y = ts(y))[TRUE, ] On Thu, Mar 13, 2008 at 10:13 AM, Ng Stanley <[EMAIL PROTECTED]> wrote: > Hi, > > How to cbind or rbind different lengths vectors/arrays without repeating the > elements of the shorter vectors/arra

Re: [R] a more elegant way to get percentages?

2008-03-13 Thread Erik Iverson
Ted - (Ted Harding) wrote: > Now that people have answered Monica's query, can someone help me?!! > See below. > > > With Monica's dataframe as above, the answer would be 100*x[,1]/z > where we want z to be c(5,20,20,40,40,40,40,30,30,30). > > So, intending to give Monica a helpful answer, I tr

Re: [R] a more elegant way to get percentages?

2008-03-13 Thread Dimitris Rizopoulos
well, check what the apply() gives for each row of 'x', i.e., x <- read.table(textConnection("locat val 1 a 5 2 b 5 3 b 15 4 c 5 5 c 20 6 c 5 7 c 10 8 d 5 9 d 15 10 d 10"), header = TRUE) # apply() uses as.matrix() for data frames #

Re: [R] need automake/autoconf help to build RnetCDF and ncdf packages

2008-03-13 Thread Adam Wilson
Greetings all, I recently tried to install RNetCDF from within R (install.packages) on Fedora Core 8 (with netcdf 3.6.2 and netcdf-devel 3.6.2 already installed). This resulted in an error because the netcdf header files are installed in /usr/include/netcdf-3 rather than /usr/include which is wh

[R] [R-pkgs] new version of minpack.lm

2008-03-13 Thread Katharine Mullen
The package minpack.lm allows nonlinear regression problems to be addressed with a modification of the Levenberg-Marquardt algorithm based on the implementation of 'lmder' and 'lmdif' in MINPACK. Version 1.0-8 of the package is now available on CRAN. Changes in version 1.0-8 include: o possib

[R] factanal and plotting?

2008-03-13 Thread Martin Kaffanke
Hi there! To make a good choice for the estimation of the number of usefull factors. And I'd like to plot a graph like: http://de.wikipedia.org/wiki/Bild:Parallelanalyse.jpg where I don't need the green line (random values). But with str(factanal(data, factors=10)) I cannot figure out where I

Re: [R] how to generate bar charts with the standard deviation

2008-03-13 Thread Marc Schwartz
Ng Stanley wrote: > Hi, > > I have the two vectors mean and sd of individual columns, but I am unsure > how to generate bar charts with the standard deviation, even after looking > the help of barplot and barplot.2. Barplots are not well suited for presenting continuous data and many would argu

[R] lars with weights - unshrunk coef do not match with lm with weights

2008-03-13 Thread Young Cho
I have been looking at 'lars' pkg and got puzzled by the behavior of function 'lars'. I want to do weighted lasso regression and can't get a match from lars output with lm output. Here is an example: y = rnorm(10) x = matrix(runif(50),nrow=10) X = data.frame(y,x) z = runif(10) X = data.frame(y,x,z

[R] lars with weights do not match with lm output

2008-03-13 Thread Young Cho
I got my posting bounced and sorry if I accidentally post twice. I have been looking at 'lars' pkg and got puzzled by the behavior of function 'lars'. I want to do weighted lasso regression and can't get a match from lars output with lm output. Here is an example: y = rnorm(10) x = matrix(runif(50

[R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Ravi Varadhan
Hi, I have noticed that there is a change in the use of ellipses or . in R versions 2.6.1 and later. In versions 2.5.1 and earlier, the . were always at the end of the argument list, but in 2.6.1 they are placed after the main arguments and before method control arguments. This results in the

[R] fast way to compare two matrices of combinations

2008-03-13 Thread Mark W Kimpel
I have a list (length 750), each element containing a vector of unique strings (unique gene ids), with length up to ~40 (median 15). I want to compile a matrix of all possible triplets and their frequency within gene elements. Using combn and a lot of looping, I am accomplishing this but it is

Re: [R] fast way to compare two matrices of combinations

2008-03-13 Thread Erik Iverson
Hello Mark - It may help if you provide a (small) set of example input and what you'd like as your output. Best, Erik Iverson Mark W Kimpel wrote: > I have a list (length 750), each element containing a vector of unique > strings (unique gene ids), with length up to ~40 (median 15). I want to

Re: [R] Types of quadrature

2008-03-13 Thread Ravi Varadhan
David, The problem is with 1 - pghyp(.). Here is a better way to compute your omega - I first compute a "complementary" pghyp, which is 1 - pghyp, and then use this to compute the numerator. The denominator is okay as it is. pghyp.c <- function(x) sapply(x, function(x){integrate(function(x)dghy

Re: [R] fast way to compare two matrices of combinations

2008-03-13 Thread Patrick Burns
One thing that will probably speed things enormously is to not grow objects (all.triplets, etc.). Instead create them to be roughly the right size and do something like double their size if they get full. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poe

[R] smoothest way to upgrade R, say from 2.6.1 to 2.6.2?

2008-03-13 Thread Galkowski, Jan
Like many software assemblies, R is updated frequently. Also, it creates its own release-numbered directory when it is installed. Packages get dumped into the subdirectory "library". I have a personal habit of storing documents related to R packages in the "doc" subdirectory. Here are my questio

Re: [R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Vincent Goulet
From the NEWS file: CHANGES IN R VERSION 2.6.0 SIGNIFICANT USER-VISIBLE CHANGES o integrate(), nlm(), nlminb(), optim(), optimize() and uniroot() now have '...' much earlier in their argument list. This reduces the chances of unintentional partial matching but means that the later arg

[R] Using loop numbers in write.csv

2008-03-13 Thread Economics Guy
This is a question I have wanted to ask for a while but hesitated because I was sut sure I would find the answer on my own, but as of yet...no dice. 1) Is there a way to use the loop number in naming things in R. Specifically I have a simulation that has two loops. I would like to be able to writ

[R] label each bar by value

2008-03-13 Thread Aimin Yan
I want to label each bar on the top of bars when using barplot. anyone know how to do this? thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide

Re: [R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Ravi Varadhan
Thank you, Vince. Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410)

Re: [R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Tony Plate
Ravi Varadhan wrote: > Hi, > > I have noticed that there is a change in the use of ellipses or . in R > versions 2.6.1 and later. In versions 2.5.1 and earlier, the . were always > at the end of the argument list, but in 2.6.1 they are placed after the main > arguments and before method control a

Re: [R] smoothest way to upgrade R, say from 2.6.1 to 2.6.2?

2008-03-13 Thread Stefan Grosse
On Thursday 13 March 2008 06:05:15 pm Galkowski, Jan wrote: GJ> (1) How do people manage an upgrade, from 2.6.1, say, to 2.6.2? 2.6.2 GJ> will create its own subdirectory, obliging a copy of library contents to GJ> the new spot. The documents are easier. You forgot to enlighten us about your sys

Re: [R] Using loop numbers in write.csv

2008-03-13 Thread Erik Iverson
See ?paste and ?assign, those will get what you want done. At least in the second case, you might consider using a list, however. You can then avoid the use of 'for' loops by using functions such as lapply. Best, Erik Iverson Economics Guy wrote: > This is a question I have wanted to ask for a

Re: [R] Using loop numbers in write.csv

2008-03-13 Thread Economics Guy
Thanks! Double thanks to Phil, I used your guide to learn LaTeX many moons ago. On Thu, Mar 13, 2008 at 1:26 PM, Greg Snow <[EMAIL PROTECTED]> wrote: > > For filenames you can do something like: > > file = paste("resultsMatrix_', i, sep='') > > For naming objects in the workspace, there is a

Re: [R] Using loop numbers in write.csv

2008-03-13 Thread Greg Snow
For filenames you can do something like: file = paste("resultsMatrix_', i, sep='') For naming objects in the workspace, there is a way, but you really don't want to do that. It is better to store them in a list, for example: resultList <- list() for( i in 1:10){ resultList[[i]] <- ma

Re: [R] label each bar by value

2008-03-13 Thread John Kane
?text tmp <- c(34,22,77) tmp.labels <- c("cat", "dog", "sheep") tmp2 <- barplot(tmp, ylim=c(0, max(tmp)+10)) text(1:3, tmp+2 , labels=tmp.labels) --- Aimin Yan <[EMAIL PROTECTED]> wrote: > I want to label each bar on the top of bars when > using barplot. > > anyone know how to do this? > > th

Re: [R] label each bar by value

2008-03-13 Thread Greg Snow
There was a discussion on this a while back, see: http://tolstoy.newcastle.edu.au/R/e2/help/07/08/22858.html There is some good discussion there on why you may not want to do this (adding the numbers at the tops of bars tends to distort the visual comparison of heights, among other things). If yo

[R] VGAM and persp function

2008-03-13 Thread Quan Li
Hi all, I loaded VGAM, which masks the persp function from graphics. How can I run the persp function after running VGAM? I tried reloading graphics but it did not work. Thank you. quan __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] [PS] Re: a more elegant way to get percentages? (now R books)

2008-03-13 Thread hadley wickham
> There has been a virtual population explosion of R books in recent years > and we all have our favorites. You may wish to pick one oriented toward > your specialty, but the absolute minimum lowest common denominator (by > which I mean that it has the ground zero essential information that al

Re: [R] cumsum list..

2008-03-13 Thread Julian Burgos
In this case you can simply do cumsum(a[x,]+a[y,]) Julian yoo wrote: > Hi all, i have the following.. > > a <- data.frame(data = seq(1,10)) > > i have indices: > x <- c(1, 5, 3, 9) > y <- c(2, 7, 4, 10) > > I want the cumsum of a[1:2], a[5:7], a[3:4]... > > is there an elegant way to

Re: [R] VGAM and persp function

2008-03-13 Thread Greg Snow
Try > graphics::persp( . . . Whin you run just persp, it runs the first copy it finds, with the graphics:: on the front in specifically runs the one from the graphics package. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (

Re: [R] smoothest way to upgrade R, say from 2.6.1 to 2.6.2?

2008-03-13 Thread Gabor Grothendieck
I think Stefan has answered this so I will just add this about batchfiles. In the batchfiles distrirbution: http://batchfiles.googlecode.com is a file Rgui.bat. If you put that anywhere in your path and make your shortcut to that instead of to R itself then it will find the most recent version

Re: [R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Prof Brian Ripley
There is an entry in the NEWS file for 2.6.0: CHANGES IN R VERSION 2.6.0 SIGNIFICANT USER-VISIBLE CHANGES o integrate(), nlm(), nlminb(), optim(), optimize() and uniroot() now have '...' much earlier in their argument list. This reduces the chances of unin

Re: [R] fast way to compare two matrices of combinations

2008-03-13 Thread Charles C. Berry
On Thu, 13 Mar 2008, Mark W Kimpel wrote: > I have a list (length 750), each element containing a vector of unique > strings (unique gene ids), with length up to ~40 (median 15). I want to > compile a matrix of all possible triplets and their frequency within > gene elements. Using combn and a lot

Re: [R] generalized linear mixed models with a beta distribution

2008-03-13 Thread Craig A Faulhaber
Thanks for the tips and clarifications. I'm a newbie and don't always have the terminology down correctly. My understanding is that one should be able to use generalized linear mixed models to model response variables that take any of the exponential family of distributions. The beta distrib

[R] Splitting a set of vectors in a list

2008-03-13 Thread John Kane
I have a set of character vectors of uneven length that I have stored in a list. I can easily enough get any column of them using lapply but what I want is to be able to create a matrix of them. Other than some kind of brute force looping approach I have drawn a blank. Would somebody please su

Re: [R] smoothest way to upgrade R, say from 2.6.1 to 2.6.2?

2008-03-13 Thread Prof Brian Ripley
If this _is_ Windows, the question is discussed in detail in the rw-FAQ. That document also discusses how to install packages into a site or personal library which can make upgrading easier. Another consideration not told to us was whether one wants to keep around a working copy of the older ver

[R] Plot contour over filled contour

2008-03-13 Thread Devred, Emmanuel
Dear R-users, I haven't found a way in the searchable archive to overplot a contour (lines) over a surface. I have a (n,m) matrix that represents sea surface temperature that I have plotted using image.plot(), filled.contour() or image(). I would like to overplot this image with some contour line

Re: [R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Ravi Varadhan
Thanks to Tony Plate, Vince Goulet, and Prof. Brian Ripley (I apologize for not posting this to R-devel). It is nice to know that there can be no unintended side-effects of this new "ellipsical convention", other than the inconvenience of having to provide complete names of arguments after the e

Re: [R] Splitting a set of vectors in a list

2008-03-13 Thread Erik Iverson
What would you want your output matrix to look like given mylist? John Kane wrote: > I have a set of character vectors of uneven length > that I have stored in a list. I can easily enough get > any column of them using lapply but what I want is to > be able to create a matrix of them. Other tha

Re: [R] Splitting a set of vectors in a list

2008-03-13 Thread John Kane
Ideally something like this: == t(cbind( c("cat" , "peach" , NA, NA), bbb <- c("dog" , "apple" ,"iron", NA), ccb <- c("rabbit" ,"orange" ,"zinc" , "silk" ))) == Thanks --- Erik Iverson <[

Re: [R] Splitting a set of vectors in a list

2008-03-13 Thread Henrique Dallazuanna
If I understand correctly, try this: as.data.frame(lapply(mylist, `[`, 1:max(unlist(lapply(mylist, length) On 13/03/2008, John Kane <[EMAIL PROTECTED]> wrote: > I have a set of character vectors of uneven length > that I have stored in a list. I can easily enough get > any column of them

Re: [R] default values

2008-03-13 Thread Dwayne Blind
Thanks a lot. You were right :-) Professor Ripley can I use your SPLUS book for R too ? 2008/3/12, Prof Brian Ripley <[EMAIL PROTECTED]>: > > On Wed, 12 Mar 2008, Dwayne Blind wrote: > > > > Dear R users, > > > > I wrote the following toy example to explain my problem : > > > > a=0 > > f=functio

Re: [R] Plot contour over filled contour

2008-03-13 Thread Dieter Menne
Devred, Emmanuel mar.dfo-mpo.gc.ca> writes: > I haven't found a way in the searchable archive to overplot a contour > (lines) over a surface. > I have a (n,m) matrix that represents sea surface temperature that I > have plotted using image.plot(), filled.contour() or image(). I would > like to o

Re: [R] lmer and correlation

2008-03-13 Thread Douglas Bates
On Thu, Mar 13, 2008 at 8:43 AM, R Help <[EMAIL PROTECTED]> wrote: > Hello list, > I've been reading through the archives and it seems as though, as > of right now, there is no way to specify the correlation structure in > lmer. I was wondering if anyone knows if this is going to be > impl

Re: [R] smoothest way to upgrade R, say from 2.6.1 to 2.6.2?

2008-03-13 Thread Galkowski, Jan
Thanks to Stefan Grosse, Gabor Grothendieck, and Professor Ripley for all this guidance. I have collected the details, concatenating them below, for future reference. Sorry if attributions got muddled. It is WinXP Pro in the primary, and there's no need to keep around older versions. But there

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread John Kane
My thanks to Henrique Dallazuanna and Phil Spector. Both solutions worked well. Phil suggested that an alterative to my function would be vect1 = sapply(mylist,'[[',1) and I see that Henrique used `[` in his solution. Can you point me to some documentation that discusses these usages. I have se

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread Henrique Dallazuanna
On 13/03/2008, John Kane <[EMAIL PROTECTED]> wrote: > My thanks to Henrique Dallazuanna and Phil Spector. > Both solutions worked well. > Phil suggested that an alterative to my function would > be > vect1 = sapply(mylist,'[[',1) > and I see that Henrique used `[` in his solution. > > Can you

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread Benilton Carvalho
or the suggestive :) ?"[" b On Mar 13, 2008, at 2:58 PM, Henrique Dallazuanna wrote: On 13/03/2008, John Kane <[EMAIL PROTECTED]> wrote: Can you point me to some documentation that discusses these usages. I have seen them before but I have never actually figured out how to use them.? See ?

Re: [R] default values

2008-03-13 Thread Prof Brian Ripley
On Thu, 13 Mar 2008, Dwayne Blind wrote: > Thanks a lot. > > You were right :-) > > Professor Ripley can I use your SPLUS book for R too ? 'Modern Applied Statistics with S' and 'S Programming' both cover S and its implementations in S-PLUS and R. However, 'Modern Applied Statistics with S-PLUS

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread John Kane
Ah ?Extract. Thanks Unless I'm missing something there is nothing in the Usage or Examples to suggest to a naive reader like me that one can use an unbalanced [ or [[, that is withoug a corresponding ] or ]]. I probably am just not understanding the details. --- Henrique Dallazuanna <[EMAIL

Re: [R] How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ?

2008-03-13 Thread John Kane
I don't think you can. What is your desired output? You can always do c(1:2, 1:10) --- Ng Stanley <[EMAIL PROTECTED]> wrote: > Hi, > > How to cbind or rbind different lengths > vectors/arrays without repeating the > elements of the shorter vectors/arrays ? > > > cbind(1:2, 1:10) > [,1]

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread Henrique Dallazuanna
A example: x <- rnorm(5) x[3] `[`(x, 3) `[[`(x, 3) x[3:4] `[`(x, 3:4) `[[`(x, 3:4) # Error On 13/03/2008, John Kane <[EMAIL PROTECTED]> wrote: > Ah ?Extract. Thanks > > Unless I'm missing something there is nothing in the > Usage or Examples to suggest to a naive reader like me > that one

Re: [R] Splitting a set of vectors in a list (Solved )

2008-03-13 Thread John Kane
Blood ell ! Thanks very much, it does help give a feel for what's happening. I'll have to do some experimenting. --- Henrique Dallazuanna <[EMAIL PROTECTED]> wrote: > A example: > > x <- rnorm(5) > > x[3] > `[`(x, 3) > `[[`(x, 3) > > x[3:4] > `[`(x, 3:4) > `[[`(x, 3:4) # Error > > > On 13/

[R] FW: Os resultados do seus comandos de email

2008-03-13 Thread lamack lamack
Dear all, what is the best way to do this? end = c(2,6,4) I neeed: expand.grid(0:end[1],0:end[2],0:end[3]) Best regards JL _ Confira vídeos com notícias do NY Times, gols direto do Lance, videocas[[elided Hotmail spam]] _

Re: [R] FW: Os resultados do seus comandos de email

2008-03-13 Thread Henrique Dallazuanna
Try: do.call(expand.grid, sapply(end, seq, from = 0)) On 13/03/2008, lamack lamack <[EMAIL PROTECTED]> wrote: > > > > Dear all, what is the best way to do this? > > end = c(2,6,4) > > I neeed: expand.grid(0:end[1],0:end[2],0:end[3]) > > Best regards > > > JL > __

Re: [R] How to manipulate data according to groups ?

2008-03-13 Thread John Kane
?aggregate tt <- matrix(c(rnorm(10), 1,1,2,2,1,3,3,3,3,2), ncol=2)) aggregate(t[,1], by=list(t[,2]), mean) should work --- Ng Stanley <[EMAIL PROTECTED]> wrote: > Hi, > > I have a two columns data, the first column are > values, and second column > are the groups. For this example, there are

[R] LIMMA: array spot summary options beyond duplicateCorrelation()

2008-03-13 Thread Quin Wills
Hello Limma users A quick question, I hope: I have dual-channel spotted expression arrays in a simple loop design (no dye swaps), viz: 1 vs reference 2 vs 1 3 vs 2 reference vs 3 There are 4 replicate spots for each probe on each array. It seems as if getting meaningful spot summary results u

[R] Warned about these "three little maids"...

2008-03-13 Thread Brian Lunergan
Greetings all: Newcomer to R as I work on learning it to transfer my college classroom stats training to something more useful and accurate then that spreadsheet from Redmond which shall remain nameless. I'm running v2.6.2 on a Win XP Home system that I keep up to date with all the called for

[R] plotting zoo object

2008-03-13 Thread stephen sefick
JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC 1968NA 10.710.09.3 7.4 8.1 9.3 9.5 8.5 10.010.013.0 196913.09.9 7.0 5.9 NA 6.5 7.3 6.6 NA NA

  1   2   >