[R] Sweave trim output

2011-02-25 Thread Dimitris Rizopoulos
Dear All, I'd like to trim the output produced in a Sweave code chunk. For instance, in fit - lm(conc ~ . - Plant, data = CO2) summary(fit) I'd like, skip the info after the coefficients' table, and possibly replace it with '...'. I've created this small function to do this, which is

Re: [R] Variable names AS variable names?

2011-02-25 Thread David Winsemius
On Feb 25, 2011, at 1:55 AM, Noah Silverman wrote: How can I dynamically use a variable as the name for another variable? I realize this sounds cryptic, so an example is best: #Start with an array of codes codes - c(a1, b24, q99) Is there some reason not to use list(a1, b24, q99)? If not

Re: [R] Creating objects (data.frames) with names stored in character vector

2011-02-25 Thread David Winsemius
On Feb 24, 2011, at 3:38 PM, Kent Alleman wrote: Hello, I'm fairly new to R. I'm a chemist, not a programmer so please bear with me. I have a large data.frame that I want to break down (subset) into smaller data.frames for analysis. I would like to give the data.frames descriptive

[R] Selecting data based on the range of dates

2011-02-25 Thread Belle
Hi: I want to give an index with all the dates between Sept. to Nov. as 1, and anything else is 0. It doesn't matter which year it is, as long as it is between Sept. to Nov, then set up to 1, otherwise is 0. My data frame looks like below: ID Date 201 1/1/05 6:07 AM 201 3/27/09

[R] Multivariate integration

