Re: [R] Extract from a text file

2016-05-30 Thread Ulrik Stervbo
Hi Val, Take a kook at read.table. If for some reason the file dosen't have the same separator between the columns you can use strsplit after loading the file. This might helpyou along getting data into R: http://www.statmethods.net/input/importingdata.html Best On Tue, 31 May 2016, 02:15 Val,

[R] Extract from a text file

2016-05-30 Thread Val
Hi all, I have a messy text file and from this text file I want extract some information here is the text file (out.txt). One record has tow lines. The mean comes in the first line and the SE of the mean is on the second line. Here is the sample of the data. Mean of weight group 1, SE of mean

Re: [R] email threads chronology

2016-05-30 Thread Jeff Newmiller
Mark, you can follow the bouncing emails by looking at the raw message headers. How you would access them depends on your email client, but "Received:" headers appear in reverse chronological order above the "From:" line, indicating the times when the email had reached various servers in its

Re: [R] Trimming time series to only include complete years

2016-05-30 Thread Jeff Newmiller
Sorry, I put too many bugs (opportunities for excellence!) in this on my first pass on this to leave it alone :-( isPartialWaterYear2 <- function( d ) { dtl <- as.POSIXlt( d ) wy1 <- cumsum( ( 9 == dtl$mon ) & ( 1 == dtl$mday ) ) # any 0 in wy1 corresponds to first partial water year

Re: [R] How to replace all commas with semicolon in a string

2016-05-30 Thread Jim Lemon
Hi Jun, As you do seem to want to replace commas within, not between, strings, try gsub: gsub(",",";",test[,1]) Jim > Dear list, > > Say I have a data frame > > test <- data.frame(C1=c('a,b,c,d'),C2=c('g,h,f')) > > I want to replace the commas with semicolons > > sub(',',';',test$C1) -> test$C1

Re: [R] email threads chronology

2016-05-30 Thread Jim Lemon
Hi Mark, As with most other annoying, time-consuming operations in the internet and computing in general, blame the spammers and the scammers. The R help list is attacked by both and requires both automatic and human scanning of messages to minimize intrusions. Unfortunately no one has come up

Re: [R] [FORGED] Re: email threads chronology

2016-05-30 Thread Rolf Turner
On 31/05/16 03:58, Bert Gunter wrote: On Mon, May 30, 2016 at 5:51 AM, Fowler, Mark wrote: ... "The preceding replies suggest this is something going on at my end, perhaps related to network security. I'm curious what might be causing it, and if there is something

Re: [R] sandwich package: HAC estimators

2016-05-30 Thread Leonardo Ferreira Fontenelle
Em Sáb 28 mai. 2016, às 15:50, Achim Zeileis escreveu: > On Sat, 28 May 2016, T.Riedle wrote: > > I thought it would be useful to incorporate the HAC consistent > > covariance matrix into the logistic regression directly and generate an > > output of coefficients and the corresponding standard

[R] Regression and Sub-Groups Analysis in Metafor

2016-05-30 Thread Dan Kolubinski
I am completing a meta-analysis on the effect of CBT on low self-esteem and I could use some help regarding the regression feature in metafor. Based on the studies that I am using for the analysis, I identified 4 potential moderators that I want to explore: - Some of the studies that I am using

Re: [R] matrix indexing/subset error

2016-05-30 Thread Jeff Newmiller
z %% 2 == 1 has 12 logical values. What do you expect R to do with it worth respect to 4 rows? -- Sent from my phone. Please excuse my brevity. On May 30, 2016 11:38:46 AM PDT, Carl Sutton via R-help wrote: >Hi Guru's >In my quest to understand R I have what I thought

Re: [R-es] Error en "optim" modelo APARCH sstd

2016-05-30 Thread Freddy Omar López Quintero
​Hola.​ 2016-05-25 13:06 GMT-04:00 Mª Ángeles Navarro : > Mi problema es que he ejecutado el modelo,con el mismo código, en > diferentes series (de mismo tamaño muestral) obteniendo resultados > adecuados, pero en concreto con una de las series me da el siguiente

[R] graphic device Windows tickmarks

2016-05-30 Thread Christian Brandstätter
Dear List, I discovered an issue; when plotting (base) in R, the tickmark-labels are slightly off (Windows machine). Thus, when saving the plot in R with x11() and dev(...) the plot-tickmarks shift, see the example below. Session Info: R version 3.2.3 (2015-12-10) Platform:

[R] matrix indexing/subset error

2016-05-30 Thread Carl Sutton via R-help
Hi Guru's In my quest to understand R I have what I thought was a simple exercise that now has me baffled.  Why the error message after running this code?  I am totally baffled by the error message.  I was expecting rows 1 and 3 of the x matrix to be returned, and have not a clue as to why this

Re: [R] How to replace all commas with semicolon in a string

2016-05-30 Thread Leonardo Ferreira Fontenelle
Em Sex 27 mai. 2016, às 12:10, Jun Shen escreveu: > Dear list, > > Say I have a data frame > > test <- data.frame(C1=c('a,b,c,d'),C2=c('g,h,f')) > > I want to replace the commas with semicolons > > sub(',',';',test$C1) -> test$C1 will only replace the first comma of a > string. > > How do I

Re: [R-es] sumar una variable con cast

2016-05-30 Thread Carlos Ortega
Hola, Hay varias formas de hacerlo, pero quizás la más sencilla, sea esta: datIn <- read.table("EJEMPLO.csv", header =T, sep = ",") sum_Evento <- aggregate(datIn$evento, by = list(tipo = datIn$TIPO, grupo = datIn$grupo), sum ) que produce esto: > aggregate(datIn$evento, by = list(tipo =

[R-es] sumar una variable con cast

2016-05-30 Thread Enrique RAMOS via R-help-es
buenas tardes les envío este mensaje de ayuda porque ya le batalle mucho y no he podido hacerlo lo que necesito, tengo una tabla como la que pongo en el archivo anexo ejemplo he estado utilizando la instrucción cast de reshape2 para generar algo como lo que sigue  | Suma de evento | Etiquetas

Re: [R] email threads chronology

2016-05-30 Thread Bert Gunter
Inline: 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 County" comic strip ) On Mon, May 30, 2016 at 5:51 AM, Fowler, Mark wrote: ... "The preceding

Re: [R-es] Codigo

2016-05-30 Thread Andres Hirigoyen
Pruebo y confirmo. MUCHAS GRACIAS A TODOS El 30 de mayo de 2016, 11:36, Bartolomé Marcos, José Antonio < josea.bartol...@mineco.es> escribió: > Sí llamamos DF al data.frame que tienes y DF$ID es la variable con los ID > de los lotes puede hacer con el código de que dispones lo

Re: [R-es] Codigo

2016-05-30 Thread Andres Hirigoyen
Carlos, capaz no me explique bien, va de nuevo... Tengo un dataFrame con varias variables que describen Lotes (127), he creado un código que calcula nuevas variables, re codifica otras y ordenas otras tantas. Es muy laborioso correr ese código 127 veces por lo cual quería hacer un sentencia (del

Re: [R-es] Codigo

2016-05-30 Thread Fernando Macedo
Hola, yo en general uso una opción más desprolija y que puede ser menos efectiva pero si la cantidad de lotes no es excesiva no sería extremadamente lenta. Uso for() en general usando los datos de id de los animales, lotes u lo que sea. # inicializo una variable para almacenar resultados

Re: [R-es] Codigo

2016-05-30 Thread Carlos Ortega
Hola, Puedes utilizar el código de Oliver utilizando la librería "broom" que permite obtener los parámetros (coeficientes) y características del modelo (null.deviance, AIC, BIC) en un cómodo data.frame El código sería algo así como esto. library(broom) L <- list(L1, L2..., L120) ajuste <-

Re: [R-es] Codigo

2016-05-30 Thread Olivier Nuñez
Mira lapply Si L= list(L1,L2,...,L120) es una lista de tus lotes ajuste <- function(L) glm(y~x,data=L) fit=lapply(L1,ajuste) donde "fit" es la lista de 120 ajustes. Un saludo. Olivier - Mensaje original - De: "Andres Hirigoyen" Para:

[R] email threads chronology

2016-05-30 Thread Fowler, Mark
Hi all, I'm seeing the natural sequencing of email threads getting corrupted. For example, a May 26 thread on subject 'Shaded areas in R' would have been initiated by an email at 6:58am. However I did not get that email until 1:48pm, preceded by 3 replies to the post. Trivial but irritating.

Re: [R] model specification using lme

2016-05-30 Thread Thierry Onkelinx
Dear Hanna, None of the models are correct is you want the same random intercept for the different methods but different random slope per method. You can random = ~ 1 + time:method | individual The easiest way to get alpha_0 and tau_i is to apply post-hoc contrasts. That is fairly easy to do

Re: [R] colored table

2016-05-30 Thread Tal Galili
Hell Naresh, If to add to what others already wrote, there is also the new {heatmaply } package, which enable you to create *interactive* heatmaps. For examples, you can view the vignette here: