Re: [R] SLOW split() function

2011-10-10 Thread Joshua Wiley
As another followup, given that you are doing numerous regression models and (I presume) working with finance/stock data that is strictly numeric (no need for special contrast coding, etc.), you can substantially reduce the time spent estimating the coefficients. A simple way is to use lm.fit dire

[R] extra digits added to data

2011-10-10 Thread Mark Harrison
I am having a problem with extra digits being added to my data which I think is a result of how I am converting my data.frame data to xts. I see the same issue in R v2.13.1 and RStudio version 0.94.106. I am loading historical foreign exchange data in via csv files or from a sql server database.

[R] Odp: Superposing mean line to xyplot

2011-10-10 Thread Petr PIKAL
Hi > > 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

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

2011-10-10 Thread Petr PIKAL
Hi > > 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

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

2011-10-10 Thread Petr PIKAL
Hi I would try either some tree method (mvpart) or you can expand lm model also with users. fit<-lm(value~variable+users, data=test.m) Anyway I am not an ultimate expert in statistics. so you shall also consult some appropriate literature which can be found in CRAN web. Did you try to look i

Re: [R] SLOW split() function

2011-10-10 Thread ivo welch
thank you, everyone. this was very helpful to my specific task and understanding. for the benefit of future googlers, I thought I would post some experiments and results here. ultimately, I need to do a by() on an irregular matrix, and I now know how to speed up by() on a single-core, and then a

Re: [R] SLOW split() function

2011-10-10 Thread William Dunlap
The following avoids the overhead of data.frame methods (and assumes the data.frame doesn't include matrices or other data.frames) and relies on split(vector,factor) quickly splitting a vector into a list of vectors. For a 10^6 row by 10 column data.frame split in 10^5 groups this took 14.1 seconds

Re: [R] Finding solution

2011-10-10 Thread Berend Hasselman
Bogaso wrote: > > Dear all, I have a system of simultaneous equations with 2 unknowns as > follows: > > x*y + (1-x) = 0.05 > > x*(y - .5)^2 + (1-x)*0.6 = 0.56^2 > > Ofcourse I can do it manually however wondering whether there is any > direct > way in R available to get the solution of this sy

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

2011-10-10 Thread Ben Bolker
collegegurl69 hotmail.com> writes: > > 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)] Could we have a reproducible example

Re: [R] SLOW split() function

2011-10-10 Thread Dennis Murphy
I tried this: library(data.table) N <- 1000 T <- N*10 d <- data.table(gp= rep(1:T, rep(N,T)), val=rnorm(N*T), key = 'gp') dim(d) [1] 10002 # On my humble 8Gb system, > system.time(l <- d[, split(val, gp)]) user system elapsed 4.150.094.27 I wouldn't be surprise

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){ do

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

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

[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 RAM,

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 rele

[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 = paste('https://api.

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=1eTyuMDND94C&pg=PA145&lpg=PA145&dq=nonparam#v=onepage&q&f=false I ordered my data based on ranks, and ran a type III ANOVA from the car package - something like Anova(lm(var1~var2*var

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

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

2011-10-10 Thread Hadley Wickham
On Mon, Oct 10, 2011 at 4:14 PM, Joshua Wiley 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 data for that > split.

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

2011-10-10 Thread Hans W Borchers
Liu Evans, Gareth 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 not finding

[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: http://r.789695.n4.nabble.com/invalid-or-not-yet-

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 t

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

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

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. :) > > heat<-matrix(0,nrow=dim(xa)[1],ncol=dim(xa)

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 gu

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

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 techniqu

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 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  ... > 0.44553    -0.4522

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

2011-10-10 Thread Thomas Lumley
On Tue, Oct 11, 2011 at 7:54 AM, ivo welch 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 different cases, too.

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 ag

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

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

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

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

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,

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 Nabble.c

[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* pmml

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 that

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

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

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 lik

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 p

[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

[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

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 = data.fram

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 app

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

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 parti

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

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

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" wrote in message news:CAHA9McPQ4P-a2imjm=szgjfxyx0faw0j79fwq2e87dqkf9j...@ma

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

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

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 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: http://www.scala-lang.org/node/113 Something s

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

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 wrote: > Dear R-users, > > I want to multiple impute missing scores, but only for a few subgroups in my > dat

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) : inc

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

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

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

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] "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 > Thanks, Carlos, > > Tried that, but no success, still getting this err

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 <-c(1,0

[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.tx

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

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

[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, post=p

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

Re: [R] Type of Graph to use

2011-10-10 Thread Gabor Grothendieck
On Mon, Oct 10, 2011 at 8:49 AM, Gabor Grothendieck wrote: > On Mon, Oct 10, 2011 at 6:49 AM, Jurgens de Bruin 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  

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 wrote: > 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 G

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 wrote: > On Mon, Oct 10, 2011 at 6:49 AM, Jurgens de Bruin > wrote: > > Hi, > > > > Please advice on what type of graph can be used to display the followi

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] "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, at=c(1,10,100,10

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

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 v

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 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 wrote: > See if this gives you the presentation you want: > > x <- read.table(textConnection("NameClass > a Class1 > a Class4 > b Class2 > b

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

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 wrote: > Convert to character first or

[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]), ylab=expression(N[

[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

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 wrote: > > > > Hi Petr, > > > > It's

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

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: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#..

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

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

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] 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 Cc: "R-help@r-project.org" Sent: Monday, October 10, 2011 10:42 AM Subject: Re: [R] Handling Time

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 parame

[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

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

  1   2   >