Re: [R] General help - online statistics courses?

2011-10-10 Thread kanishkporwal
You should try http://math.tutorvista.com/statistics.html Tutorvista.com the site offers http://math.tutorvista.com/statistics.html online statistics help to anyone that is in need. The site is very interactive and helps you get the ace in your desired subject. -- View this message in

Re: [R] ANOVA from imported data has only 1 degree of freedom

2011-10-10 Thread shardman
Hi David, Apologies again and thankyou for your help, I've edited my original post to clarify what I was asking. What I meant was that the factor had only 1 degrees of freedom when it should have had 2 (14 in total), so you're right there were 14 but not in the right place. In SPSS you select

[R] HOW TO PASS MY JAVA ARGUMENT INTO RSCRIPT FILE

2011-10-10 Thread janarthanan murugesan
Hi , I am working in Eclipse IDE , I want to use rscript to produce statistical analysis , I tested a sample rcode in the script its working fine in my Eclipse IDE , but I don't know how to pass my java values into rscript . I need some guidance ,Please help me . Thanks , Janarthanan .M

Re: [R] convert apply to lappy

2011-10-10 Thread Alaios
Thanks alot for the tip. Worked :) From: Joshua Wiley jwiley.ps...@gmail.com Cc: R-help@r-project.org R-help@r-project.org Sent: Sunday, October 9, 2011 6:32 PM Subject: Re: [R] convert apply to lappy Hi Alex, If data is a matrix, probably the easiest option

Re: [R] Vector-subsetting with ZERO - Is behavior changeable?

2011-10-10 Thread Johannes Graumann
Thank you very much. Learned something again! Joh William Dunlap wrote: You can use [1] on the output of FUN to ensure that exactly one value (perhaps NA from numeric(0)[1]) is returned. E.g. index - 1 sapply(list(c(1,2,3),c(1,2),c(1)),function(x){x[max(length(x)- index,0)][1]})

Re: [R] Handling Time in R

2011-10-10 Thread Alaios
Thanks a lot. That helped. One thing now is to have the difftime(y,x) to always report seconds. There are times that there is a change in the day and thus the diff will report few days difference. How can it always report only seconds? I would like to thank you in advance for your help B.R

Re: [R] Handling Time in R

2011-10-10 Thread Jim Holtman
check the help page; there is a parameter ('units' I thnk) that will let you specify that. Sent from my iPad On Oct 10, 2011, at 2:57, Alaios ala...@yahoo.com wrote: Thanks a lot. That helped. One thing now is to have the difftime(y,x) to always report seconds. There are times that there

Re: [R] HOW TO PASS MY JAVA ARGUMENT INTO RSCRIPT FILE

2011-10-10 Thread Marcel.
Hello, use the rJava library to execute R code from Java or transfer values from Java to R: http://www.rforge.net/rJava/ http://www.rforge.net/rJava/ -- View this message in context: http://r.789695.n4.nabble.com/HOW-TO-PASS-MY-JAVA-ARGUMENT-INTO-RSCRIPT-FILE-tp3889327p3889457.html Sent

Re: [R] cspade error

2011-10-10 Thread lenp
That's a very late answer, but I just ran into the same problem and thought maybe someone else (someone browsing the archives, for instance) would appreciate a tip. There are maybe empty lines in your data file file_name.txt. If you remove them, or remove the corresponding transactions in data_ex,

Re: [R] Handling Time in R

