Re: [R] substring simultaneous conditions

2016-09-05 Thread Ulrik Stervbo
Dear Rosa, you can use grep for pattern matching along the lines of: x <- c("00071101", "0007", "00071112","123456789123") grep("^[0-9]{2}07[0-9]{6}(01|11)", x) Here I assume that your real IDs consist of integers only. The pattern matches two integers followed by 07 followed

[R] sim() not working in example given in lava() documentation - please help.

2016-09-05 Thread John Hillier
Dear All, I am trying to simulate using a statistical model created in the lava() package. My model gave the error message "Error in rep(0, ncol(fx)) : invalid 'times' argument". So, I used the example in the documentation for the lava() package - v1.4.4, on page 79; this is copied below with

Re: [R] sim() not working in example given in lava() documentation - please help.

2016-09-05 Thread PIKAL Petr
Hi I do not know anything about lava, however this m <- lvm(y~x+z) regression(m) <- x~z distribution(m,~y+z) <- binomial.lvm("logit") d <- sim(m,1e3) head(d) y x z 1 1 1.0033540 1 2 0 0.3834120 0 3 1 -0.3737790 1 4 1 -1.2927288 0 5 0 -0.4242461 1 6 0 -1.8349548 0 > gives me some

Re: [R] conditional gap time frailty cox model for recurrent events

2016-09-05 Thread Göran Broström
Dear Elisabetta, I have no direct answer to your question, but a suggestion: Use the 'coxme' function (in the package with the same name). In the help page for 'frailty' (survival) you will find: "The coxme package has superseded this method. It is faster, more stable, and more flexible."

[R] substring simultaneous conditions

