Re: [R] Problems installing docopt

2016-03-23 Thread David Winsemius
> On Mar 23, 2016, at 2:48 PM, Neale Ferguson wrote: > > Hi, > I¹ve seen similar questions when googling this problem but none of them > seem directly related to what I am seeing. Doing an install.r docopt craps > out with stringi build complaining: > > Error in iconv(x,

[R] Problems installing docopt

2016-03-23 Thread Neale Ferguson
Hi, I¹ve seen similar questions when googling this problem but none of them seem directly related to what I am seeing. Doing an install.r docopt craps out with stringi build complaining: Error in iconv(x, "latin1", "ASCII") : unsupported conversion from 'latin1' to 'ASCII' Searching came up

Re: [R] test hypothesis in R

2016-03-23 Thread David Winsemius
> On Mar 23, 2016, at 1:44 PM, ruipbarra...@sapo.pt wrote: > > Hello, > > Try > > ?t.test > t.test(mA, mB, alternative = "greater") > > Hope this helps, > > Rui Barradas > > > Citando Eliza Botto : > >> Dear All, >> I want to test a hypothesis in R by using

Re: [R] test hypothesis in R

2016-03-23 Thread ruipbarradas
Sorry, but in your original post you said that " Null Hypothesis (H0) is that the error produces by model A is not lower than model B". If now is that model A produces less error change to alternative="less". The relevant part in the help page ?t.test is alternative = "greater" is the

Re: [R] Persistent state in a function?

2016-03-23 Thread Boris Steipe
All - Thanks, this has been a real eye-opener. Here's my variation based on what I've learned so far. It's based on Bert's earlier function-returning-a-closure example. I hope I got the terminology right. # makeCache <- function(){ #

Re: [R] Persistent state in a function?

2016-03-23 Thread Martin Morgan
Use a local environment to as a place to store state. Update with <<- and resolve symbol references through lexical scope E.g., persist <- local({ last <- NULL# initialize function(value) { if (!missing(value)) last <<- value

Re: [R] Help batch saving elements of a list into unique files

2016-03-23 Thread Christian T Stackhouse (Campus)
Jim, I wanted to thank you for your help and let you know I came up with a very simple solution to the header issue. I made a vector of the original header names before the split and fed that to names in your for loop: h1 <- colnames(affymatrix) for(affdf in 1:length(out)) {

Re: [R] Why missing values are not allowed in 'poly'?

2016-03-23 Thread William Dunlap via R-help
I don't know what is in R's poly(), but if it is like S+'s or TERR's then one could do if (anyNA(x)) { nax <- na.exclude(x) px <- poly(x = nax, degree = degree, coefs = coefs, raw = raw, simple = simple) px <-

Re: [R] test hypothesis in R

2016-03-23 Thread Eliza Botto
Thnx Rui, Just one point though Should it be alternative="greater" or "less"? Since alternative hypothesis is that model A produced less error. regards, Eliza Date: Wed, 23 Mar 2016 20:44:20 + From: ruipbarra...@sapo.pt To: eliza_bo...@outlook.com CC: r-help@r-project.org Subject: Re: [R]

Re: [R] test hypothesis in R

2016-03-23 Thread ruipbarradas
Hello, Try ?t.test t.test(mA, mB, alternative = "greater") Hope this helps, Rui Barradas   Citando Eliza Botto : > Dear All, > I want to test a hypothesis in R by using student' t-test (P-values). > The hypothesis is that model A produces lesser error than model B at

Re: [R] Why missing values are not allowed in 'poly'?

2016-03-23 Thread Liviu Andronic
On Wed, Mar 23, 2016 at 9:29 PM, William Dunlap wrote: > I think the worst aspect of this restriction in poly() is that when > you use poly in the formula of a model-fitting function you cannot > have any missing values in the data, even if you supply > na.action=na.exclude. >

Re: [R] Why missing values are not allowed in 'poly'?

2016-03-23 Thread William Dunlap via R-help
I think the worst aspect of this restriction in poly() is that when you use poly in the formula of a model-fitting function you cannot have any missing values in the data, even if you supply na.action=na.exclude. > d <- transform(data.frame(y=c(-1,1:10)), x=log(y)) Warning message: In

[R] Why missing values are not allowed in 'poly'?

2016-03-23 Thread Liviu Andronic
Dear all, I'm a bit surprised by this behavior in poly: x <- c(NA, 1:10) poly(x, degree = 2, raw=TRUE) ## Error in poly(x, degree = 2, raw = TRUE) : ## missing values are not allowed in 'poly' x^2 ## [1] NA 1 4 9 16 25 36 49 64 81 100 As you can see, poly() will fail if the vector contains

[R] test hypothesis in R

2016-03-23 Thread Eliza Botto
Dear All, I want to test a hypothesis in R by using student' t-test (P-values). The hypothesis is that model A produces lesser error than model B at ten stations. Obviously, Null Hypothesis (H0) is that the error produces by model A is not lower than model B. The error magnitudes are #model A

Re: [R-es] ACF retardos múltiplos del periodo

2016-03-23 Thread david santolaria
Lo primero de todo, muchas gracias Isidro por tus respuestas. He probado tu segunda solución y parece correcta, pero pierdo el formato de gráfico ACF. Me refiero a que pierdo la banda de confianza del cero, las lineas... (ver imagenes). ¿Alguna otra solución? Dado que es algo, relativamente

Re: [R-es] R sin instalar

2016-03-23 Thread Griera-yandex
Hola: No se si esto te puede servir: BioStatFLOSS: http://www.sergas.es/Saude-publica/BioStatFLOSS Saludos. On Wed, 23 Mar 2016 10:07:53 -0400 (EDT) merlinva2...@grannet.grm.sld.cu wrote: > Buenos días, > > Tengo que usar varias máquinas, algunas de las cuales no tienen R > instalado ni se

[R] Limits of detection with package pls

2016-03-23 Thread Castro, Alonso
I'm using package pls to perform partial least squares regression. Data is four spectra (13178 intensity measurements each) that correspond to 4 concentrations. out <- plsr(concentration ~ intensity, ncomp=2, data=libs, validation = "LOO") Does the package have a command to calculate limits of

Re: [R] Reshaping an array - how does it work in R

2016-03-23 Thread Martin Maechler
> Dénes Tóth > on Tue, 22 Mar 2016 10:55:58 +0100 writes: > Hi Martin, > On 03/22/2016 10:20 AM, Martin Maechler wrote: >>> >Dénes Tóth >>> > on Fri, 18 Mar 2016 22:56:23 +0100 writes: >> > Hi

Re: [R] bug (?) with lapply / clusterMap / clusterApply etc

2016-03-23 Thread jacob
Very informative! Thank you. Quoting Martin Morgan : On 03/22/2016 01:46 PM, ja...@forestlidar.org wrote: Hello I have encountered a bug(?) with the parallel package. When run from within a function, the parLapply function appears to be copying the entire

Re: [R] Persistent state in a function?

2016-03-23 Thread Greg Snow
Boris, You may want to look into the R6 package. This package has tools that help create objects (environments) with methods that can use and change the object. You can have your persistent table stored as part of your object and then create methods that will use and modify the table within the

Re: [R] Is there dpois equivalent for zero-inflated Poisson?

2016-03-23 Thread Martin Maechler
> Thierry Onkelinx > on Tue, 22 Mar 2016 13:58:09 +0100 writes: > dpois(0, lambda) == e^(-lambda) > The wikipedia formula is > ifelse(x == 0, zero + dpois(0, lambda) * (1-zero), dpois(x, lambda) * > (1-zero)) > or > ifelse(x == 0,

Re: [R] summation involving multiple summations

2016-03-23 Thread Greg Snow
You can create a list of functions then use subscripting. E.g.: funvec <- c(sin, cos, tan) for(i in 1:3) { print(funvec[[i]](pi/6)) } Just create the list with the different functions that you want to call, then subscript that list with your n_r variable. You can also look at ?switch, but I

Re: [R] How to extend an existing linear mixed effects model using lme in R?

2016-03-23 Thread Bert Gunter
You should post this on the mixed models list instead of here: https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom

[R-es] R sin instalar

2016-03-23 Thread merlinva2012
Buenos días, Tengo que usar varias máquinas, algunas de las cuales no tienen R instalado ni se lo puedo instalar. Alguien sabe si existe una versión de R que no exista la necesidad de instalarlo o cómo hacerla. Saludos y gracias anticipadas, merlin -- Este mensaje le ha llegado mediante el

Re: [R] adding points in plot loop

2016-03-23 Thread PIKAL Petr
Hi Anothar approach is to reshape your ext data frame As you did not show your data I use my own. > dput(mikro) structure(list(cas = c(0L, 2L, 3L, 5L, 6L, 8L, 9L, 10L, 12L, 17L, 23L), zr = c(0.19, 0.115, 0.073, 0.068, 0.052, 0.055, 0.048, 0.047, 0.047, 0.045, 0.045), zrred = c(0.145, 0.07,

Re: [R] adding points in plot loop --> try using matplot() !

2016-03-23 Thread Martin Maechler
> Duncan Murdoch > on Wed, 23 Mar 2016 05:55:43 -0400 writes: > On 23/03/2016 5:36 AM, catalin roibu wrote: >> Dear R users, >> >> I have a dataframe with 6 columns and I want to create a plot (with for >> loop). My question is how to

Re: [R-es] ACF retardos múltiplos del periodo

2016-03-23 Thread Isidro Hidalgo Arellano
Por si no me he explicado bien: datos <- c(123152, 124017, 122268, 118182, 114263, 113023, 10, 108001, 107205, 109355, 110795, 114385 117895, 118650, 116934, 112564, 107998, 106336, 101285, 100865, 100753, 101670, 103811, 110674 110601, 109846, 107855, 103080, 98199, 95838, 90920, 90735,

Re: [R-es] ACF retardos múltiplos del periodo

2016-03-23 Thread Isidro Hidalgo Arellano
Puedes extraer los acf de la "serie" (los tienes en serie$acf para los retardos serie$lag), los seleccionas con seq() y los pones en un gráfico... Isidro Hidalgo Arellano Observatorio del Mercado de Trabajo Consejería de Economía, Empresas y Empleo http://www.castillalamancha.es/ -Mensaje

[R-es] ACF retardos múltiplos del periodo

2016-03-23 Thread david santolaria
Hola, Estoy visualizando una serie temporal para determinar sus órdenes ARIMA y no consigo lo siguiente: ¿Cómo puedo sacar la ACF de los retardos múltiplos del periodo? Es decir, sólo ver en el gráfico ACF los retardos 12, 24, 36... Gracias!! David [[alternative HTML version deleted]]

Re: [R] adding points in plot loop

2016-03-23 Thread Duncan Murdoch
On 23/03/2016 5:36 AM, catalin roibu wrote: Dear R users, I have a dataframe with 6 columns and I want to create a plot (with for loop). My question is how to add points in the for loop? I tried this code, but without success. vv<-rbind(colnames(ext)) for(i in 1:ncol(vv)){ with(ext,

[R] adding points in plot loop

2016-03-23 Thread catalin roibu
Dear R users, I have a dataframe with 6 columns and I want to create a plot (with for loop). My question is how to add points in the for loop? I tried this code, but without success. vv<-rbind(colnames(ext)) for(i in 1:ncol(vv)){ with(ext, plot(rownames(ext), ext[,i], type="p",las=1,

Re: [R] Help batch saving elements of a list into unique files

2016-03-23 Thread Christian T Stackhouse (Campus)
Very close! The header now looks like this: c("10", "11", "1_", "HuEx", "1_0", "st", "v2", "", "CEL") For some reason, it's not concatenating. Best, Christian T. Stackhouse | Graduate Student GBS Neuroscience Theme Department of Neurosurgery Department of Radiation Oncology UAB | The

Re: [R] Help batch saving elements of a list into unique files

2016-03-23 Thread Christian T Stackhouse (Campus)
This is what I ran: > drop_token1<-function(x) { + return(paste(x[2:length(x)],sep=".")) + } > for(affdf in 1:length(out)) { + names(out[[affdf]])<-lapply(unlist(strsplit(names(out[[affdf]]),"[.]")),drop_token1) + write.csv(out[[affdf]],file=paste("affymetrix",affdf,".txt",sep="")) + }

Re: [R] Help batch saving elements of a list into unique files

2016-03-23 Thread Christian T Stackhouse (Campus)
Thank you, Jim. I got this error returned: Error in strsplit(names(out[[affdf]])) : argument "split" is missing, with no default Christian T. Stackhouse | Graduate Student GBS Neuroscience Theme Department of Neurosurgery Department of Radiation Oncology UAB | The University of Alabama at

[R] How to extend an existing linear mixed effects model using lme in R?

2016-03-23 Thread urs
Dear list, I fitted a linear mixed effects model using lme in R on a relatively large data set. Now I want to extend this model, introducing an additional fixed effect on a subset of the data without altering coefficients estimated on the original dataset. I.e. original model for example:

Re: [R] Help batch saving elements of a list into unique files

2016-03-23 Thread Christian T Stackhouse (Campus)
I ran: drop_token1<-function(x) { return(paste(x[2:length(x)],sep="",collapse=".")) } for(affdf in 1:length(out)) { names(out[[affdf]])<-lapply(strsplit(names(out[[affdf]]),"[.]"),drop_token1) write.csv(out[[affdf]],file=paste("affymetrix",affdf,".txt",sep="")) } I got the files out with

Re: [R] Help batch saving elements of a list into unique files

2016-03-23 Thread Christian T Stackhouse (Campus)
Jim, It worked! It wrote out the files, but unfortunately, it didn't work for the file headers. I should have mentioned this is what the headers look like: X0.Classical.10.11.1_.HuEx.1_0.st.v2..CEL After running your script, that header changes to: 10. I'd just like to remove the "X0." prefix

Re: [R] Help batch saving elements of a list into unique files

2016-03-23 Thread Christian T Stackhouse (Campus)
I re ran it and this is what I got: 11.1_.HuEx.1_0.st.v2..CEL Should be: 10.11.1_.HuEx.1_0.st.v2..CEL Christian T. Stackhouse | Graduate Student GBS Neuroscience Theme Department of Neurosurgery Department of Radiation Oncology UAB | The University of Alabama at Birmingham Hazelrig-Salter