[R] To compare and filter text (mining data)

2016-05-11 Thread Marcelo Laia
Hi, I have a experiment like this: Trat Rep Peak CAS 11 1123-92-2 11 2109-21-7 11 32867-05-2 11 ... ... 11 33 99-86-5 12 1562-74-3 12 2123-92-2 12 3109-21-7 12 ... ... 12 45 2867-05-2 ... 14 3 18

[R-es] Aplicar una función repetidamente

2016-05-11 Thread Jorge I Velez
Hola a todos, Quisiera aplicar una función f(x) un total de k veces de manera recursiva. En pseudo código sería algo como Si k = 1, calcular f(x); Si k = 2, calcular f(f(x)); Si k = 3, calcular f(f(f(x))). Al final me gustaria tener una función g cuyos argumentos sean x y el valor de k. Así,

Re: [R] R simulation help pls

2016-05-11 Thread Michael Friendly
On 4/06/16 11:54 AM, tan sj wrote: Hi, i am student from malaysia, i am new in r programming field, now i am trying to conduct a robustness study on 2 sample test under several combination of factors such as sample sizes ,standard deviation ratio and also distribution.. but now i am

[R] R_DirtyImage and Rprof

2016-05-11 Thread Benjamin Tyner
Hello, I have some code which was running in interactive mode while Rprof(..., line.profiling = TRUE). Near the end of my script, it opens up a pipe(..., open = "w") to a perl script, and at that point the execution gets stuck using 100% cpu. (The perl script itself never showed up in

Re: [R] physical constraint with gam

2016-05-11 Thread Dominik Schneider
Hi again, I'm looking for some clarification on 2 things. 1. On that last note, I realize that s(x1,x2) would be the other obvious interaction to compare with - and I see that you recommend te(x1,x2) if they are not on the same scale. 2. If s(x1,by=x1) gives you a "parameter" value similar to a

Re: [R] break string at specified possitions

2016-05-11 Thread Daniel Nordlund
On 5/11/2016 2:23 PM, Jan Kacaba wrote: Here is my attempt at function which computes margins from positions. require("stringr") require("dplyr") ends<-seq(10,100,8) # end margins test_string<-"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam in lorem sit amet leo accumsan

Re: [R] break string at specified possitions

2016-05-11 Thread Jim Lemon
Hi again, Sorry, that should be: chop_string<-function(x,ends) { starts<-c(1,ends[-length(ends)]+1) return(substring(x,starts,ends)) } Jim On Thu, May 12, 2016 at 10:05 AM, Jim Lemon wrote: > Hi Jan, > This might be helpful: > > chop_string<-function(x,ends) { >

Re: [R] break string at specified possitions

2016-05-11 Thread Jim Lemon
Hi Jan, This might be helpful: chop_string<-function(x,ends) { starts<-c(1,ends[-length(ends)]-1) return(substring(x,starts,ends)) } Jim On Thu, May 12, 2016 at 7:23 AM, Jan Kacaba wrote: > Here is my attempt at function which computes margins from positions. > >

Re: [R] break string at specified possitions

2016-05-11 Thread Jan Kacaba
Here is my attempt at function which computes margins from positions. require("stringr") require("dplyr") ends<-seq(10,100,8) # end margins test_string<-"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam in lorem sit amet leo accumsan lacinia." sekoj=function(ends){

Re: [R] break string at specified possitions

2016-05-11 Thread Bert Gunter
Dunno -- but you might have a look at Hadley Wickham's 'stringr' package: https://cran.r-project.org/web/packages/stringr/stringr.pdf 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

[R] break string at specified possitions

2016-05-11 Thread Jan Kacaba
Dear R-help I would like to split long string at specified precomputed positions. 'substring' needs beginings and ends. Is there a native function which accepts positions so I don't have to count second argument? For example I have vector of possitions pos<-c(5,10,19). Substring needs input

Re: [R] Antwort: Re: Antwort: Re: Re: sink(): Cannot open file

2016-05-11 Thread Henrik Bengtsson
Sounds like it would be helpful to find out exactly which process is holding on to the file in order to figure out what's going on. From a quick look, it seems that http://superuser.com/questions/117902/find-out-which-process-is-locking-a-file-or-folder-in-windows gives some useful info on

Re: [R] web scraping tables generated in multiple server pages

2016-05-11 Thread boB Rudis
I upgraded ffox to the 46-series and intermittently received the same error. But by adding a `Sys.sleep(1)` to the final `if`: if ((i %% 10) == 0) { ref <- remDr$findElements("xpath", ".//a[.='...']") ref[[length(ref)]]$clickElement() Sys.sleep(1) } I was able to reproduce my

Re: [R] web scraping tables generated in multiple server pages

2016-05-11 Thread boB Rudis
Hey David, I'm on a Mac as well but have never had to tweak anything to get [R]Selenium to work (but this is one reason I try to avoid solutions involving RSelenium as they are pretty fragile IMO). The site itself has "Página 1 de 69" at the top which is where i got the "69" from and I just

Re: [R] web scraping tables generated in multiple server pages

2016-05-11 Thread David Winsemius
> On May 10, 2016, at 1:11 PM, boB Rudis wrote: > > Unfortunately, it's a wretched, vile, SharePoint-based site. That > means it doesn't use traditional encoding methods to do the pagination > and one of the only ways to do this effectively is going to be to use > RSelenium: >

Re: [R] physical constraint with gam

2016-05-11 Thread Dominik Schneider
Hi Simon, Thanks for this explanation. To make sure I understand, another way of explaining the y axis in my original example is that it is the contribution to snowdepth relative to the other variables (the example only had fsca, but my actual case has a couple others). i.e. a negative s(fsca) of

[R] Antwort: Re: Antwort: Re: Re: sink(): Cannot open file

2016-05-11 Thread G . Maubach
Duncan, thanks for the hint. I have done it correctly in R fashion ## capture all the output to a file. zz <- file("C:/Temp/all.Rout", open = "wt") sink(zz) sink(zz, type = "message") try(log("a")) ## back to the console sink(type = "message") sink() unlink("C:/Temp/all.Rout") But the error

[R] Antwort: Re: Re: Antwort: Re: Re: sink(): Cannot open file

2016-05-11 Thread G . Maubach
Hi Sarah, yes, I followed your suggestion. If I do exactly what is in the example of the documentation: sink("C:/Temp/sink-examp.txt") i <- 1:10 outer(i, i, "*") sink() unlink("C:/Temp/sink-examp.txt") it does not write anything, i. e. no file is created in "C:/Temp/". The script is executed

Re: [R] Quantiles on multiply imputed survey data - mitools

2016-05-11 Thread Anne Bichteler
Thanks so SO much. Brennan www.toxstrategies.com From: Anthony Damico Date: Wednesday, May 11, 2016 at 11:17 AM To: Anne Bichteler Cc: "r-help@r-project.org" Subject: Re: [R] Quantiles on multiply imputed survey

Re: [R] Quantiles on multiply imputed survey data - mitools

2016-05-11 Thread Anthony Damico
hi, you want se=T M_quantile <- with(des_mult, svyquantile(make.formula(get('var_name')), quantiles = c(.5),se=T)) MIcombine(M_quantile) Multiple imputation results: with(des_mult, svyquantile(make.formula(get("var_name")), quantiles = c(0.5), se = T))

Re: [R] Quantiles on multiply imputed survey data - mitools

2016-05-11 Thread Anne Bichteler
Thanks for looking. No, for the quantiles it fails to instantiate the collection of designs correctly, whether hard-coding the variable name or using make.formula. 'with' passes make.formula correctly when calculating the mean, e.g. this works: MIcombine( with(des,

Re: [R] how to manipulate ... in the argument list

2016-05-11 Thread Vito M. R. Muggeo
Hi Witold, use do.call() list.args<-list(...) #modify 'list.args' (add/delete/modify) do.call(image, list.args) best, vito Il 11/05/2016 10.45, Witold E Wolski ha scritto: Hi, I am looking for a documentation describing how to manipulate the "..." . Searching R-intro.html gives to many

Re: [R] factor variables in logistic regression

2016-05-11 Thread Kevin E. Thorpe
On 05/11/2016 08:00 AM, ch.elahe via R-help wrote: Hi all, I have a plot for TSTMean vs. SNRMean and both of these variables are factors. How can I use Logistic Regression for factor variables? Currently I use model=lm(TSTMean~SNRMean,data=df) but when I check summary(model) I get this error:

Re: [R] web scraping tables generated in multiple server pages / Best of R-help

2016-05-11 Thread Michael Friendly
On 5/10/2016 4:11 PM, boB Rudis wrote: > Unfortunately, it's a wretched, vile, SharePoint-based site. That > means it doesn't use traditional encoding methods to do the pagination > and one of the only ways to do this effectively is going to be to use > RSelenium: > R-help is not stack exchange,

[R-es] [Grupo de Usuarios de R de Madrid]: Siguiente reunión mañana jueves 12-mayo...

2016-05-11 Thread Carlos Ortega
Hola, Por si os interesa asistir y podéis asistir: http://madrid.r-es.org/35-jueves-12-de-mayo-2016/ Gracias, Carlos Ortega www.qualityexcellence.es [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org

[R] factor variables in logistic regression

2016-05-11 Thread ch.elahe via R-help
Hi all, I have a plot for TSTMean vs. SNRMean and both of these variables are factors. How can I use Logistic Regression for factor variables? Currently I use model=lm(TSTMean~SNRMean,data=df) but when I check summary(model) I get this error: r error in quartile.default (resid) factors are not

Re: [R] Ensure parameter is a string when passed within an lapply & called function runs a 'substitute' on it

2016-05-11 Thread Andrew Clancy
Thanks David - my earlier response to Bert contains the resolution. partialPlot was commented out deliberately as it was the target function who's behaviour I was replicating in testFunc. The original behaviour, ie. printing 'X1' was correct, and the do.call fix yields this same response when

Re: [R] how to manipulate ... in the argument list

2016-05-11 Thread Duncan Murdoch
On 11/05/2016 4:45 AM, Witold E Wolski wrote: Hi, I am looking for a documentation describing how to manipulate the "..." . Searching R-intro.html gives to many not relevant hits for "..." What I want to do is something like this : image.2 <- function(x, col , ...){ # function is

Re: [R] Creating data frame of predicted and actual values in R for plotting

2016-05-11 Thread Muhammad Bilal
I have achieved this use case by writing the following commands: all_predictions <- data.frame(pid = testPFI$project_id, actual_delay = testPFI$project_delay,lm_pred, tree_pred, best_tree_pred, rf_pred) str(all_predictions) all_pred <- sqldf("SELECT pid, actual_delay, ROUND(lm_pred,2) lm_pred,

Re: [R] how to manipulate ... in the argument list

2016-05-11 Thread Jim Lemon
Hi Witold, You could try Ben Bolker's "clean.args" function in the plotrix package. Jim On Wed, May 11, 2016 at 6:45 PM, Witold E Wolski wrote: > Hi, > > I am looking for a documentation describing how to manipulate the > "..." . Searching R-intro.html gives to many not

Re: [R] physical constraint with gam

2016-05-11 Thread Simon Wood
The spline having a positive value is not the same as a glm coefficient having a positive value. When you plot a smooth, say s(x), that is equivalent to plotting the line 'beta * x' in a GLM. It is not equivalent to plotting 'beta'. The smooths in a gam are (usually) subject to `sum-to-zero'

Re: [R-es] Diccionario de Palabras en Inglés para identificar el tipo de palabra (verbo, adjetivo, etc)

2016-05-11 Thread Carlos Ortega
Hola, En la anterior reunión del "Grupo de Usuarios de R de Madrid", Miguel Ángel Gómez hizo una presentación sobre análisis de sentimiento en noticias financieras y dio varias referencias de lo que buscas, además de que su código lo compartió. El detalle lo puedes ver aquí:

Re: [R-es] Tablas - resultados - stargazer

2016-05-11 Thread rubenfcasal
Tiene buenas pintas... Yo tengo un paquete casero para generar y mostrar resultados de estudios de simulación (en formato html) y esto parece que me puede ir bien. Gracias por la información. Un saludo, Rubén. El 10/05/2016 a las 22:13, Javier Marcuzzi escribió: En LinkedIn aparece esto

[R] how to manipulate ... in the argument list

2016-05-11 Thread Witold E Wolski
Hi, I am looking for a documentation describing how to manipulate the "..." . Searching R-intro.html gives to many not relevant hits for "..." What I want to do is something like this : image.2 <- function(x, col , ...){ # function is manipulating colors (adding a few) # since it changes

Re: [R] physical constraint with gam

2016-05-11 Thread David Winsemius
> On May 10, 2016, at 5:30 PM, Dominik Schneider > wrote: > > Hi, > Just getting into using GAM using the mgcv package. I've generated some > models and extracted the splines for each of the variables and started > visualizing them. I'm noticing that one of my

Re: [R] Ensure parameter is a string when passed within an lapply & called function runs a 'substitute' on it

2016-05-11 Thread David Winsemius
> On May 9, 2016, at 2:39 PM, Andrew Clancy wrote: > > Hi, > > I’m trying to solve what looks like the same issue as stack overflow article, > but within an lapply: > http://stackoverflow.com/questions/18939254/cant-use-a-variable-as-an-argument-but-can-use-its-value It

[R] physical constraint with gam

2016-05-11 Thread Dominik Schneider
Hi, Just getting into using GAM using the mgcv package. I've generated some models and extracted the splines for each of the variables and started visualizing them. I'm noticing that one of my variables is physically unrealistic. In the example below, my interpretation of the following plot is