2011-10-10 Thread Alaios
This did the trick as.numeric(diff(c(ISOdatetime(2011,6,1,11,59,1.09),ISOdatetime(2011,6,5,11,59,1.09 [1] 345600 From: Jim Holtman jholt...@gmail.com Cc: R-help@r-project.org R-help@r-project.org Sent: Monday, October 10, 2011 9:26 AM Subject: Re: [R]

[R] MGARCH BEKK estimation

2011-10-10 Thread upananda pani
Dear All, I want to estimate Bivariate Garch Model using MGARCHBEKK package. I am not able to understand some part of the command this function. mvBEKK.est(eps=lrdata, order = c(1,1), params = NULL, fixed = NULL, method = BFGS, verbose = F) Here what exactly the eps refers to ? It would be

[R] Odp: help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread Petr PIKAL
Hi I do not understand much about your equations. I think you shall look to Practical Regression and Anova Using R from J.Faraway. Having data frame DF with columns - users, groups, results you could do fit - lm(results~groups, data = DF) Regards Petr Hi, I'm a newbie to R. My

Re: [R] Handling Time in R

2011-10-10 Thread Jeff Newmiller
Difftime doesn't report things. When you print it, it automatically selects an appropriate human-readable unit to display in, but that does not change its internal representation. If you must convert to seconds, you can do so using the as.double generic (as.double.difftime) with a units

Re: [R] Handling Time in R

2011-10-10 Thread Alaios
Do you mean something like that? as.double(diff(c(ISOdatetime(2011,6,1,11,59,1.09),ISOdatetime(2011,6,5,11,59,1.09))),length=20) [1] 345600 From: Jeff Newmiller jdnew...@dcn.davis.ca.us Cc: R-help@r-project.org R-help@r-project.org Sent: Monday, October 10,

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread gj
Hi Petr, It's not an equation. It's my mistake; the * are meant to be field separators for the example data. I should have just use blank spaces as follows: users Group1 Group2 Group3 u110 5N/A u2 6 N/A 4 u3 5 2

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread Petr PIKAL
Hi Petr, It's not an equation. It's my mistake; the * are meant to be field separators for the example data. I should have just use blank spaces as follows: users Group1 Group2 Group3 u110 5N/A u2 6 N/A 4 u3 5

[R] Converting factor into date

2011-10-10 Thread Vikram Bahure
Dear R users, I have an elementary query. I have a dataset which is taken from text file with the help of read.csv command but when I generate the data in R file it converts the Dates into factor.So for the above problem, I use as.Date to convert the Dates from factor form to date format using

Re: [R] Handling Time in R

2011-10-10 Thread Jeff Newmiller
No, read ?difftime and look at as.double. There is a units parameter that you must set if you want predictable results. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go...

Re: [R] Converting factor into date

2011-10-10 Thread Jeff Newmiller
Convert to character first or use the as.is option to read.csv. The default is to try to convert the underlying integer form of factors to date, which is not what you intend. --- Jeff Newmiller The . . Go Live...

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread gj
Thanks Petr. I will try it on the real data. But that will only show that the groups are different or not. Is there any way I can test if the users are different when they are in different groups? Regards Gawesh On Mon, Oct 10, 2011 at 11:17 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi

[R] Type of Graph to use

2011-10-10 Thread Jurgens de Bruin
Hi, Please advice on what type of graph can be used to display the following data set. I have the following: NameClass a Class 1 a Class4 b Class2 b Class1 d Class3 d Class5 e Class4 e Class2 So

[R] pos in panel.text

2011-10-10 Thread Allan Sikk
Hi, I need to vary the placements of data labels but I cannot assign a vector to pos option. Any vectors work fine with cex, for example. What could be the problem here? xyplot(Npop~Narea, data=size, scales=list(x=list(log=TRUE), y=list(log=TRUE), xlab=expression(N[A]),

Re: [R] Converting factor into date

2011-10-10 Thread Vikram Bahure
Hi, I am getting my results from the following: *z$Date-as.Date(as.character(z$Date),format=%d/%m/%y)* instead of: z$Date-as.Date(as.character(z$Date,format=%d/%m/%y)) Thanks again. Regards Vikram On Mon, Oct 10, 2011 at 4:08 PM, Jeff Newmiller jdnew...@dcn.davis.ca.uswrote: Convert to

Re: [R] Type of Graph to use

2011-10-10 Thread jim holtman
See if this gives you the presentation you want: x - read.table(textConnection(NameClass a Class1 a Class4 b Class2 b Class1 d Class3 d Class5 e Class4 e Class2), header = TRUE)

Re: [R] Type of Graph to use

2011-10-10 Thread Jurgens de Bruin
Jim, This should work, would it be possible to plot * and not larg rec. On 10 October 2011 14:12, jim holtman jholt...@gmail.com wrote: See if this gives you the presentation you want: x - read.table(textConnection(NameClass a Class1 a Class4 b

Re: [R] pos in panel.text

2011-10-10 Thread Allan Sikk
Thanks, Carlos, Tried that, but no success, still getting this error message: Warning messages: 1: In if (pos == 1) { : the condition has length 1 and only the first element will be used 2: In if (pos == 2) { : the condition has length 1 and only the first element will be used Thanks,

Re: [R] Type of Graph to use

2011-10-10 Thread jim holtman
try this version: x - read.table(textConnection(NameClass a Class1 a Class4 b Class2 b Class1 d Class3 d Class5 e Class4 e Class2), header = TRUE) closeAllConnections() # add columns of numeric

Re: [R] Type of Graph to use

2011-10-10 Thread Gabor Grothendieck
On Mon, Oct 10, 2011 at 6:49 AM, Jurgens de Bruin debrui...@gmail.com wrote: Hi, Please advice on what type of graph can be used to display the following data set. I have the following: Name    Class a             Class 1 a             Class4 b             Class2 b             Class1

Re: [R] pos in panel.text

2011-10-10 Thread Allan Sikk
Here's the code. The problem seems to be specific for lattice as I can easily use a vector with pos in plot. trellis.device(,width=600, height = 400) xyplot(Npop~Narea, scales=list(x=list(log=TRUE, at=my.at,labels = formatC(my.at, big.mark = ,, format=d)), y=list(log=TRUE,

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread Carlos Ortega
Hello, In package qualityTools you can find one way to perform this analysis through the gageRR() function. The effect of an operator on the mesasurement system (Reproductibility) is to me equivalent to the effect you try to study of your users when they are in different groups. Regards, Carlos

Re: [R] Type of Graph to use

2011-10-10 Thread Jurgens de Bruin
Thanks for all the help, Their would it be possible to use a Venn Diagram for this application? On 10 October 2011 14:49, Gabor Grothendieck ggrothendi...@gmail.comwrote: On Mon, Oct 10, 2011 at 6:49 AM, Jurgens de Bruin debrui...@gmail.com wrote: Hi, Please advice on what type of graph

Re: [R] Type of Graph to use

2011-10-10 Thread Jurgens de Bruin
Please ignore the venn digram as this will be to complex to read when more than 3 categories are present On 10 October 2011 15:36, Jurgens de Bruin debrui...@gmail.com wrote: Thanks for all the help, Their would it be possible to use a Venn Diagram for this application? On 10 October 2011

Re: [R] Type of Graph to use

2011-10-10 Thread Gabor Grothendieck
On Mon, Oct 10, 2011 at 8:49 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Mon, Oct 10, 2011 at 6:49 AM, Jurgens de Bruin debrui...@gmail.com wrote: Hi, Please advice on what type of graph can be used to display the following data set. I have the following: Name    Class a    

[R] Request for moderated posting

2011-10-10 Thread squid-dev-help
This message has been passed onto the list moderators for approval. This is because you are not a subscriber to this list or the related squid-users list. If the message is relevant to the squid-dev mailinglist one of the moderators will accept the message and it gets automatically forwarded to

[R] Multiple imputation on subgroups

2011-10-10 Thread Sarah
Dear R-users, I want to multiple impute missing scores, but only for a few subgroups in my data (variable 'subgroups': only impute for subgroups 2 and 3). Does anyone knows how to do this in MICE? This is my script for the multiple imputation: imp - mice(data, m=20, predictorMatrix=pred,

Re: [R] pos in panel.text

2011-10-10 Thread Carlos Ortega
Hello, To check the possible values of pos parameter you need to review text() as it is indicated in the lattice help of panel.text(). In text() it says: pos a position specifier for the text. If specified this overrides any adj value given. Values of 1, 2, 3 and 4, respectively indicate

[R] variable scope for deltavar function from emdbook

2011-10-10 Thread adad
Dear all, I want to use the deltavar() function from emdbook. I can use it directly from the command terminal but within a function it behaves weird. Working example: -- library(emdbook) fn - function() { browser() y - 2 print(deltavar(y*b2, meanval=c(b2=3), Sigma=1) ) }

Re: [R] pos in panel.text

2011-10-10 Thread Carlos Ortega
Hi, OK. Have you tried to run your code without the pos parameter? Based on the help, pos should be just *one* parameter. pos offers a finer adjustment of the text. But in your case, the first thing to get is that the text label is represented at the specified coordinates. Besides pos you can

[R] Importing from Fortan

2011-10-10 Thread Spartina
Hello all, how do I import a Fortran file (f3.1) into one column in R? I've tried this (I'm a total beginner as you can see): FortranData-read.fwf(C:\\Users\\format3_1.txt,rep(3,20)) Warning message: In readLines(file, n = thisblock) : incomplete final line found on 'C:\Users\format3_1.txt'

Re: [R] Linear programming problem, RGPLK - no feasible solution.

2011-10-10 Thread Liu Evans, Gareth
In my post at https://stat.ethz.ch/pipermail/r-help/2011-October/292019.html I included an undefined term ej. The problem code should be as follows. It seems like a simple linear programming problem, but for some reason my code is not finding the solution. obj - c(rep(0,3),1) col1

Re: [R] pos in panel.text

2011-10-10 Thread Carlos Ortega
Hi Allan, Please could you send the modified code where now it should appear x and y coordinates?. I do not fully understand the error message you get. Regards, Carlos Ortega www.qualityexcellence.es 2011/10/10 Allan Sikk a.s...@ucl.ac.uk Thanks, Carlos, Tried that, but no success, still

Re: [R] Handling Time in R

2011-10-10 Thread Alaios
Thanks a lot for your answer. It is something that I do not understand with R how the wrapper functions work really. As an example, check the code below   TimeDiffInSeconds-diff((ISOdate(timeMatrix[,1],timeMatrix[,2],timeMatrix[,3],timeMatrix[,4],timeMatrix[,5],timeMatrix[,6])),units=secs);  

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread Bert Gunter
Assuming your data are in a data frame, yourdat, as: User Group Value u1 1 !0 u2 2 5 u3 3 NA ...(etc) where Group is **explicitly coerced to be a factor,** then you want the User x Group interaction, obtained from lm( Value ~ Group*User,data = yourdat)

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread Bert Gunter
I should have added... If your design is not nearly balanced, main effects and interactions will not have any natural interpretation because they will be (partially) confounded. (I realize nearly is not a very useful characterization, but I do not know a better one, as it probably depends on the

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread Anupam
Groups are different treatments given to Users for your Outcome (measurement) of interest. Take this idea forward and you will have an answer. Anupam. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter Sent: Monday,

Re: [R] Importing from Fortan

2011-10-10 Thread David Winsemius
On Oct 10, 2011, at 7:45 AM, Spartina wrote: Hello all, how do I import a Fortran file (f3.1) into one column in R? I've tried this (I'm a total beginner as you can see): FortranData-read.fwf(C:\\Users\\format3_1.txt,rep(3,20)) Warning message: In readLines(file, n = thisblock) :

Re: [R] Multiple imputation on subgroups

2011-10-10 Thread Weidong Gu
An ad-hoc method is to impute missing scores of the whole data set including subgroup1, then change imputed scores in subgroup1 into NA. Weidong Gu On Mon, Oct 10, 2011 at 5:35 AM, Sarah s1327...@student.rug.nl wrote: Dear R-users, I want to multiple impute missing scores, but only for a few

[R] calculate multiple means of one vector

2011-10-10 Thread Martin Batholdy
Dear R-Users, I have the following two vectors: data - rnorm(40, 0, 2) positions - c(3, 4, 5, 8, 9, 10, 20, 21, 22, 30, 31, 32) now I would like to calculate the mean of every chunk of data-points (of the data-vector) as defined by the positions-vector. So I would

Re: [R] fast or space-efficient lookup?

2011-10-10 Thread Steve Lianoglou
Hi Ivo, On Mon, Oct 10, 2011 at 10:58 AM, ivo welch ivo.we...@gmail.com wrote: hi steve---agreed...but is there any other computer language in which an expression in a [ . ] is anything except a tensor index selector? Sure, it's a type specifier in scala generics:

[R] how to extent the improveProb for survival data

2011-10-10 Thread zhu yao
Dear R users Function improveProb in the rms library calculate NRI and IDI for predictions of binary outcome. Do anyone extent its use in survival data? Many thanks. *Yao Zhu* *Department of Urology Fudan University Shanghai Cancer Center Shanghai, China* [[alternative HTML version

[R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread Alexander Engelhardt
Hey list, This might be a more general question and not that R-specific. Sorry for that. I'm trying to draw a random vector of 4 numbers that sum up to 1. My first approach was something like a - runif(1) b - runif(1, max=1-a) c - runif(1, max=1-a-b) d - 1-a-b-c but this kind of

[R] Superposing mean line to xyplot

2011-10-10 Thread Niccolò Bassani
Dear R-users, I'm using lattice package and function xyplot for the first time so you will excuse me for my inexperience. I'm facing quite a simple problem but I'm having troubles on how to solve it, I've read tons of old mails in the archives and looked at some slides from Deepayan Sarkar but

Re: [R] fast or space-efficient lookup?

2011-10-10 Thread Matthew Dowle
Ivo, Also, perhaps FAQ 2.14 helps : Can you explain further why data.table is inspired by A[B] syntax in base? http://datatable.r-forge.r-project.org/datatable-faq.pdf And, 2.15 and 2.16. Matthew Steve Lianoglou mailinglist.honey...@gmail.com wrote in message

[R] Superposing mean line to xyplot

2011-10-10 Thread Niccolò Bassani
Dear R-users, I'm using lattice package and function xyplot for the first time so you will excuse me for my inexperience. I'm facing quite a simple problem but I'm having troubles on how to solve it, I've read tons of old mails in the archives and looked at some slides from Deepayan Sarkar but

Re: [R] calculate multiple means of one vector

2011-10-10 Thread Dennis Murphy
Hi: Here's one approach: dat - rnorm(40, 0, 2) positions - matrix(c(3, 4, 5, 8, 9, 10, 20, 21, 22, 30, 31, 32), ncol = 3, byrow = TRUE) # Subdata t(apply(positions, 1, function(x) dat[x])) [,1] [,2] [,3] [1,] 0.5679765 1.429396 2.9050931

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread gj
Hi Bert, The real situation is like what you suggested, user x group interactions. The users can be in more than one group. In fact, the data that I am trying to analyse constitute of users, online forums as groups and the attribute under measure is the number of posts made by each user in a

Re: [R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread Greg Snow
You probably want to generate data from a Dirichlet distribution. There are some functions in packages that will do this and give you more background, or you can just generate 4 numbers from an exponential (or gamma) distribution and divide them by their sum. -- Gregory (Greg) L. Snow Ph.D.

Re: [R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread Uwe Ligges
On 10.10.2011 18:10, Alexander Engelhardt wrote: Hey list, This might be a more general question and not that R-specific. Sorry for that. I'm trying to draw a random vector of 4 numbers that sum up to 1. My first approach was something like a - runif(1) b - runif(1, max=1-a) c - runif(1,

Re: [R] help with statistics in R - how to measure the effect of users in groups

2011-10-10 Thread Bert Gunter
OK. So my original advice and warnings are correct. However, now there is an additional wrinkle because your response is a count, which is not a continuous measurement. For this, you'll need glm(..., family = poisson) instead of lm(...), where the ... is the stuff I gave you before. A backup

Re: [R] Superposing mean line to xyplot

2011-10-10 Thread Dennis Murphy
Hi: Here's one way to do it, adding the latticeExtra package: array = rep(c(A,B,C),each = 36) # array replicate spot = rep(1:4,27) # miRNA replicate on each array miRNA = rep(rep(paste(miRNA,1:9,sep=.),each=4),3) # miRNA label exprs = rnorm(mean=2.8,n = 108) # intensity dat =

[R] Merge Data by time stamps

2011-10-10 Thread Alaios
Dear all, I have some device measurements and the time stamps I get from it have the below format: MyStruct$TimeStamps[1,] [1] 2011.000   10.000    6.000   16.000   23.000   30.539 I can convert them easily with ISOdate() to a number and do the calculations I need. One of my problems is that

[R] multicore by(), like mclapply?

2011-10-10 Thread ivo welch
dear r experts---Is there a multicore equivalent of by(), just like mclapply() is the multicore equivalent of lapply()? if not, is there a fast way to convert a data.table into a list based on a column that lapply and mclapply can consume? advice appreciated...as always. regards, /iaw Ivo

Re: [R] package dlm: dlmForecast()

2011-10-10 Thread Giovanni Petris
I haven't tried this, but I am pretty confident that using dlmFilter() with fictitious future values of the observations set to NA should do the job. Hope this helps, Giovanni Petris On Sat, 2011-10-08 at 13:21 +, YuHong wrote: May I have a question about dlmForecast() function in the

Re: [R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread David Winsemius
On Oct 10, 2011, at 12:44 PM, Uwe Ligges wrote: On 10.10.2011 18:10, Alexander Engelhardt wrote: Hey list, This might be a more general question and not that R-specific. Sorry for that. I'm trying to draw a random vector of 4 numbers that sum up to 1. My first approach was something

Re: [R] multicore by(), like mclapply?

2011-10-10 Thread Joshua Wiley
Hi Ivo, My suggestion would be to only pass lapply (or mclapply) the indices. That should be fast, subsetting with data table should also be fast, and then you do whatever computations you will. For example: require(data.table) DT - data.table(x=rep(c(a,b,c),each=3), y=c(1,3,6), v=1:9)

Re: [R] multicore by(), like mclapply?

2011-10-10 Thread Matthew Dowle
Package plyr has .parallel. Searching datatable-help for multicore, say on Nabble here, http://r.789695.n4.nabble.com/datatable-help-f2315188.html yields three relevant posts and examples. Please check wiki do's and don'ts to make sure you didn't fall into one of those traps, though (we don't

Re: [R] Merge Data by time stamps

2011-10-10 Thread David Winsemius
On Oct 10, 2011, at 1:28 PM, Alaios wrote: Dear all, I have some device measurements and the time stamps I get from it have the below format: MyStruct$TimeStamps[1,] [1] 2011.000 10.0006.000 16.000 23.000 30.539 I can convert them easily with ISOdate() to a number and do the

Re: [R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread Greg Snow
As an interesting extension to David's post, try: M4.e - matrix(rexp(4,1), ncol=4) Instead of the uniform and rerun the rest of the code (note the limits on the x-axis). With 3 dimensions and the restriction we can plot in 2 dimensions to compare: library(TeachingDemos) m3.unif -

Re: [R] multicore by(), like mclapply?

2011-10-10 Thread ivo welch
hi josh---thx. I had a different version of this, and discarded it because I think it was very slow. the reason is that on each application, your version has to scan my (very long) data vector. (I have many thousand different cases, too.) I presume that by() has one scan through the vector

[R] pmml for random forest rules

2011-10-10 Thread Patrick McCann
Hi, I am having some trouble using R 2.13.1 for generating a pmml object of of class c('randomForest.formula', 'randomForest') I see that these methods are available: methods(pmml) [1] pmml.coxph*pmml.hclust* pmml.itemsets* pmml.kmeans* pmml.ksvm* pmml.lm* pmml.multinom*

Re: [R] ANOVA from imported data has only 1 degree of freedom

2011-10-10 Thread shardman
Thanks bbolker, that's really helpful. I'll look out for the book too, it could be helpful! Yours, Sam -- View this message in context: http://r.789695.n4.nabble.com/ANOVA-from-imported-data-has-only-1-degree-of-freedom-tp3887528p3891246.html Sent from the R help mailing list archive at

Re: [R] Question about ggplot2 and stat_smooth

2011-10-10 Thread Dylan Beaudette
Hi Tom, Just wanted to chime-in and let you know that the linked figures are really cool! Keep up the good work. On an un-related note, any talk of future GRASS training sessions? Cheers, Dylan On Tuesday, October 04, 2011, thomas.ad...@noaa.gov wrote: Hadley, Thanks for responding. No,

[R] question about string to boor?

2011-10-10 Thread song_gpqg
Hello! So I am handling this problem with some arrays grp1-grp7, I want to write a loop to avoid tedious work, but I don't know how to transform string to boor? For example I used i=1 paste(grp,i, sep=) I only got grp1 instead of grp1, which can't be manipulate using mean() or other function.

[R] Dealing with missing data in ave() functions

2011-10-10 Thread evelin.comper
Dear all, I would be grateful if you could help me in some way! Well, I have one dataset already uploaded into R with some missing data. My dataset is made of 19 columns, one of these is the sector (naf code). There are many rows relating to the single enterprises. What I want to do is the mean

[R] correlation matrix

2011-10-10 Thread 1Rnwb
Hello Gurus I have two correlation matrices 'xa' and 'xb' set.seed(100) d=cbind(x=rnorm(20)+1, x1=rnorm(20)+1, x2=rnorm(20)+1) d1=cbind(x=rnorm(20)+2, x1=rnorm(20)+2, x2=rnorm(20)+2) xa=cor(d,use='complete') xb=cor(d1,use='complete') I want to combine these two to get a third

[R] how to calculate the statistics of a yearly window with a rolling step as 1 day?

2011-10-10 Thread ecoc
Hope someone can help me here. I have a daily time series, say 2003-02-01 2003-02-03 2003-02-07 2003-02-09 2003-02-14 .. 2004-02-01 2004-02-04 0.4914798 -1.1857653 -1.6982844 -0.3559572 -0.2333087 ... 0.44553-0.45222 I need to calculate the statistics for the

Re: [R] question about string to boor?

2011-10-10 Thread David Winsemius
On Oct 10, 2011, at 12:52 PM, song_gpqg wrote: Hello! So I am handling this problem with some arrays grp1-grp7, I want to write a loop to avoid tedious work, but I don't know how to transform string to boor? For example I used i=1 paste(grp,i, sep=) ?get e.g. get( paste(grp,i, sep=) )

Re: [R] round() and negative digits

2011-10-10 Thread Michael Friendly
On 10/9/2011 6:18 AM, Prof Brian Ripley wrote: Sometimes it is better not to document things than try to give precise details which may get changed *and* there will be useRs who misread (and maybe even file bug reports on their misreadings). The source is the ultimate documentation. I can't

Re: [R] multicore by(), like mclapply?

2011-10-10 Thread Thomas Lumley
On Tue, Oct 11, 2011 at 7:54 AM, ivo welch ivo.we...@gmail.com wrote: hi josh---thx.  I had a different version of this, and discarded it because I think it was very slow.  the reason is that on each application, your version has to scan my (very long) data vector.  (I have many thousand

Re: [R] how to calculate the statistics of a yearly window with a rolling step as 1 day?

2011-10-10 Thread Gabor Grothendieck
On Mon, Oct 10, 2011 at 2:55 PM, ecoc liting...@gmail.com wrote: Hope someone can help me here. I have a daily time series, say 2003-02-01 2003-02-03 2003-02-07 2003-02-09 2003-02-14 .. 2004-02-01 2004-02-04  0.4914798 -1.1857653 -1.6982844 -0.3559572 -0.2333087  ...

Re: [R] multicore by(), like mclapply?

2011-10-10 Thread Joshua Wiley
I could be waay off base here, but my concern about presplitting the data is that you will have your data, and a second copy of our data that is something like a list where each element contains the portion of the data for that split. Good speed wise, bad memory wise. My hope with the

Re: [R] correlation matrix

2011-10-10 Thread Daniel Malter
What a pleasant post to respond to - with self-contained code. :) heat-matrix(0,nrow=dim(xa)[1],ncol=dim(xa)[2]) heat[lower.tri(heat)]-xa[lower.tri(xa)] heat[upper.tri(heat)]-xb[upper.tri(xb)] diag(heat)-1 heat HTH, Daniel 1Rnwb wrote: Hello Gurus I have two correlation matrices 'xa' and

Re: [R] correlation matrix

2011-10-10 Thread Peter Alspach
Tena koe Sharad If I understand you correctly, you want the lower triangle of your combined matrix to be the lower triangle of one of the correlation matrices, and the upper triangle to be the upper triangle from the other. If so, check lower.tri() and upper.tri(). HTH Peter Alspach

Re: [R] multicore by(), like mclapply?

2011-10-10 Thread Thomas Lumley
This is the sort of thing that should be measured, rather than speculated about, but if you're using multicore all those subsets can be made at the same time, not sequentially, so they add up to a copy of the whole data. Using data.table rather than a data.frame would help, of course. I would

Re: [R] correlation matrix

2011-10-10 Thread Dénes TÓTH
And you might also consider packages like corrplot, corrgram etc. for other plotting options of a correlation matrix. They can be more informative than simply invoking image(heat) What a pleasant post to respond to - with self-contained code. :)

[R] How to test if two C statistics are significantly different?

2011-10-10 Thread Yujie Wang
Hey all, In order to test if a marker is a risk factor, I built two models (using cox proportional hazard model). One model included this marker, and the other is not. Then, I use R package risksetROC to test how much predictive value did the marker add to this model. I get two C statistics by

Re: [R] correlation matrix

2011-10-10 Thread 1Rnwb
okay so fixed what i need to do this way finit=0 for(ri in 1:dim(xa)[1]) { finit=finit+1 xc[ri,1:finit]-xa[ri,1:finit] xc[1:finit,ri]-xb[1:finit,ri] } but getting error in heatmap.2 mycol - colorpanel(n=40,low=red,mid=white,high=blue) heatmap.2(xc, breaks=pairs.breaks, col=mycol, Rowv=FALSE,

Re: [R] question about string to boor?

2011-10-10 Thread Christoph Molnar
Hi Nellie, hope I got you right. I guess you want something like that. for (i in 1:7) { oneOfNelliesArray - eval(parse(text=paste(grp,i, sep=))) anyFunction(oneOfNelliesArray) } Paste() just returns you a string. But you want R to evaluate the expression. So you have to parse it and tell

[R] invalid or not-yet-implemented 'Matrix' subsetting

2011-10-10 Thread collegegurl69
I have this error and I can't figure out whats wrong: invalid or not-yet-implemented 'Matrix' subsetting it pops up when I try to run this line of code: S - B[indices.mod,union(mir.e.nc,mir.negatives.nc)] -- View this message in context:

Re: [R] Linear programming problem, RGPLK - no feasible solution.

2011-10-10 Thread Hans W Borchers
Liu Evans, Gareth Gareth.Liu-Evans at liverpool.ac.uk writes: In my post at https://stat.ethz.ch/pipermail/r-help/2011-October/292019.html I included an undefined term ej. The problem code should be as follows. It seems like a simple linear programming problem, but for some reason my code is

Re: [R] multicore by(), like mclapply?

2011-10-10 Thread Hadley Wickham
On Mon, Oct 10, 2011 at 4:14 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: I could be waay off base here, but my concern about presplitting the data is that you will have your data, and a second copy of our data that is something like a list where each element contains the portion of the

Re: [R] question about string to boor?

2011-10-10 Thread Rolf Turner
On 11/10/11 08:21, Christoph Molnar wrote: Hi Nellie, hope I got you right. I guess you want something like that. for (i in 1:7) { oneOfNelliesArray- eval(parse(text=paste(grp,i, sep=))) anyFunction(oneOfNelliesArray) } Paste() just returns you a string. But you want R to evaluate the

[R] Fwd: WHO Anthro growth curve macros and R

2011-10-10 Thread Gustaf Rydevik
Hi all, some years ago, I sent a question to the mailing list regarding the WHO anthro macros. Since I've now received three mails asking how I solved it, I thought I'd cc R-help in for future reference. Attaching a zip file with the relevant code parts that I used that I'm not sure gets through

Re: [R] Scheirer-Ray-Hare

2011-10-10 Thread bhvonkorff
I have been trying to use this test recently, following the text from this link: http://books.google.com/books?id=1eTyuMDND94Cpg=PA145lpg=PA145dq=nonparam#v=onepageqf=false I ordered my data based on ranks, and ran a type III ANOVA from the car package - something like

[R] Text Mining with Facebook Reviews (XML and FQL)

2011-10-10 Thread Kenneth Zhang
Hello, I am trying to use XML package to download Facebook reviews in the following way: require(XML) mydata.vectors - character(0) Qword - URLencode('#IBM') QUERY - paste('SELECT review_id, message, rating from review where message LIKE %',Qword,'%',sep='') Facebook_url =

Re: [R] Fwd: WHO Anthro growth curve macros and R

2011-10-10 Thread David Winsemius
On Oct 10, 2011, at 4:48 PM, Gustaf Rydevik wrote: Hi all, some years ago, I sent a question to the mailing list regarding the WHO anthro macros. Since I've now received three mails asking how I solved it, I thought I'd cc R-help in for future reference. Attaching a zip file with the

[R] SLOW split() function

2011-10-10 Thread ivo welch
dear R experts:  apologies for all my speed and memory questions.  I have a bet with my coauthors that I can make R reasonably efficient through R-appropriate programming techniques. this is not just for kicks, but for work. for benchmarking, my [3 year old] Mac Pro has 2.8GHz Xeons, 16GB of

[R] Rolling optimization

2011-10-10 Thread Darius H
Hello everyone, I would like assistance with a snippet I have written to do a recursive portfolio optimization given time-varying return forecasts. In my case, I have forecast the monthly returns for nearly 55 years out on 8 asset classes. I need to calculate the weights for the optimal

Re: [R] Rolling optimization

2011-10-10 Thread R. Michael Weylandt
Not having played with portfolio.opim() much, I can't guarantee this will fix it, but if it requires a matrix rather than a vector and you are sure about the rest of the syntax, this might do the trick: asset_forecast[i, , drop = FALSE] This is because: R x = matrix(1:9, 3) R is.matrix(x[,1])

Re: [R] SLOW split() function

2011-10-10 Thread Jim Holtman
instead of spliting the entire dataframe, split the indices and then use these to access your data: try system.time(s - split(seq(nrow(d)), d$key)) this should be faster and less memory intensive. you can then use the indices to access the subset: result - lapply(s, function(.indx){

  1   2   >