[R] on execution time of a function...

2018-06-12 Thread akshay kulkarni
I ran a function in R three days ago and the execution time was about 4 minutes. I ran the same function yesterday and the execution time was more than 6:50 minutes(I aborted the function after that time). I read in the Internet that this is possible. I also came to know that software or hardw

[R] Calling r-scripts with arguments from other scripts, or possibly R programming conventions/style guide

2018-06-12 Thread Sam Tuck
Hi All, I am new to R and am wondering if there is a way to pass arguments between rscripts. I have this working but have had to create a C# shell calling the scripts in sequence via windows scripting which enables command line arguments to get the necessary interaction. I'm wonder

Re: [R] Help installing the finalfit package

2018-06-12 Thread David Winsemius
> On Jun 12, 2018, at 5:00 AM, Bill Poling wrote: > > Good morning. Over the weekend I worked through this tutorial on bloggers.com > at home where I am on 3.5.5: > > #Elegant regression results tables and plots in R: the finalfit package > > https://www.r-bloggers.com/elegant-regression-res

Re: [R] Changing selected columns to factor

2018-06-12 Thread Jeff Reichman
Well that’s easy enough - thank you -Original Message- From: Jim Lemon Sent: Monday, June 11, 2018 11:50 PM To: Jeff Reichman Cc: r-help mailing list Subject: Re: [R] Changing selected columns to factor Hi Jeff, jrdf<-data.frame(A=rnorm(10),B=rnorm(10),C=rnorm(10), D=rnorm(10),E=rno

Re: [R] R 3.5.0, vector memory exhausted error on readBin

2018-06-12 Thread luke-tierney
On Tue, 12 Jun 2018, Valerie Cavett wrote: Ah - I see the problem - thanks so much for the clarification! Just in case anyone else is using Rstudio on a mac and runs into this issue, I ended up following the instructions from http://btibert3.github.io/2015/12/08/Environment-Variables-in-Rstudi

Re: [R] R 3.5.0, vector memory exhausted error on readBin

2018-06-12 Thread Valerie Cavett
Ah - I see the problem - thanks so much for the clarification! Just in case anyone else is using Rstudio on a mac and runs into this issue, I ended up following the instructions from http://btibert3.github.io/2015/12/08/Environment-Variables-in-Rstudio-on-Mac.html to add the following line to th

Re: [R] extract and re-arrange components of data frame

2018-06-12 Thread Massimo Bressan
thank you for your reply well, you are resorting to a supposed order of i which is not necessary the case, and in fact is not in mine... consider this example, please d<-data.frame(i=c(8,12,3), s=c('97,918,19','103,1205', '418'), stringsAsFactors = FALSE) d Da: "Bert Gunter" A: "Massi

Re: [R] extract and re-arrange components of data frame

2018-06-12 Thread S Ellison
> #I need to get this final result > r<-data.frame(i=c(1,1,1,2,2,3), s=c(97, 98, 99, 103, 105, 118)) Nothing magic to suggest. But maybe: list.s <- strsplit(d$s,",") r <- data.frame(i=rep(d$i, times=sapply(list.s, length)), s=unlist(list.s), stringsAsFactors=FALSE ) S Ellison **

Re: [R] extract and re-arrange components of data frame

2018-06-12 Thread Bert Gunter
You mean like this? > s.new <-with(d, as.numeric(unlist(strsplit(s,"," > s.new <- cut(s.new,breaks = c(0,100,110,200),lab = d$i) > s.new [1] 1 1 1 2 2 3 Levels: 1 2 3 (Obviously, this could be a one-liner) See ?cut Cheers, Bert Bert Gunter "The trouble with having an open mind is th

Re: [R] R 3.5.0, vector memory exhausted error on readBin

2018-06-12 Thread luke-tierney
The environment variable R_MAX_VSIZE is read at start-up so need to be set outside R. If you are starting R from a shell you can use env R_MAX_VSIZE=700Gb R If you use a GUI you might need to set the variable in another way. Here is a reproducible version of your example: hertz <- 6000

[R] extract and re-arrange components of data frame

2018-06-12 Thread Massimo Bressan
# considering this data.frame as a reproducible example d<-data.frame(i=c(1,2,3), s=c('97,98,99','103,105', '118'), stringsAsFactors = FALSE) d #I need to get this final result r<-data.frame(i=c(1,1,1,2,2,3), s=c(97, 98, 99, 103, 105, 118)) r #this is my attempt #number of components for

Re: [R] R 3.5.0, vector memory exhausted error on readBin

2018-06-12 Thread Valerie Cavett
Thanks so much for taking a look at this. 
 Before setting a new value, I opened a fresh session of R and checked to see whether there was any value set for R_MAX_VSIZE. There was not, so we'll assume the default as you described. 
 Next, I tried to set a value with Sys.setenv("R_MAX_VSIZE" = 8e9

[R] Help installing the finalfit package

2018-06-12 Thread Bill Poling
Good morning. Over the weekend I worked through this tutorial on bloggers.com at home where I am on 3.5.5: #Elegant regression results tables and plots in R: the finalfit package https://www.r-bloggers.com/elegant-regression-results-tables-and-plots-in-r-the-finalfit-package/ Here at my office

Re: [R] R 3.5.0, vector memory exhausted error on readBin

2018-06-12 Thread luke-tierney
This item in NEWS explains the change: • The environment variable R_MAX_VSIZE can now be used to specify the maximal vector heap size. On macOS, unless specified by this environment variable, the maximal vector heap size is set to the maximum of 16GB and the available physic