Re: [R] How to turn a string into a variable name ?

2008-03-13 Thread Simon Blomberg
Or maybe use assign? > assign("natural_nums", 1:10) > natural_nums [1] 1 2 3 4 5 6 7 8 9 10 > Cheers, Simon. On Fri, 2008-03-14 at 14:39 +1000, [EMAIL PROTECTED] wrote: > I'm not sure why you would wish to do so, but it can be done: > > > natural_nums <- 1:10 > > even_nums <- seq(2,

Re: [R] R Finance

2008-03-13 Thread Bo Zhou
Just like David said, I doubt you can get the symbology databased for free (distribution license/fee reasons). (Or if you know any please let me know :-) I'm sure nobody would like to prepare this mapping manually. This is what I would try: 1. Get today's open or close price from Bloomberg f

Re: [R] How to turn a string into a variable name ?

2008-03-13 Thread Bill.Venables
I'm not sure why you would wish to do so, but it can be done: > natural_nums <- 1:10 > even_nums <- seq(2,10, by = 2) > types <- c("natural_nums", "even_nums") > types <- lapply(types, as.name) ## list of variable names > types [[1]] natural_nums [[2]] even_nums > eval(types[[1]]) [1] 1 2

Re: [R] How to turn a string into a variable name ?

2008-03-13 Thread Erik Iverson
You may be looking for the get function. See ?get Ng Stanley wrote: > Hi, > > For example, > > natural_nums <- 1:10 > even_nums <- seq(2,10, by = 2) > types <- c("natural_nums", "even_nums") > > What functions can be performed on types[1] to turn it into a variable name > and not a string ? >

[R] How to plot raw data and fit curve on the same figure and how to decide how good the fitting is?

2008-03-13 Thread Hung-Hsuan Chen (Sean)
Dear R users, I have two group of data (say X1 and X2) that (may) fit bivariate normal distribution. I used mvnxxx (a function in mclust library) to fit the data to a bivariate normal distribution. Now I want to plot the data (each (X1, y1) represents a point on the xy plane) and the estimated biv

[R] Distances between two datasets of x and y co-ordinates

2008-03-13 Thread adrian
Andrew McFadden <[EMAIL PROTECTED]> writes: > I am trying to determine the distances between two datasets of x and y > points. This can be done efficiently in the package 'spatstat'. library(spatstat) crossdist(x1, y1, x2, y2) where x1, y1 are vectors of coordinates for the first set

[R] How to turn a string into a variable name ?

2008-03-13 Thread Ng Stanley
Hi, For example, natural_nums <- 1:10 even_nums <- seq(2,10, by = 2) types <- c("natural_nums", "even_nums") What functions can be performed on types[1] to turn it into a variable name and not a string ? [[alternative HTML version deleted]] _

[R] the fSeries package

2008-03-13 Thread vivi-tiger
Hi. I've installed the fSeries package, trying to do Arfima fitting. Instructions in fSeries.pdf ask to use "ArfimaOxFit.ox" and " ArfimaOxPredict.ox" files, which i'm unable to find (the suggested path described in fSeries.pdf does not contains the files). Does any one can share those files wi

Re: [R] confused about CORREP cor.LRtest

2008-03-13 Thread dongxiaozhu
Hi Mark, sorry for the late response. I am now moving to my new job... When you use cor.balance() to estimate the correlation matrix, it is able to handle many variables (genes) at one time. What is returned should be a 497 by 497 correlation matrix. But when you use cor.LRtest() to calculate P-va

Re: [R] strange results from binomial lmer?

2008-03-13 Thread Henric Nilsson (Public)
[EMAIL PROTECTED] wrote: > I'm running lmer repeatedly on artificial data with two fixed factors (called > 'gender' and 'stress') and one random factor ('speaker'). Gender is a > between-speaker variable, stress is a within-speaker variable, if that > matters. > Each dataset has 100 rows from eac

[R] Equation for the standard error of a predicted score for a cross-classified model

2008-03-13 Thread Jonathan Weeks
All, I have several years of longitudinal test scores for students (many who switch schools at various points in time). I am using a mixed-effects model with crossed random effects to model student trajectories. The model includes time at level 1 and students crossed with schools at level 2. When

Re: [R] zoo object: replace NAs from another zoo object

2008-03-13 Thread Gabor Grothendieck
An example that included input and output would help. I'll take a guess but if that's not it please clarify and provide that. Also its helpful if you can provide the data in easily copied form using dput(z). I will assume that time(New) is a superset of time(Old) and "put them in" means replace

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