2016-09-05 Thread Rosa Oliveira
Dear all, I have searched all over and didn´t found an answer :( Sorry, I'm new. I need urgently to "not analyse"the weight the ID's that have 07 in the position 3 and 4 respectively, 01 or 11 in positions 11 and 12 of ID variable. . I used the following code:

[R] Fwd: Splines

2016-09-05 Thread Filippo Monari
Hi, does anybody know what header file includes the bspline functions used in R? Regards, Filippo Forwarded Message Subject:Splines Date: Sun, 04 Sep 2016 09:12:37 +0100 From: Filippo Monari To: R-help@r-project.org Hi, I would like to

[R] conditional gap time frailty cox model for recurrent events

2016-09-05 Thread Elisabetta Petracci
Dear users, I am fitting a conditional gap time frailty cox model weighting observations by means of inverse probability time dependent weigths. Attached find the self-explaining dataset. I have used the following sintax:

Re: [R] substring simultaneous conditions

2016-09-05 Thread ruipbarradas
Hello, Try placing the & immediately after the substr() conditions, like this: base <- baseR[substr(baseR[['ID']],3,4)!='03' & substr(baseR[['ID']],11,12)!='01' & substr(baseR[['ID']],11,12)!='11',] Maybe I'm wrong but R might have decided that

Re: [R] evaluating expressions as R console

2016-09-05 Thread Adrian Dușa
On Mon, Sep 5, 2016 at 5:33 PM, Bert Gunter wrote: > > I'm sharing this with r-help, as your detailed response might help > others help you. Oh, my bad (thought I had replied to all). I wanted to add anyways the intended result seems to be possible. If pasting the code

Re: [R] element wise pattern recognition and string substitution

2016-09-05 Thread Bert Gunter
Jun: You need to provide a clear specification via regular expressions of the patterns you wish to match -- at least for me to decipher it. Others may be smarter than I, though... Jeff: Thanks. I have now convinced myself that it can be done (a "proof" of sorts): If pat1, pat2,..., patn are m

Re: [R] element wise pattern recognition and string substitution

2016-09-05 Thread Bert Gunter
Jeff: It is not obvious to me that the ability to *match* an arbitrary pattern (including one of several different ones via "|" , per the link you included) implies that sub() and friends can extract it, e.g. via the /N construct or otherwise. I would appreciate it if you or someone else could

Re: [R] element wise pattern recognition and string substitution

2016-09-05 Thread Jeff Newmiller
Yes, sorry I did not look closer... regex can match any finite language, so there are no data sets you can feed to R that cannot be matched. [1] You may find it hard to see the pattern, or you may want to build the pattern programmatically to alleviate tedium for yourself, but regexes are not

Re: [R] element wise pattern recognition and string substitution

2016-09-05 Thread Jeff Newmiller
I am not the one who proved this... I can only respond to your suggested counterexamples. -- Sent from my phone. Please excuse my brevity. On September 5, 2016 9:01:12 AM PDT, Bert Gunter wrote: >Jeff: > >It is not obvious to me that the ability to *match* an arbitrary

Re: [R] element wise pattern recognition and string substitution

2016-09-05 Thread Jun Shen
Thanks for the reply, Bert. Your solution solves the example. I actually have a more general situation where I have this dot concatenated string from multiple variables. The problem is those variables may have values with dots in there. The number of dots are not consistent for all values of a

Re: [R] Error in reading subset of data from CSV file

2016-09-05 Thread David L Carlson
Try changing the separator to ; # write.table() instead of write.csv() > write.table(Dat, "Dat.csv", quote = FALSE, sep=";", row.names = FALSE) > readLines("Dat.csv") [1] "col 1;col 2;col 3;col 4;col 5;col 6" [2] "133261;aaa1;10.59;10.59;10.59;04-Jul-16" [3]

[R] Antw: Re: robumeta package - error

2016-09-05 Thread Kristina Loderer
Dear Michael, thank you for your reply! I managed to solve the problem in the meantime, there was an issue in the effect size conversion (correlations to Fisher's z) that lead to zero values for some effect size variances. Regards, Kristina - Kristina

Re: [R] Fwd: Splines

2016-09-05 Thread Jeff Newmiller
This is not the kind of thing people know off the top of their heads, and even if they do it is an ideal application of text search tools. Download the source and start looking. Don't neglect the licencing terms... your use of that code implies responsibilities on your part. -- Sent from my

Re: [R] sim() not working in example given in lava() documentation - please help.

2016-09-05 Thread John Hillier
Thank you very much Petr! An external check like you did really helps. After shutting down, I've started new session and project in a different directory and it's working. I will know next time that with R a full "turn it off and turn it on again" can make a difference even when I can't see

[R] Fwd: problem writing .bil files in netcdf

2016-09-05 Thread Abdoulaye Sarr
-- Forwarded message -- From: Abdoulaye SARR Date: Mon, Jan 1, 2001 at 4:02 AM Subject: Re: [R] problem writing .bil files in netcdf To: Michael Sumner Cc: r-help@r-project.org Hi Michael, I had a problem with my mac hopefully solve

Re: [R] outliers in Box Plot

2016-09-05 Thread Jim Lemon
Hi Rosa, Your data never seem to get through. Nevertheless, here is a suggestion: rodat<-data.frame(id=1:20,age=sample(c("10-20","21-30","31-40"),20,TRUE), weight=c(sample(40:70,18),110,120)) robp<-boxplot(weight~age,rodat) rodat$id[which(rodat$weight %in% robp$out)] Jim On Mon, Sep 5, 2016

Re: [R] evaluating expressions as R console

2016-09-05 Thread Bert Gunter
I'm sharing this with r-help, as your detailed response might help others help you. -- 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 County" comic strip ) On Sun, Sep 4, 2016 at

[R] outliers in Box Plot

2016-09-05 Thread Rosa Oliveira
Dear all, I have searched all over and didn´t found an answer :( I need urgently to "extract" de identification of the weight outliers of the participants of a study. So, I have a data base with several variables: id weight are 2 off them. So, I've done a boxplot and found the weight have

[R] Seasonal package: "Error in x[[2]] : subscript out of bounds"

2016-09-05 Thread Juan Ceccarelli Arias
Hi Im running X13 with the seasonal package. However, in some series i get this error after specifying the x11 options: o_1=ts(o1,frequency=12,start=c(2010,2)) so_1=seas(o_1, x11="",transform.function ="log",arima.model="([3] 1 1)(1 1 0)", x11.seasonalma="S3x5",x11.trendma=13) Error in x[[2]] :

Re: [R] Error in reading subset of data from CSV file

2016-09-05 Thread Florian Schwendinger
There are several issues, 1. I think ReadName = '133261' read.csv.sql("Dat.csv", sql = "select * from file where 'col 1' = ReadName") should be replaced by something like this ReadName = '133261' sql_cmd <- sprintf("select * from file where col_1='%s'", ReadName) sql_cmd

[R] how to transform db query result into a set of timeseries ?

2016-09-05 Thread Stef Mientki
hello, I've a number of timeseries into a database and want to display these timeseries into graph. Now the code below works well, but as the user can select which timeseries should be shown (up to 20 timeseries) the code below should be dynamic and can be quiet large and complex. Is

Re: [R] evaluating expressions as R console

2016-09-05 Thread Adrian Dușa
I think I have found a working solution. Rather ugly, but working and will keep looking for better alternatives, though. The procedure involves: - parsing one line at a time - if incomplete, parse as many lines as necessary to form an expression - determine all expressions in the original input

[R] Help with a code in R

2016-09-05 Thread Erika Rocío Espinosa Balbuena
Hi, I am working with this code: forecast_nal<-data.frame() out<-vector() x<-foreach(i=1:nrow(comb)) %do% { s<-comb[i,'prod_id'] #Familia+Sumbarca+prod_id #Serie bcomb1<-b bcomb1<-subset(bcomb1,bcomb1$prod_id == s & bcomb1$year <= 2015) bcomb1<-arrange(bcomb1,year,week) a<-bcomb1[1:1,'week']

Re: [R] Help with a code in R

2016-09-05 Thread Mark Sharp
Erika, You have failed to supply reproducible code. I do not all that is missing, but a glance shows that you did not include the code to load the foreach package or a definition of the objects named comb and b. It is very likely you will receive assistance if you can follow the posting guide

Re: [R] sim() not working in example given in lava() documentation - please help.

2016-09-05 Thread PIKAL Petr
Hi First I thought that it could be due to variables which can be defined in your workspace however I had also x and y defined and did not experience error. I tried with the code with m, z, logit and lvm silly defined as variables but I did not experience any error too. So I have no clue how

Re: [R-es] Tests of all canonical RDA axes

2016-09-05 Thread Carlos Ortega
​Hola, El mensaje de error ​"model must be fitted with formula interface" te está indicando que el objeto "*ssp.rda.hel*" no lo construiste de acuerdo a una fórmula. En la ayuda de la función (entiendo que es el paquete "vegan") aparece un ejemplo en el que el modelo se ha construido con una

[R-es] Tests of all canonical RDA axes

2016-09-05 Thread LAE
Estimados, Buenas Tardes, Estoy teniendo problema para testar la significancia de los ejes del RDA. NO se cual seria el error. Alguien me podría ayudar? Desde ya muchas gracias. Saludos, Luis # Tests of all canonical axes anova.cca(ssp.rda.hel, by="axis", step=1000)#Para saber la

Re: [R-es] R SE QUEDA PEGADO e imposibilitado de trabajar.

2016-09-05 Thread Javier Valdes Cantallopts (DGA)
Estimados: Tengo problemas con mi programa R. Cada vez que dejo stand-by mi compu por unos minutos, R se queda pegado, e imposibilitado de trabajar, lo que me obliga a cerrarlo y volver a abrirlo cada vez que sucede. De: Carlos Ortega [mailto:c...@qualityexcellence.es] Enviado el: miércoles, 31

Re: [R-es] R SE QUEDA PEGADO e imposibilitado de trabajar.

2016-09-05 Thread Carlos Ortega
Hola, Más preguntas: - Versión de RStudio - Versión de R. - Cuando te ocurre esto con un plot, ¿ tu script ha generado otros muchos plots previamente?. A veces RStudio no gestiona bien numerosos plots generados de forma consecutiva. - Cuando dices que el plot se deforma, es que

Re: [R-es] Pivot tables con data.table

2016-09-05 Thread javier.ruben.marcuzzi
Estimados Hay un artículo con un ejemplo en https://blog.exploratory.io/summarizing-data-quickly-like-pivoting-a9ed9c81d495#.asld1e68f Javier Rubén Marcuzzi De: Carlos Ortega [[alternative HTML version deleted]] ___ R-help-es mailing list

Re: [R-es] R SE QUEDA PEGADO e imposibilitado de trabajar.

2016-09-05 Thread javier.ruben.marcuzzi
Estimado Javier Valdes Cantallopts Le propongo una prueba, correr todo pero presione control + alt + delete, para ver los recursos que va utilizando, puede ser que el CPU o memoria tengan un problema, si los recursos no llegan al 100% (un rato no hay problema) efectivamente el problema no es

Re: [R-es] R SE QUEDA PEGADO e imposibilitado de trabajar.

2016-09-05 Thread Carlos Ortega
Hola, Das demasiada poca información para poder ayudarte de alguna manera.. Algunas preguntas a las que si tienes respuesta podrías haberlas aportado: - Cuando te ocurre esto, ¿tienes R ejecutándose con algún script?. - Si el problema es recurrente, has llegado a abrir algún gestor de

Re: [R-es] R SE QUEDA PEGADO e imposibilitado de trabajar.

2016-09-05 Thread Javier Valdes Cantallopts (DGA)
Hola Carlos: -Mira, mi máquina es nueva, con 16 giga de memoria Ram, así que no creo que sea problema de recursos -En general me pasa esto cuando despliego un Plot. (Después que me paro y vuelvo a mi escritorio, pasado 15 min) el plot se deforma en la pantalla y después al eliminarlo se queda