Re: [R] Cores hang when calling mcapply

2024-12-10 Thread Gregg Powell via R-help
Hello Thomas, Consider that the primary bottleneck may be tied to memory usage and the complexity of pivoting extremely large datasets into wide formats with tens of thousands of unique values per column. Extremely large expansions of columns inherently stress both memory and CPU, and splitting

Re: [R] Cores hang when calling mcapply

2024-12-10 Thread Jeff Newmiller via R-help
Maybe ask on the HPC list? [1] A general tip... you may be running out of memory. If at all possible you need to make sure you extract the data subsets in the parent process, and limit the amount of environment data passed into the child processes. That is, instead of using an integer counter t

[R] Cores hang when calling mcapply

2024-12-10 Thread Deramus, Thomas Patrick
Hi R users. Apologies for the lack of concrete examples because the dataset is large, and it being so I believe is the issue. I multiple, very large datasets for which I need to generate 0/1 absence/presence columns Some include over 200M rows, with two columns that need presence/absence colum

Re: [R] outer() is not working with my simple function

2024-12-10 Thread Duncan Murdoch
On 2024-12-10 11:36 a.m., Christofer Bogaso wrote: Hi, I have below code FN1 = function(x, y) 3 outer(1:9, 1:9, FN1) With above I get error as below Error in dim(robj) <- c(dX, dY) : dims [product 81] do not match the length of object [1] Could you please help to understand why is it fa

Re: [R] outer() is not working with my simple function

2024-12-10 Thread Iris Simmons
outer() expects a return value with the same length as that of x. You could change the code to rep(3, length(x)) Or if you don't want to change the code of the function, you could make a wrapper and use that instead: function (x, y) { v <- FN1(x, y) if (length(v) != 1) v else rep(v, lengt

[R] outer() is not working with my simple function

2024-12-10 Thread Christofer Bogaso
Hi, I have below code FN1 = function(x, y) 3 outer(1:9, 1:9, FN1) With above I get error as below Error in dim(robj) <- c(dX, dY) : dims [product 81] do not match the length of object [1] Could you please help to understand why is it failing? I am just expecting to get a matrix with all el

Re: [R] Heat maps containing two types of variables

2024-12-10 Thread phil
Thanks for sticking with me Tim. Your solution is clear and works like a charm. Philip On 2024-12-10 08:35, Ebert,Timothy Aaron wrote: You will need to add code to tell R which variables to plot in reverse color order. In this code, I chose variable B to plot in reverse order. library(ggplo

Re: [R] Heat maps containing two types of variables

2024-12-10 Thread Ebert,Timothy Aaron
You will need to add code to tell R which variables to plot in reverse color order. In this code, I chose variable B to plot in reverse order. library(ggplot2) library(tidyr) library(dplyr) dat <- data.frame( date = seq.Date(as.Date("2024-01-01"), as.Date("2024-06-01"), by = "month"), A =

Re: [R] Heat maps containing two types of variables

2024-12-10 Thread phil
Thank you for the suggestion. I tried it, but could not get it to work. When I added a second ggplot statement, I hit an error saying that one cannot add a ggplot to a ggplot object. So I added a second geom_tile statement instead. That worked, except that it warned that since a scale for fill