2008-03-13 Thread Mark W Kimpel
Thanks to all for their suggestions. I apologize for not supplying a self-contained example, I should not post questions when I'm on the way out the door. Martin's suggestion should work, but I need to put in on our high-performance system next week. On my local 64-bit Linux box with 4GB of RA

[R] fisher scoring method in R

2008-03-13 Thread Kathy Maher
hi I am having trouble figure out how to do the fisher scoring method in R using "rgeom". can anyone help? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Fit a logit curve to the data

2008-03-13 Thread Ted Harding
On 13-Mar-08 22:56:16, Alfonso Pérez wrote: > Hello, my name is Alfonso. My data are 0 and 1 values in > the y axis and fish length in the x axis. I'm trying to get > a graph where it could be fitted a logit curve to my data, > how could I get it? Have a look at ?glm In particular (just go

Re: [R] (no subject)

2008-03-13 Thread Bill.Venables
Marina, The way I would go about it would be to clarify, in order, the following issues: * What questions do I want to ask about the tree diameter incremental process? * What data do I have, or should I get, to address those questions? * What analyses or models should I use to link the data to

[R] strange results from binomial lmer?

2008-03-13 Thread johnson4
I'm running lmer repeatedly on artificial data with two fixed factors (called 'gender' and 'stress') and one random factor ('speaker'). Gender is a between-speaker variable, stress is a within-speaker variable, if that matters. Each dataset has 100 rows from each of 20 speakers, 2000 rows in all.

[R] (no subject)

2008-03-13 Thread Maina . Kariuki
Hi there, Am try to find tree diameter increment in a hierarchical data with tree diameter measurements, date of measurements, in plots that are located in different region. How do I do it? am very new to R. Thanks for you help. Maina Kariuki Level 3, 8 Nicholson Street East Melbourne VIC 3

[R] Fit a logit curve to the data

2008-03-13 Thread Alfonso Pérez
Hello, my name is Alfonso. My data are 0 and 1 values in the y axis and fish length in the x axis. I'm trying to get a graph where it could be fitted a logit curve to my data, how could I get it? Thank you in advance. _

Re: [R] Sealed for setGeneric

2008-03-13 Thread Christophe Genolini
> an unusual strategy would be to use lockBinding to make the symbol > associated with the generic unchangeable. > This sounds nice, thanks. Why is it unusual ? Any side effect or just the practice? __ R-help@r-project.org mailing list https://stat.

[R] help with summary(polr_model)

2008-03-13 Thread Luca Braglia
hello everybody I'm a newbie with ordered probit and with polr too. The problem is that I have a dependent variable I need to explain with an ordered probit that is > head(dfscale$sod.sit.ec.fam,100) > [1] 5 7 5 6 5 5 6 8 6 8 8 8 6 6 6 5 0 5 NA 6 > [21] 7 NA NA 0 0 2 5

[R] Need help with plm, cannot load pdata.frame

2008-03-13 Thread Edward Huang
Hi all, I installed all required packages for plm, but pdata.frame is not a recognized function on R to start with. I followed the first page of "introduction to plm" by Croissant&Millo, Here are the messages: * > library(plm) Loading required package: kinship Loading required package: survival L

[R] zoo object: replace NAs from another zoo object

2008-03-13 Thread Timothy W. Hilton
Hello, I have two zoo objects, new and old, indexed by chron objects. Their structure is like this: (05/25/06 00:00:00) NA NA NA (05/25/06 00:02:00) 948.20 24.198 0 (05/25/06 00:04:00) 948.26 20.640 0 (05/25/06 00:06:00) 948.37 19.653 0 (05/25/06 00:08:00) 948.48 19.135 0 (05/2

[R] manova with non-normal error distribution

2008-03-13 Thread Jarrett Byrnes
This may be a silly question to ask, but, is it possible do do a MANOVA-style analysis with a generalized linear model? I have a data set that I'm working with that, for each variable (time in this case, as it's a repeated measures MANOVA) is fit much better using glm rather than a traditi

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

2008-03-13 Thread Prof Brian Ripley
You should consult the summary http://cran.r-project.org/bin/windows/contrib/checkSummaryWin.html to answer such questions. These are not part of the install of R -- you must have chosen to install some packages which depend on them. As to whether you need them -- that depends if you need the

[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

[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] 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

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

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 > __

[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] 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/

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] 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 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] 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 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] 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 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] 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] 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] 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] 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] 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] 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 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] 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

[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] 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] 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] 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

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] 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] 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] 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] [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

[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] 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

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] 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] 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 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] 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] 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] 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)

[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

[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

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] 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] 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

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 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

[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

[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] 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] 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

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] 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

[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

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

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] 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 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] [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

[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

[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 ?

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] 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 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] 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

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

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] 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 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)

[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] 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] 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

  1   2   >