2011-02-25 Thread shree sonal
Hello, I came across a package called cubature ( http://cran.r-project.org/web/packages/cubature/index.html) to perform multivariate integration. I was not able to understand few stuff: What is the need for package flags under src/Makevars? What is the purpose of fWrapper in the rcubature.c

Re: [R] Selecting data based on the range of dates

2011-02-25 Thread Belle
I think I got it, I post it here see if you have better way, please let me know. index - rep(0, length(mydata[,1])) index[as.Date(mydata3$Date) as.Date(2006-11-30 23:29:29 PM) as.Date(mydata3$Date) as.Date(2006-09-01 00:00:00 AM)] - 1 index[as.Date(mydata3$Date) as.Date(2007-11-30 23:29:29

[R] I have a Quick question about biometics

2011-02-25 Thread William Hammack
Hello, I was searching online to find more info about Biometics and I came across your information. Can you tell me, are you still involved with Biometics? If you are, how are things going for you? Please let me know. Sincerely, Will Hammack __

[R] Compatibility with R for Windows 2.12.2

2011-02-25 Thread Vedajit Boyd
Hi, Please someone let me know that the installation of both R for Windows 2.12.2 and MS office 2010 on the same system will interfere each other or not. In short, are these two tools compatible to each other? Thanks in advance. Best Regards, Vedajit [[alternative HTML version

Re: [R] Variable names AS variable names?

2011-02-25 Thread Patrick Burns
One of my hypotheses of what you want is: for(code in codes) { get(code) } The other one is: for(code in codes) { as.name(code) } On 25/02/2011 06:55, Noah Silverman wrote: How can I dynamically use a variable as the name for another variable? I realize this sounds cryptic,

Re: [R] Compatibility with R for Windows 2.12.2

2011-02-25 Thread Prof Brian Ripley
On Fri, 25 Feb 2011, Vedajit Boyd wrote: Hi, Please someone let me know that the installation of both R for Windows 2.12.2 and MS office 2010 on the same system will interfere each other or not. In short, are these two tools compatible to each other? There is nothing special about R, but you

Re: [R] GLM, how to get an R2 to explain how much of data explained by one variable

2011-02-25 Thread Clare Embling
Hi Celine, GLM outputs usually give the null deviance and residual deviance in the summary() term - so you can work out % deviance explained for a variable/model from this. Hope this helps. Best wishes, Clare Dr Clare B Embling Visiting Research Fellow Marine

Re: [R] Compatibility with R for Windows 2.12.2

2011-02-25 Thread Rob Tirrell
I can't think of a reason why they would... Rob Tirrell On Thu, Feb 24, 2011 at 23:56, Vedajit Boyd vedajit.b...@gmail.com wrote: Hi, Please someone let me know that the installation of both R for Windows 2.12.2 and MS office 2010 on the same system will interfere each other or not. In

[R] Substituting inside expression

2011-02-25 Thread zbynek.jano...@gmail.com
I am having following problem: I´m constructing model for calculation of area of triangle. I know sides a, b, and gamma angle. I wish to calculate the area using heron´s formula: S - sqrt(s*(s-a)*(s-b)*(s-c)) where s - (a+b+c)/2 and c is calculated using law of cosines: c - sqrt(a^2 + b^2

Re: [R] Selecting data based on the range of dates

2011-02-25 Thread Rob Tirrell
Try my.date - strptime(20/2/06 11:16:16.683, %d/%m/%y %H:%M:%OS) Then you can examine my.date$mon. -- Robert Tirrell | r...@stanford.edu | (607) 437-6532 Program in Biomedical Informatics | Butte Lab | Stanford University On Thu, Feb 24, 2011 at 14:12, Belle ping...@gmail.com wrote: I

[R] speed up process

2011-02-25 Thread Ivan Calandra
Dear users, I have a double for loop that does exactly what I want, but is quite slow. It is not so much with this simplified example, but IRL it is slow. Can anyone help me improve it? The data and code for foo_reg() are available at the end of the email; I preferred going directly into the

Re: [R] Substituting inside expression

2011-02-25 Thread Ivan Calandra
Hi, If I follow you correctly, you could write a function: foo - function(a,b,gamma){ c - sqrt(a^2 + b^2 -2*a*b*cos(gamma)) s - (a+b+c)/2 A - sqrt(s*(s-a)*(s-b)*(s-c)) return(A) } I hope I didn't make mistakes, but it can still help you, I guess. Ivan Le 2/25/2011 10:11,

Re: [R] speed up process

2011-02-25 Thread Nick Sabbe
Simply avoiding the for loops by using lapply (I may have missed a bracket here or there cause I did this without opening R)... Haven't checked the speed up, though. lapply(seq.yvar, function(k){ plot(mydata1[[k]]~mydata1[[ind.xvar]], type=p, xlab=names(mydata1)[ind.xvar],

Re: [R] Substituting inside expression

2011-02-25 Thread Gabor Grothendieck
On Fri, Feb 25, 2011 at 4:11 AM, zbynek.jano...@gmail.com zbynek.jano...@centrum.cz wrote: I am having following problem: I´m constructing model for calculation of area of triangle. I know sides a, b, and gamma angle. I wish to calculate the area using heron´s formula: S -

[R] scatter graph of more than one value

2011-02-25 Thread amir
Hi, I have two X1,X2 and Y1,Y2 and I want to draw them ((X1,Y1), (X2,Y2)) in a scatter graph. How can I draw both of them in a same graph with different legends? And is there any way to show different labels on each point? Regards, Amir __

[R] color code in loop for piecharts plotting

2011-02-25 Thread Lucia Rueda
Hi, I am using this loop par(mfrow=c(3,3)) annos-c(2001:2007,2009) for (i in annos) { t-subset(masia,YEAR==i) t$FAMILIA-drop.levels(t$FAMILIA) pie(table(t$FAMILIA),main=i) } To make piecharts of species composition among years (my data frame is called masia). So I get 1 piechart of the

Re: [R] scatter graph of more than one value

2011-02-25 Thread Ivan Calandra
Hi, Take a look at ?points, ?legend and ?par (specifically col and pch) HTH, Ivan Le 2/25/2011 11:58, amir a écrit : Hi, I have two X1,X2 and Y1,Y2 and I want to draw them ((X1,Y1), (X2,Y2)) in a scatter graph. How can I draw both of them in a same graph with different legends? And is there

[R] time series with NA - acf - tsdiag - Ljung-Box

2011-02-25 Thread Cecilia Reyna
Hi all, I am modelling a time series with missing data. *Q1)* However, I am not sure if I should use the next *graphics* to understand my data: *a)* ACF PACF (original series) *b)* ACF PACF (residuals) * * *Q2)* I am using *tsdiag*, so I obtain a graphic with 3 plots: stand. residuals vs time;

Re: [R] speed up process

2011-02-25 Thread Ivan Calandra
Thanks Nick for your quick answer. It does work (no missed bracket!) but unfortunately doesn't really speed up anything: with my real data, it takes 82.78 seconds with the double lapply() instead of 83.59s with the double loop (about 0.8 s). It looks like my double loop was not that bad. Does

Re: [R] speed up process

2011-02-25 Thread Jim Holtman
use Rprof to find where time is being spent. probably in 'plot' which might imply it is not the 'for' loop and therefore beyond your control. Sent from my iPad On Feb 25, 2011, at 6:19, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: Thanks Nick for your quick answer. It does work (no

Re: [R] color code in loop for piecharts plotting

2011-02-25 Thread Jim Lemon
On 02/25/2011 09:33 PM, Lucia Rueda wrote: Hi, I am using this loop par(mfrow=c(3,3)) annos-c(2001:2007,2009) for (i in annos) { t-subset(masia,YEAR==i) t$FAMILIA-drop.levels(t$FAMILIA) pie(table(t$FAMILIA),main=i) } To make piecharts of species composition among years (my data frame is

[R] lm - log(variable) - skip log(0)

2011-02-25 Thread agent dunham
I want to do a lm regression, some of the variables are going to be affected with log, I would like not no take into account the values which imply doing log(0) for just one variable I have done the following but it doesn't work: lmod1.lm -

[R] group by in data.frame

2011-02-25 Thread zem
Hi all, i have a little problem, and i think it is really simple to solve, but i dont know exactly how to. here is the challange: i have a data.frame with n colum, i have to group 2 of them and calculate the mean value of the 3. one. so far so good, that was easy - i used aggregate function to

Re: [R] select element from vector

2011-02-25 Thread zem
Hi Jessica, try this: Q[k:c(k+3)] -- View this message in context: http://r.789695.n4.nabble.com/select-element-from-vector-tp3323725p3324286.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] speed up process

2011-02-25 Thread Ivan Calandra
Dear Jim, I've tried to use Rprof() as you advised me, but I don't understand how it works. I've done this: Rprof(for (i in seq_along(seq.yvar)){ all_my_commands }) summaryRprof() But I got this error: Error in summaryRprof() : no lines found in ‘Rprof.out’ I couldn't really understand

Re: [R] lm - log(variable) - skip log(0)

2011-02-25 Thread Liaw, Andy
You need to use == instead of = for testing equality. While you're at it, you should check for positive values, not just screening out 0s. This works for me: R mydata = data.frame(x=0:10, y=runif(11)) R fm = lm(y ~ log(x), mydata, subset=x0) Andy -Original Message- From:

Re: [R] group by in data.frame

2011-02-25 Thread Ivan Calandra
Hi, I think ave() might do what you want: df - data.frame(a=rep(c(this,that),5), b1=rnorm(10), b2=rnorm(10)) ave(df[,2], df[,1], FUN=mean) For all columns, you could do that: d - lapply(df[,2:3], FUN=function(x)ave(x,df[,1],FUN=mean)) df2 - cbind(df, d) HTH, Ivan Le 2/25/2011 12:11, zem a

[R] count data

2011-02-25 Thread Sacha Viquerat
hello dear list! I wonder about the layout of my csv for my study design: i have 11 different sites. each site had been visited 9 times. on each visit, 6 distinctive water parameters had been taken ONCE on each visit (as continuous variables). on each visit, the fish abundance was counted

[R] limma function problem

2011-02-25 Thread Sukhbir Rattan
Hi, I have two data set of normalized Affymetrix CEL files, wild type vs Control type.(each set have further three replicates). wild.fish AffyBatch object size of arrays=712x712 features (10 kb) cdf=Zebrafish (15617 affyids) number of samples=3 number of genes=15617 annotation=zebrafish notes=

Re: [R] count data

2011-02-25 Thread ONKELINX, Thierry
Dear Sacha, Do you revisit the same locations per site? If so, use (1|site/location) as random effect. Otherwise use just (1|site). You might want to add a crossed random effect (1|date) if you can expect an effect of phenology. Best regards, Thierry PS R-sig-mixed-models is a better list

[R] R 2.12.2 is released

2011-02-25 Thread Peter Dalgaard
I've rolled up R-2.12.2.tar.gz a short while ago. This is an update release, which fixes a number of mostly minor issues, and one major issue in which complex arithmetic was being messed up on some compiler platform. You can get it from http://cran.r-project.org/src/base/R-2/R-2.12.2.tar.gz

[R] Visualizing Points on a Sphere

2011-02-25 Thread Lorenzo Isella
Dear All, I need to plot some points on the surface of a sphere, but I am not sure about how to proceed to achieve this in R (or if it is suitable for this at all). In any case, I am not looking for really fancy visualizations; for instance you can consider the images between formulae 5 and 6

Re: [R] speed up process

2011-02-25 Thread jim holtman
You invoke Rprof, run your code and then terminate it: Rprof() ... code you want to profile Rprof(NULL) # generate output summaryRprof() example: Rprof() for (i in 1:1e6) sin(i) + cos(i) + sqrt(i) Rprof(NULL) summaryRprof() $by.self self.time self.pct total.time total.pct sin

Re: [R] speed up process

2011-02-25 Thread Ivan Calandra
Ha... it was way too simple! I thought it would be like system.time()... my bad. Thanks for the tip! As we thought, foo_reg() takes most of the computing time, and I cannot improve that. Any ideas of how to improve the rest? Thanks again for your help Ivan Le 2/25/2011 14:29, jim holtman a

Re: [R] accuracy of measurements

2011-02-25 Thread Marc Schwartz
On Feb 24, 2011, at 4:50 PM, Denis Kazakiewicz wrote: Dear R people Could you please help with following Trying to compare accuracy of tumor size evaluation by different methods. So data looks like id true metod1 method2 ... 1 2 2 2.5 2 1.52 2 3 2 2 2

Re: [R] accuracy of measurements

2011-02-25 Thread Dennis Murphy
And in that vein, the recently released MethComp package by Bendix Carstensen may be of service. HTH, Dennis On Fri, Feb 25, 2011 at 5:39 AM, Marc Schwartz marc_schwa...@me.com wrote: On Feb 24, 2011, at 4:50 PM, Denis Kazakiewicz wrote: Dear R people Could you please help with following

Re: [R] BFGS versus L-BFGS-B

2011-02-25 Thread Ben Bolker
Brian Tsai btsai00 at gmail.com writes: Hi all, I'm trying to figure out the effective differences between BFGS and L-BFGS-B are, besides the obvious that L-BFGS-B should be using a lot less memory, and the user can provide box constraints. 1) Why would you ever want to use BFGS, if

Re: [R] Visualizing Points on a Sphere

2011-02-25 Thread Duncan Murdoch
On 25/02/2011 8:21 AM, Lorenzo Isella wrote: Dear All, I need to plot some points on the surface of a sphere, but I am not sure about how to proceed to achieve this in R (or if it is suitable for this at all). In any case, I am not looking for really fancy visualizations; for instance you can

Re: [R] Visualizing Points on a Sphere

2011-02-25 Thread Matt Shotwell
That's interesting. You might also like: http://en.wikipedia.org/wiki/Von_Mises%E2%80%93Fisher_distribution I'm not sure how to plot the wireframe sphere, but you can visualize the points by transforming to Cartesian coordinates like so: u - runif(1000,0,1) v - runif(1000,0,1) theta - 2 * pi * u

Re: [R] Interpreting the example given by Prof Frank Harrell in {Design} validate.cph

2011-02-25 Thread Frank Harrell
Here's the way I would explore this, and some of the code is made more tidy. Note that also you could vectorize your simulation. I have used set.seed multiple times to make bootstrap samples the same across runs. -Frank . . . if (data[i, 3] == 4) data[i, 5] - sample(c(0, 1), 1, prob=c(.06,

Re: [R] lm - log(variable) - skip log(0)

2011-02-25 Thread agent dunham
Apologies, I'm really new with R, Can you help me with the syntax? here is my data.frame in which I introduce independent variables: varind - data.frame(datpos$hdom2,datpos$NumPies,datpos$InHart,datpos$CV,datpos$CA,datpos$FCC) varind has dimensions(194, 6), in case that's necessary. Then I

[R] nls

2011-02-25 Thread Abeer Fadda
hi, I would like to find the x value (independent variable) for a certain dependent value using the fitted model with nls. with (predict) I can find y that corresponds to a list of x. I need the other way around. can it be done? thanks, afadda __

Re: [R] lm - log(variable) - skip log(0)

2011-02-25 Thread agent dunham
Apologies, I'm really new with R, Can you help me with the syntax? here is my data.frame in which I introduce independent variables: varind - data.frame(datpos$hdom2,datpos$NumPies,datpos$InHart,datpos$CV,datpos$CA,datpos$FCC) varind has dimensions(194, 6), in case that's necessary. Then I

Re: [R] Group rows by common ID and plot?

2011-02-25 Thread Mike Marchywka
Date: Thu, 24 Feb 2011 13:28:18 -0800 From: dannyb...@gmail.com To: r-help@r-project.org Subject: Re: [R] Group rows by common ID and plot? does this do what you want?  library(lattice)

Re: [R] group by in data.frame

2011-02-25 Thread zem
Hi Ivan, thanks for your replay! but the problem is there that the dataframe has 2 rows and ca. 2000 groups, but i dont have the column with the groupnames, because the groups are depending on 2 onother columns ... any other idea or i didnt understand waht are you posted ... :( -- View

Re: [R] Group rows by common ID and plot?

2011-02-25 Thread Scott Chamberlain
I imagine you want the ggplot2 package. something like: ggplot(dataframe, aes(x = yourxvar, y = youryvar)) + geom_point() + facet_wrap(~ ProbeSet.ID) Or facet_grid(), either of which makes a different panel for each unique level of ProbeSet.ID see gggplot help here:

Re: [R] group by in data.frame

2011-02-25 Thread zem
10x i solved it ... mein problem was that i had 2 column by them i have to group, i just pasted the values together so that at the end i have one column to group and then was easy ... here is the script that i used: http://tolstoy.newcastle.edu.au/R/help/06/07/30184.html Ivan thanks for the help

[R] Error

2011-02-25 Thread mathijsdevaan
Hi, I am running the following script for a different (much larger data frame): DF = data.frame(read.table(textConnection(A B C D E 1 1 a 1999 1 0 2 1 b 1999 0 1 3 1 c 1999 0 1 4 1 d 1999 1 0 5 2 c 2001 1 0 6 2 d 2001 0 1 7 3 a 2004 0 1 8 3 b 2004 0

[R] kohonen: Argument data should be numeric

2011-02-25 Thread Jay
Hi, I'm trying to utilize the kohonen package to build SOM's. However, trying this on my data I get the error: Argument data should be numeric when running the som(data.train, grid = somgrid(6, 6, hexagonal)) function. As you see, there is a problem with the data type of data.train which is a

Re: [R] Error

2011-02-25 Thread Mathijs de Vaan
Sorry for being unclear: the example works fine on my machine too. However, with the much larger dataset (dim(5,108)) I get the reported error. Mathijs On Fri, Feb 25, 2011 at 3:56 PM, Scott Chamberlain scttchamberla...@gmail.com wrote: Works fine on my machine: DF A BC D E 1

Re: [R] Error

2011-02-25 Thread Ivan Calandra
Hi, I don't get any error... DF - cbind(DF[,c(1:3)],ave(DF[, c(4:5)],DF$B, FUN = f)) DF A BC D E 1 1 a 1999 0 0 7 3 a 2004 1 0 2 1 b 1999 0 0 10 4 b 2001 0 1 8 3 b 2004 1 1 3 1 c 1999 0 0 5 2 c 2001 0 1 11 4 c 2001 1 1 4 1 d 1999 0 0 6 2 d 2001 1 0 12 4 d 2001 1 1 9 3 d 2004 1 2

[R] Fitting distribution in range

2011-02-25 Thread saray
Hello. I am trying to fit my data sample x with different distributions such that the integral from min(x) to max(x) of the fitted distribution will be one. Therefore I have wrote my own log-likelihood functions and then I am using mle {stats4}. So, for example: ll_gamma - function(a,b) {

Re: [R] Error

2011-02-25 Thread Scott Chamberlain
Works fine on my machine: DF A B C D E 1 1 a 1999 0 0 2 1 b 1999 0 0 3 1 c 1999 0 0 4 1 d 1999 0 0 5 2 c 2001 0 1 6 2 d 2001 1 0 7 3 a 2004 1 0 8 3 b 2004 0 1 9 3 d 2004 1 1 10 4 b 2001 0 2 11 4 c 2001 1 1 12 4 d 2001 1 2 here's my session info: sessionInfo() R version 2.12.1 (2010-12-16)

[R] linear model lme4

2011-02-25 Thread Brian Smith
Hi, I wanted to check the difference in results (using lme4) , if I treated a particular variable (beadchip) as a random effect vs if I treated it as a fixed effect. For the first case, my formula is: lmer.result - lmer(expression ~ cancerClass + (1|beadchip)) For the second case, I want

Re: [R] group by in data.frame

2011-02-25 Thread zem
Yeah, you are right i want to post an short example what i want to do .. and in the meantime i solved the problem ... but here is: i have something like this dataframe: c1-c(1,2,3,2,2,3,1,2,2,2) c2-c(5,6,7,7,5,7,5,7,6,6) c3-rnorm(10) x-cbind(c1,c2,c3) x c1 c2 c3 [1,] 1 5

Re: [R] aggregate with cumsum

2011-02-25 Thread stephenb
Bill, what will be the fastest way to output not just single lines but small data frames of about 60 rows? I prefer writing to a text file because the final output is large 47k times 60 rows and since I do not know the size of it I have to use rbind to build the object which creates the memory

[R] using scatter plot for different values

2011-02-25 Thread amir
Hi everyone, I have two different results which is determined by (x,y) x1 - c(1,5,8) y1 - c(8,9,10) x2 - c(1,7,9) y2 - c(5,7,9) Let call one=(x1,y1) and Two=(x2,y2) how can I draw them in R in a scatter plot showing (x,y) with two different legends (One, Two) Regards, Amir

[R] neural networks with RSNNS

2011-02-25 Thread Sara Szeremeta
Hello All! I am training to train a NN with function train() after splitting data with the function splitForTrainingAndTest(). The split is ok (checked it), but when I get a try on training I get this message: Error in UseMethod(train) : no applicable method for 'train' applied to an object

Re: [R] lm - log(variable) - skip log(0)

2011-02-25 Thread David Winsemius
On Feb 25, 2011, at 7:25 AM, agent dunham wrote: Apologies, I'm really new with R, Can you help me with the syntax? here is my data.frame in which I introduce independent variables: varind - data.frame(datpos$hdom2,datpos$NumPies,datpos$InHart,datpos $CV,datpos$CA,datpos$FCC) varind has

Re: [R] group by in data.frame

2011-02-25 Thread Ivan Calandra
Ok, now I think I've understood, but I'm not sure since I think that my ave() solution does work. Although, I though you have several numerical variables and 1 factor; it is the opposite but it is still possible: c3_mean - ave(x[,3], list(x[,1],x[,2]), FUN=mean) #note that values are

Re: [R] group by in data.frame

2011-02-25 Thread David Winsemius
On Feb 25, 2011, at 10:14 AM, zem wrote: Yeah, you are right i want to post an short example what i want to do .. and in the meantime i solved the problem ... but here is: i have something like this dataframe: c1-c(1,2,3,2,2,3,1,2,2,2) c2-c(5,6,7,7,5,7,5,7,6,6) c3-rnorm(10)

Re: [R] using scatter plot for different values

2011-02-25 Thread David Winsemius
On Feb 25, 2011, at 10:26 AM, amir wrote: Hi everyone, I have two different results which is determined by (x,y) x1 - c(1,5,8) y1 - c(8,9,10) x2 - c(1,7,9) y2 - c(5,7,9) Let call one=(x1,y1) and Two=(x2,y2) how can I draw them in R in a scatter plot showing (x,y) with two different

[R] BFGS versus L-BFGS-B

2011-02-25 Thread Prof. John C Nash
There are considerable differences between the algorithms. And BFGS is an unfortunate nomenclature, since there are so many variants that are VERY different. It was called variable metric in my book from which the code was derived, and that code was from Roger Fletcher's Fortran VM code based

Re: [R] linear model lme4

2011-02-25 Thread Doran, Harold
No, as the error states, you need random effects in lmer. But, you don't for lm() and that is what you're running with no random effects. However, some caution is warranted on the comparison. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]

[R] Error: address 0x6951c20, cause 'memory not mapped'

2011-02-25 Thread Jannis
Dear R list, I get a strange error in R: *** caught segfault *** address 0x6951c20, cause 'memory not mapped' Traceback: 1: .C(spline_eval, z$method, nu = as.integer(n), x = as.double(xout), y = double(n), z$n, z$x, z$y, z$b, z$c, z$d, PACKAGE = stats) 2: spline(gam.data$x[, col.data],

Re: [R] group by in data.frame

2011-02-25 Thread Dennis Murphy
Hi: Here's another way: c1-c(1,2,3,2,2,3,1,2,2,2) c2-c(5,6,7,7,5,7,5,7,6,6) c3-rnorm(10) x - data.frame(c1 = factor(c1), c2 = factor(c2), c3) x - transform(x, mean = ave(c3, c1, c2, FUN = mean)) Yet another with function ddply() in package plyr: ddply(x, .(c1, c2), transform, mean = mean(c3))

Re: [R] limma function problem

2011-02-25 Thread Martin Morgan
On 02/25/2011 04:26 AM, Sukhbir Rattan wrote: Hi, I have two data set of normalized Affymetrix CEL files, wild type vs Control type.(each set have further three replicates). wild.fish AffyBatch object size of arrays=712x712 features (10 kb) cdf=Zebrafish (15617 affyids) number of

Re: [R] nls

2011-02-25 Thread Bert Gunter
On Fri, Feb 25, 2011 at 6:09 AM, Abeer Fadda a.fa...@zmbh.uni-heidelberg.de wrote: hi, I would like to find the x value (independent variable) for a certain dependent value using the fitted model with nls. with (predict) I can find y that corresponds to a list of x. I need the other way

Re: [R] Variable names AS variable names?

2011-02-25 Thread Noah Silverman
My actual code is several things with adaptive filtering. This will require accessing data sporadically. The loop was just a quick example for the e-mail. One application is to work with online (streaming) data. If I get a new data point in for code a1, I'll need to be able to reference the

[R] Accessing sub diagonals / spdiag in R ?

2011-02-25 Thread Mingo
Hello, I'm attempting to access a specific number of sub diagonals in a MATRIX and have been accustomed to using spdiags in MATLAB or Octave. I've got a solution pieced together using for loops and it works though isn't vectorized and liable to run very slow for large matrices. As an example: A

[R] Forced inclusion of varaibles in validate command as well as step

2011-02-25 Thread Jon Kroll Bjerregaard
Hello all I am a very new R user I am used to using STATA My problem: I want to build a Cox model and validate this. I have a large number of clinical relevant factors and feel the need to reduce these. Meanwhile I have some clinical variables I deem sufficiently important to

[R] help please ..simple question regarding output the p-value inside a function and lm

2011-02-25 Thread Umesh Rosyara
Dear R community members and R experts I am stuck at a point and I tried with my colleagues and did not get it out. Sorry, I need your help. Here my data (just created to show the example): # generating a dataset just to show how my dataset look like, here I have x variables # x1

Re: [R] Error

2011-02-25 Thread mathijsdevaan
I simply don't understand why I get this error when using a larger dataset. Error in `[-.data.frame`(`*tmp*`, i, , value = integer(0)) : replacement has 0 items, need 37597770 In addition: Warning message: In max(i) : no non-missing arguments to max; returning -Inf Any ideas on what this

[R] ANOVA and Pseudoreplication in R

2011-02-25 Thread Ben Ward
Hi, As part of my dissertation, I'm going to be doing an Anova, comparing the dead zone diameters on plates of microbial growth with little paper disks loaded with antimicrobial, a clear zone appears where death occurs, the size depending on the strength and succeptibility. So it's basically 4

Re: [R] accuracy of measurements

2011-02-25 Thread Denis Kazakiewicz
Thank so much to everybody who found time to answer my question All your messages are of great help. Good luck У Пят, 25/02/2011 у 05:46 -0800, Dennis Murphy піша: And in that vein, the recently released MethComp package by Bendix Carstensen may be of service. HTH, Dennis On Fri, Feb

Re: [R] Calculate probabilty

2011-02-25 Thread rex.dwyer
Are you clear about the question you are asking? Do you want to know whether there are 6 balls or at least 6 balls? (It sounds like at least.) Do you want to know whether there are at least 6 balls in the first box, or at least 6 balls in exactly one box or at least 6 balls in at least one

[R] Missing R.h

2011-02-25 Thread Noah Silverman
Hi, I'm trying to install a module - gputools - and keep getting compile time errors about missing R.h Does anyone know where this file can be found? Thanks! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Variable names AS variable names?

2011-02-25 Thread Jonathan P Daily
To access a variable by a character string name, try for(code in codes) { dat - get(code) [stuff] } Other options include ?assign if you need to manipulate the original, or ?with to use the subject of codes as an environment. -- Jonathan P. Daily Technician -

Re: [R] Accessing sub diagonals / spdiag in R ?

2011-02-25 Thread Gabor Grothendieck
On Fri, Feb 25, 2011 at 11:26 AM, Mingo catojo...@gmail.com wrote: Hello, I'm attempting to access a specific number of sub diagonals in a MATRIX and have been accustomed to using spdiags in MATLAB or Octave. I've got a solution pieced together using for loops and it works though isn't

Re: [R] Variable names AS variable names?

2011-02-25 Thread David Winsemius
On Feb 25, 2011, at 12:33 PM, Noah Silverman wrote: My actual code is several things with adaptive filtering. This will require accessing data sporadically. The loop was just a quick example for the e-mail. One application is to work with online (streaming) data. If I get a new data

Re: [R] Interpreting the example given by Prof Frank Harrell in {Design} validate.cph

2011-02-25 Thread Frank Harrell
P.S. I used the latest version of the rms package to run this. The Design package is no longer supported. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context:

Re: [R] Variable names AS variable names?

2011-02-25 Thread David Winsemius
On Feb 25, 2011, at 1:09 PM, David Winsemius wrote: On Feb 25, 2011, at 12:33 PM, Noah Silverman wrote: My actual code is several things with adaptive filtering. This will require accessing data sporadically. The loop was just a quick example for the e-mail. One application is to work

Re: [R] BFGS versus L-BFGS-B

2011-02-25 Thread Brian Tsai
Hi John, Thanks so much for the informative reply! I'm currently trying to optimize ~10,000 parameters simultaneously - for some reason, when I compare the memory usage for L-BFGS-B and BFGS, the L-BFGS-B only uses about 1/7 of the memory, with all default input parameters, I'm a bit surprised

Re: [R] Calculate probabilty

2011-02-25 Thread Fabrice Tourre
Hi Rex, Thanks for you explain. In fact, my question is: When I observed that there are 6 or more balls in one box, what is this probability? The ball is randomly put into the boxes. I think it is: 1-pbinom(6,142,1/491) = 2.272026e-08. When the sample size is large, how should I do this? using

Re: [R] ANOVA and Pseudoreplication in R

2011-02-25 Thread Bert Gunter
I can hopefully save bandwidth here by suggesting that this belongs on the R-sig-mixed-models list. -- Bert As an aside, shouldn't you be figuring this out yourself or seeking local consulting expertise? On Fri, Feb 25, 2011 at 9:08 AM, Ben Ward benjamin.w...@bathspa.org wrote: Hi, As part of

[R] R in different OS

2011-02-25 Thread Hui Du
Hi All, I have two Rs, one has been installed in Windows system and another one has been installed under UNIX system. Is there any environmental variable or function to tell me which R I am using? The reason that I need to know it is under different system, the data path could

[R] means, SD's and tapply

2011-02-25 Thread Christopher R. Dolanc
I'm trying to use tapply to output means and SD or SE for my data but seem to be limited by how many times I can subset it. Here's a snippet of my data stems353[1:10,] Time DataSource Plot Elevation Aspect Slope Type Species SizeClass Stems 1 ModernCameron 70F221 1730

Re: [R] Group rows by common ID and plot?

2011-02-25 Thread DB1984
Thanks Mike - this doesn't quite do it, but I think that you've hit of the right method. I am just trying to use 'plot' initially - I don't care so much about the arrangement in the file. plot(df$y,group=df$f) outputs the Y column in the appropriate plot. What I would like to do is have 10 Y

[R] Help with card-sorting experiment

2011-02-25 Thread Steven Wolf
This is the first time that I've posted to this list, so if I'm doing something wrong, please let me know. Also, if there is a searchable forum where I can find help, that would be good too. I'm doing a card sorting experiment, and I'm having problems imputing my data into R for later

Re: [R] Interactive/Dynamic plots with R

2011-02-25 Thread Greg Snow
What types of interaction do you want? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Abhishek Pratap Sent:

Re: [R] Error

2011-02-25 Thread rex.dwyer
Does it work for FUN=mean? If yes, you need to print out the results of f before you return them to find the anomalous value. BTW Error is not a very good subject line. I don't see many posts from people reporting how well things are going :) -Original Message- From:

[R] lme in loop help

2011-02-25 Thread Ram H. Sharma
Dear R users I am new R user, execuse me I bother you, but I worked hard to find a solution: # data ID - c(1:100) set.seed(21) y - rnorm(100, 10,2) x1 - rnorm(100, 10,2) x2 - rnorm(100, 10,2) x3 - rnorm(100, 10,2) x4 - rnorm(100, 10,2) x5 - rnorm(100, 10,2) x6 - rnorm(100, 10,2) mydf -

Re: [R] R in different OS

2011-02-25 Thread Jorge Ivan Velez
Hi Hui, May be sessionInfo() is what you are looking for. See ?sessionInfo as well as ?version for more details. You can run the following on your R session and see what comes up: sessionInfo() sessionInfo()$R.version$platform version$platform Then, you might use ifelse() to set up the right

Re: [R] R in different OS

2011-02-25 Thread Marc Schwartz
On Feb 25, 2011, at 12:23 PM, Hui Du wrote: Hi All, I have two Rs, one has been installed in Windows system and another one has been installed under UNIX system. Is there any environmental variable or function to tell me which R I am using? The reason that I need to know

Re: [R] R in different OS

2011-02-25 Thread Ista Zahn
Hi, see ?R.version Something like if(version$os == mingw32) { path = /ABC} else { path = /DEF } might do it, but I'm not sure exactly what possible values version$os can take or what determines the value exactly. Best, Ista On Fri, Feb 25, 2011 at 1:23 PM, Hui

Re: [R] R in different OS

2011-02-25 Thread David Winsemius
On Feb 25, 2011, at 1:23 PM, Hui Du wrote: Hi All, I have two Rs, one has been installed in Windows system and another one has been installed under UNIX system. Is there any environmental variable or function to tell me which R I am using? The reason that I need to know

  1   2   >