Read a large (1.5 GB) file in h2o R

I am using h2o package for modelling in R. For this I want to read a dataset which has a size of about 1.5 GB using h2o.importfile(). I start the h2o server using the lines library(h2oEnsemble) h2o.init(max_mem_size = '1499m',nthreads=-1) This pro...
more »

2017-06-18 22:06 (2) Answers

How to build libRmath.dylib on Mac

I am a Mac user. I am trying to install libRmath.dylib, the standalone Rmath library from R. I found that R does not compile libRmath by default. So I tried to compile the Rmath library from source. But I can only find .tar file for Windows/Unix on C...
more »

2017-06-17 20:06 (0) Answers

R POSIXct returns NA with "03/12/2017 02:17:13"

I have a data set containing the following date, along with several others 03/12/2017 02:17:13 I want to put the whole data set into a data table, so I used read_csv and to create DT which contained the date/time information in date....
more »

2017-06-17 18:06 (2) Answers

Write a for loop in a function to get a matrix

I need to put delta.vec and sigma.vec values through my required.replicates function and store them in my practice1 matrix. But I get NULL. sigma.vec <- c(2,4,6,8,10,12) delta.vec <- c(1,2,5,8,10) practice1 <- matrix(0, nrow=length(delta...
more »

2017-06-17 14:06 (1) Answers

Sort list of strings by order of numeric parts

I have a list of paths of files, which I want to sort in ascending order based on the first path of each list. The list of paths is show $`HG-U133_Plus_2` [1] "C:\\Users\\agaz\\AppData\\Local\\Temp\\Rtmp0wZI21/008947515435900b4d1a0b8d/22" [2] "C:\\U...
more »

2017-06-17 13:06 (2) Answers

How to get week ending next Sunday from date

I know lubridate has a function ceiling_date but it provides week ending on the next Saturday from a given date. How can I change it to get the week ending next Sunday instead? > ceiling_date(as.Date('2017-06-16'), 'week') [1] "2017-06-17 20:00:0...
more »

2017-06-16 19:06 (1) Answers

removing the central white circle?

I have a circular plot and I would like to find a way to remove the little white circle in the middle. Here is my code: ggplot(d5)+geom_tile(aes(x=x, y=y, fill=CNP))+ scale_y_continuous(expand=c(0,0),breaks=NULL,limits=c(0,3.6))+ scale_fill_...
more »

2017-06-16 17:06 (2) Answers

julia: outer product function

In R, the function outer structurally allows you to take the outer product of two vectors x and y while providing a number of options for the actual function applied to each combination. For example outer(x,y,'-') creates an "outer product" matrix of...
more »

2017-06-16 16:06 (1) Answers

Is the regex \\L supported in R 3.5.0?

I am experiencing difficulty with the perl expression \\L\\1 in very particular circumstances on R-dev (2017-06-06 and 2017-06-16 r72796 builds): bib <- readLines("
more »

2017-06-16 16:06 (1) Answers

Group to Group division

Data Set: date bal 1/31/2013 10 1/31/2013 11 1/31/2013 12 1/31/2013 13 1/31/2013 14 2/28/2013 20 2/28/2013 30 2/28/2013 40 2/28/2013 50 2/28/2013 60 3/30/2013 10 3/30/2013 11 3/30/2013 12 ...
more »

2017-06-16 16:06 (2) Answers

Spaghetti plot in R with repeated measurements

I would like to realize a spaghetti plot in R to visualize differences between two conditions for every single participant. I computed a repeated measurements ANOVA with the factors CRITICALITY (critical, non-critical) and LATERALITY (ipsilateral, co...
more »

2017-06-16 11:06 (2) Answers

Concatenating two vectors in R

I want to concatenate two vectors one after the other in R. I have written the following code to do it: > a = head(tracks_listened_train) > b = head(tracks_listened_test) > a [1] cc1a46ee0446538ecf6b65db01c30cd8 19acf9a5cbed34743ce0ee42ef...
more »

2017-06-16 08:06 (1) Answers

Return two objects from lapply

I have created a function which takes a little while to run (lots of crunching going on) and there are two distinct outputs that I need to return from this function. The inputs into these outputs are the same which is why I have combined them in the ...
more »

2017-06-16 05:06 (2) Answers

Pivoting data in R with duplicate rows

Trying to do a simple pivot in R, much like you would in SQL. I understand this question has been asked however I am having trouble with duplicate rows. Pivoting data in R Currently the data is in this format (characters are just placeholders for ...
more »

2017-06-16 03:06 (2) Answers