Re: [R] using a variable for a column name in a formula

2013-10-14 Thread peter dalgaard
On Oct 13, 2013, at 23:40 , Sarah Goslee wrote: > This being R, there are likely other ways, but I use: > > lm(as.formula(paste(nnn, "~ .")),data=X) > That'll do for most purposes, but fortune("parse") applies. In particular: What happens if nnn is like "weight (kg)"? I'd prefer to do a litt

[R] Transform plot3d grafics in to executable files

2013-10-14 Thread paladini
Hello, I did some nice grafics using plot 3d and scatter3d. Is there a, hopefully not too complicated way, to transform these dynamic, three-dimensional and interactive grafics in a kind of executable file? I want to show and send them via e-mail to projekt partners who don`t use GNU R and w

[R] [R-pkgs] new package 'midasr'

2013-10-14 Thread Vaidotas Zemlys
Dear list members, A new package, called *midasr* (version 0.1), is now available on CRAN: http://cran.r-project.org/package=midasr This package provides econometric methods for working with mixed frequency data. The package provides tools for estimating the time series MIDAS regression, where

[R] Comparing two groups

2013-10-14 Thread Andrej
Hi, this might sound trivial, but I'm pretty new to R and statistics in general. What I want to do is to compare two data values. The hook is, that they are non-normally distributed and that one value is five times as big as the other. The box-plots look like this

Re: [R] Comparing two groups

2013-10-14 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Andrej > Sent: Monday, October 14, 2013 9:49 AM > To: r-help@r-project.org > Subject: [R] Comparing two groups > > Hi, > this might sound trivial, but I'm pretty new to R and

Re: [R] automation of an R script to run

2013-10-14 Thread Johnson, Alex
Thank you everyone for your help. I have managed to now figure it out by creating a batch file to run R. I can then schedule this batch file to run. Not sure if this is the best way of doing it but it seems to work for me. Thank you for the help Alex Fr

[R] Passing multiple object names to a user-defined R fn XXXX

2013-10-14 Thread Dan Abner
Hi all, I am attempting to write an R fn that will accept multiple (but varying on how many) objects (usually data frames) as inputs and return summary output. What is the best way to pass the object names to the fn (I have thought of 2 options below) AND how do I then use the names inside the fn

[R] add points on an existant ggplot from another dataframe

2013-10-14 Thread Arnaud Michel
Hello I had draw the results of PCA (Principal Components Analysis) (1) Is it possible to put on this graphic the 75% ellipse confidence of each sex calculated by dataEllipse (library(car)) ? My code is 1) PCA data frame with 169 rows and 2 columns library(ggplot2) p <- ggplot(PCA, aes(x=F1, y=

Re: [R] rjava be-carefuls

2013-10-14 Thread Hurr
No answers in the three days. Does anyone use rjava? If no one uses it, then I am afraid to try. Or is it extremely easy? -- View this message in context: http://r.789695.n4.nabble.com/rjava-be-carefuls-tp4678102p4678201.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Passing multiple object names to a user-defined R fn XXXX

2013-10-14 Thread PIKAL Petr
Hi I will not answer your question directly but instead I have some recommendation for you. If you can put these data frames to one list object when you creates them, you can save yourself a lot of troubles. some.list<-vector("list", n) for (i in 1:n) { some.list[[i]] <- some extensive computat

Re: [R] add points on an existant ggplot from another dataframe

2013-10-14 Thread Ista Zahn
Michael, Do not cross-post! I've answered this question on the ggplot2 list. On Mon, Oct 14, 2013 at 11:27 AM, Arnaud Michel wrote: > Hello > I had draw the results of PCA (Principal Components Analysis) (1) > Is it possible to put on this graphic the 75% ellipse confidence of each sex > calculat

Re: [R] Passing multiple object names to a user-defined R fn XXXX

2013-10-14 Thread Rui Barradas
Hello, You should put all those data frames in a list and then use the list (just one object). But if you have several objects in your workspace and need to write a function that accepts a varying number of arguments, use the dots argument: df.set <- function(..., by){ dots <- list(..

[R] simple postscript question

2013-10-14 Thread Troels Ring
Dear friends - following instructions via google I managed to have the following eps accepted well in words - but I cannot get a decent postscript print from Gswiew, latest edition. The ylab is printed only in half, the par(mar seems inconsequential. I hope you will forgive this simple question

Re: [R] Passing multiple object names to a user-defined R fn XXXX

2013-10-14 Thread Bert Gunter
A minor quibble. I would argue that R best practice would be to keep the summarization and printing separate; viz df.set <- function(...){ dots <- list(...) # all those objects in a list } On Mon, Oct 14, 2013 at 8:43 AM, Rui Barradas wrote: > Hello, > > You should put all those data

Re: [R] Passing multiple object names to a user-defined R fn XXXX

2013-10-14 Thread Bert Gunter
Sorry about the previous partial message. My email screwed up. Here's the complete message: df.set <- function(...){ dots <- list(...) # all those objects in a list lapply(dots,summary) } Cheers, Bert On Mon, Oct 14, 2013 at 8:59 AM, Bert Gunter wrote: > A minor quibble. > > I

[R] singularity problem

2013-10-14 Thread Šárka Rusá
Dear R, I have a problem concerning the inverse of a matrix. My matrix is quite large and I extracted just linearly independent columns from the matrix. However, the function solve() still cannot invert the matrix - I get an error that it is computationally singular. Is there any way how to extrac

Re: [R] MCP solver

2013-10-14 Thread Maxwell, John McFarland
Thanks for the response! The specific type of MCP I'm trying to solve is a square system of nonlinear equations with complementarity conditions (a computable general equilibrium model for predicting economic outcomes). The PATH solver in GAMS would certainly work for it, however as I don't have

[R] x12 doesn't work any longer

2013-10-14 Thread Victor
Context: Mac OS X 10.7 - R 3.0.2 GUI 1.62 Snow Leopard build (6558) I had been using x12 for some time with no problem at all. every month I update the time series ricpesata (see below) and run the simple procedure below. Now adding the data of the last month, Sep.2013, x12 is complaining: > l

[R] Help with combining functions

2013-10-14 Thread Kile Green
Hi, I am very new to 'R' ("discovered" it about 2 months ago) and have been trying to teach myself the language using online guides, however I am not a programmer or statistician and so progress is slow. As an exercise, I have been trying to generate the numbers 1 to 100 and replace multip

[R] repeat a linear regression model

2013-10-14 Thread Valeria Muzzolini
Hello, I'd like to repeat a linear regression model for groups of rows that are identified by an ID number. My table is like this: ID Y X1 X2 X3 X4 1 555 111 222 333 456 1 345 234 445 543 33 1 456 353 453 456

Re: [R] simple postscript question

2013-10-14 Thread David Winsemius
On Oct 14, 2013, at 8:52 AM, Troels Ring wrote: > Dear friends - following instructions via google I managed to have the > following eps accepted well in words - but I cannot get a decent postscript > print from Gswiew, latest edition. The ylab is printed only in half, the > par(mar seems inco

[R] Extracting elements of model output

2013-10-14 Thread David C. Howell
I am having difficulty extracting specific results from the model object. The following code shows where I am stuck. I want to run resamplings of a data set. For each I want to extract a particular F for the contrasts. If I run a very simple model (e.g. model1 <- aov(time~group) ) I can get the

Re: [R] repeat a linear regression model

2013-10-14 Thread Doran, Harold
Well, see the help page for by() or an apply() function. But, YIKES, maybe work with a statistician who can help you with the underlying issue. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Valeria Muzzolini Sent: Monday, Octobe

Re: [R] MCP solver

2013-10-14 Thread Berend Hasselman
On 14-10-2013, at 18:46, "Maxwell, John McFarland" wrote: > Thanks for the response! The specific type of MCP I'm trying to solve is a > square system of nonlinear equations with complementarity conditions (a > computable general equilibrium model for predicting economic outcomes). The > PATH

Re: [R] Transform plot3d grafics in to executable files

2013-10-14 Thread David Winsemius
On Oct 14, 2013, at 1:33 AM, palad...@trustindata.de wrote: > Hello, > I did some nice grafics using plot 3d and scatter3d. Is there a, hopefully > not too complicated way, to transform these dynamic, three-dimensional and > interactive grafics in a kind of > executable file? I want to show and

Re: [R] Help with combining functions

2013-10-14 Thread arun
Hi, Try:  vec1 <- as.character(factor(1*(n%%3==0)+2*(n%%5==0)+3*(n%%15==0),labels=c("Other","heads","tails","headstails")))  vec1[vec1=="Other"] <- which(vec1=="Other") vec1[1:6] #[1] "1" "2" "heads" "4" "tails" "heads" A.K. On Monday, October 14, 2013 12:57 PM, Kile Green wrote

Re: [R] R Help-Implicit loop-lapply

2013-10-14 Thread arun
Hi,The conditions are not very clear. set.seed(285)  RN <- sample(1:100,20,replace=FALSE) aList <- lapply(1:10,function(i) sample(RN,i,replace=FALSE))  sapply(aList,tail,1) # [1] 87 60 96 87 60 67 42 96 73 24 A.K. I was wondering if I could obtain some help on how to do this. I feel as if

Re: [R] MCP solver

2013-10-14 Thread Berend Hasselman
On 14-10-2013, at 18:46, "Maxwell, John McFarland" wrote: > Thanks for the response! The specific type of MCP I'm trying to solve is a > square system of nonlinear equations with complementarity conditions (a > computable general equilibrium model for predicting economic outcomes). The > PATH

Re: [R] Extracting elements of model output

2013-10-14 Thread Rui Barradas
Hello, Inline. Em 14-10-2013 18:01, David C. Howell escreveu: I am having difficulty extracting specific results from the model object. The following code shows where I am stuck. I want to run resamplings of a data set. For each I want to extract a particular F for the contrasts. If I run a ve

Re: [R] repeat a linear regression model

2013-10-14 Thread arun
Hi, Try: Please use ?dput() to show the example dataset: dat <- structure(list(ID = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), Y = c(555L, 345L, 456L, 552L, 342L, 452L, 555L, 345L, 456L, 552L, 342L, 452L, 562L, 352L, 463L, 582L, 342L, 483

[R] sequentially aggregating elements of a vector

2013-10-14 Thread Martin Batholdy
Hi, for labelling the stacked bars in a barplot, I need to sequentially sum up the elements of a vector. Suppose I have; x <- c(1,2,3,4) (which correspond to the bar-width of stacked bars) I need; y <- c(1,3,6,11) (which corresponds to the upper y-values for each bar). What is the eas

Re: [R] sequentially aggregating elements of a vector

2013-10-14 Thread Rui Barradas
Hello, Try ?cumsum cumsum(1:4) [1] 1 3 6 10 Hope this helps, Rui Barradas Em 14-10-2013 19:49, Martin Batholdy escreveu: Hi, for labelling the stacked bars in a barplot, I need to sequentially sum up the elements of a vector. Suppose I have; x <- c(1,2,3,4) (which correspond to the

Re: [R] sequentially aggregating elements of a vector

2013-10-14 Thread Martin Batholdy
> The last element 11 in y is confusing. sorry for the typo. It is of course y <- c(1,3,6,10) > cumsum(x) thanks! On Oct 14, 2013, at 20:57 , arun wrote: > The last element 11 in y is confusing. > > cumsum(x) > [1] 1 3 6 10 > A.K. > > > On Monday, October 14, 2013 2:51 PM, Martin Bath

Re: [R] singularity problem

2013-10-14 Thread Rolf Turner
On 10/14/13 23:31, Šárka Rusá wrote: Dear R, I have a problem concerning the inverse of a matrix. My matrix is quite large and I extracted just linearly independent columns from the matrix. However, the function solve() still cannot invert the matrix - I get an error that it is computationally s

[R] there is no package called 'boot'

2013-10-14 Thread Christian Hoffmann
Hi, R CMD mypackage /Users/hoffmann/R/cwhmisc check --as-cran gives me * checking Rd cross-references ... WARNING Error in find.package(package, lib.loc) : there is no package called 'boot' although there is no textual reference to 'boot' in my /R and /man within /cwhmisc nor any file of

Re: [R] x12 doesn't work any longer

2013-10-14 Thread Rolf Turner
On 10/15/13 02:52, Victor wrote: Context: Mac OS X 10.7 - R 3.0.2 GUI 1.62 Snow Leopard build (6558) I had been using x12 for some time with no problem at all. every month I update the time series ricpesata (see below) and run the simple procedure below. Now adding the data of the last month,

[R] Call of interest: mixed modelling course in Quebec City

2013-10-14 Thread Highland Statistics Ltd
This is a call of interest for: "Introduction to linear mixed effects modelling and GLMM course" Where: Quebec City, Canada When: 24 - 28 March 2014 Flyer: http://www.highstat.com/Courses/Flyer2014_03Quebec.pdf General info: http://www.highstat.com/statscourse.htm Kind regards, Alain Zuur -

[R] Image Classification in R

2013-10-14 Thread Lorenzo Isella
Dear All, For a project I am given a set of images. They represent either healthy or tumoral tissue, but the specific nature of the images does not matter. I need to train a classifier which is expected to tell me in which category (let's call it 0 vs 1) each image falls. I am thinking about a

Re: [R] Image Classification in R

2013-10-14 Thread Bert Gunter
This is an R-help list. These are not questions about R. You should talk to a local statistical expert instead of posting here. Cheers, Bert On Mon, Oct 14, 2013 at 1:23 PM, Lorenzo Isella wrote: > Dear All, > For a project I am given a set of images. They represent either healthy or > tumoral t

Re: [R] R Help-how to use sapply w/tapply

2013-10-14 Thread arun
Hi, (Please use ?dput() to share the example dataset. Avoid using images to show dataset. Also, please read the posting guide esp. regarding home work, assignments etc.) res <- sapply(Gene[,-1],function(x) tapply(x,list(Gene$Genotype),mean)) #or res2 <-  aggregate(.~Genotype, data=Gene,mean)

Re: [R] Image Classification in R

2013-10-14 Thread Suzen, Mehmet
Hello Lorenzo, Try to locate related R packages from here: http://cran.r-project.org/web/views/MedicalImaging.html On 14 October 2013 22:23, Lorenzo Isella wrote: > Dear All, > For a project I am given a set of images. They represent either healthy or > tumoral tissue, but the specific nature of

[R] project parallel help

2013-10-14 Thread Jeffrey Flint
I'm running package parallel in R-3.0.2. Below are the execution times using system.time for when executing serially versus in parallel (with 2 cores) using parRapply. Serially: user system elapsed 4.670.034.71 Using package parallel: user system elapsed 3.820.12

Re: [R] project parallel help

2013-10-14 Thread Jeff Newmiller
Your question misses on several points in the Posting Guide so any answers are handicapped by you. There is an overhead in using parallel processing, and the value of two cores is marginal at best. In general parallel by forking is more efficient than parallel by SNOW, but the former is not ava

Re: [R] using ddply with segmented regression

2013-10-14 Thread Prew, Paul
Hello, the code provided by arun did the trick. Thank you very much, arun. However, I'm now unsure of how to further process the results . Looking at the vignette aka "split-apply-combine". It appears that I could now create a dataframe from the list of results, and then run the results t

Re: [R] using ddply with segmented regression

2013-10-14 Thread David Winsemius
On Oct 14, 2013, at 2:57 PM, Prew, Paul wrote: > Hello, the code provided by arun did the trick. Thank you very much, arun. > > However, I'm now unsure of how to further process the results . Looking at > the vignette aka "split-apply-combine". It appears that I could now create a > data

Re: [R] R Help-how to use sapply w/tapply

2013-10-14 Thread arun
Hi, Try: Gene[,-1] <- lapply(Gene[,-1],function(x) {x[sample(length(x),1)] <- NA;x}) A.K. I got it guys MeanofGenotype <-sapply(2:8, function(k) tapply(Gene[,k] , Gene$Genotype, mean)) I was wondering if now you guys can help me on how to insert a random NA to each column. The question i

Re: [R] rjava be-carefuls

2013-10-14 Thread Joe W. Byers
Hurr, You have not given us much to help with here. You might try posting a specific problem here or on rosuda-devel users group, the developer group for rjava and other omegahat projects. Otherwise, start programming and see what work. I am trying to get Jsoup and/or htmlunit to work with

[R] access the OECD odata API from R

2013-10-14 Thread Peter Ellis (Wellington)
Hi Is there an existing R package (or perhaps someone has one in development?) that can access the OECD's public database API (see http://stats.oecd.org/OpenDataAPI/OData.html). I'm thinking something equivalent to the WDI package that allows easy access to the World Bank's World Development

Re: [R] using ddply with segmented regression

2013-10-14 Thread arun
Hi Paul, No problem. Try: par(mfrow=c(1,2))  ldply(SP.seg,plot) #or lapply(SP.seg,plot) A.K. On Monday, October 14, 2013 5:57 PM, "Prew, Paul" wrote: Hello,  the code provided by arun did the trick.  Thank you very much, arun.  However, I'm now unsure of how to further process the resul

Re: [R] using ddply with segmented regression

2013-10-14 Thread Prew, Paul
Yes, David, sorry for the confusion. I forgot arun had proposed a genericized solution, where the dataframe name was shortened from "Test50.df" to "df". I could have replaced arun's 'df' references to 'Test50.df', but lazily changed my "Test50.df" to "df" and used arun's code verbatim. The un

Re: [R] RStudio with Revolution-R

2013-10-14 Thread David Winsemius
On Oct 14, 2013, at 4:27 PM, Maxim Linchits wrote: > Hello, > Is it possible to use Revolution-R's multithreading capability with > RStudio as the IDE? Apparently, RevoR is available for Ubuntu, > although I am not sure if this is well-supported and up to date build. > I would be interested in co

Re: [R] RStudio with Revolution-R

2013-10-14 Thread Jeff Newmiller
No disrespect intended to either software package... but why don't you ask this question on a forum where either of these software packages is on topic? --- Jeff NewmillerThe . . Go L

Re: [R] Transform plot3d grafics in to executable files

2013-10-14 Thread Duncan Murdoch
On 13-10-14 1:13 PM, David Winsemius wrote: On Oct 14, 2013, at 1:33 AM, palad...@trustindata.de wrote: Hello, I did some nice grafics using plot 3d and scatter3d. Is there a, hopefully not too complicated way, to transform these dynamic, three-dimensional and interactive grafics in a kind o

Re: [R] project parallel help

2013-10-14 Thread Jeffrey Flint
Jeff: Thank you for your response. Please let me know how I can "unhandicap" my question. I tried my best to be concise. Maybe this will help: > version _ platform i386-w64-mingw32 arch i386 os mingw32 system i386, mingw32 status major

Re: [R] Help with combining functions

2013-10-14 Thread arun
Using ?replace()  vec2 <- replace(n,c(n[n%%3==0 & !n%%5==0],n[!n%%3==0 & n%%5==0],n[n%%15==0]),c(rep(c("heads","tails","headstails"),c(sum(n%%3==0 & !n%%5==0),sum(!n%%3==0 & n%%5==0),sum(n%%15==0)  identical(vec1,vec2) #[1] TRUE #or library(plyr) vec3 <- mapvalues(n,c(n[n%%3==0 & !n%%5==0

Re: [R] project parallel help

2013-10-14 Thread Jeff Newmiller
The session info is helpful. To the best of my knowledge there is no easy way to share memory between R processes other than forking. You can use clusterExport to make "global" copies of large data structures in each process and pass index values to your function to reduce copy costs at a price

[R] Help Call

2013-10-14 Thread Dayashka Khan
Whenever I run a code to simulate AR/ARMA/SARIMA process using command: (say) *m1=(arima(z, order = c(1, 0, 1), seasonal = list(order = c(0, 0, 0), period = NA),xreg = NULL, include.mean = FALSE, transform.pars = FALSE, fixed = NULL,init = NULL))* Even for moderately large values of phi (the AR p