Total newbie to R here (so far very pleased!).
I have a large array(vector?) of date information, and I would like to remove the rows that do not fit within an my date range of interest (which is 24-sept-2003 to 10-december-2003, from 12pm to 6pm each day). I seem to be running out of memory
Here’s an example of the issue as well as I can put it:
> head(p_times)
[1] "2001-04-11 07:57:27 EDT" "2001-04-11 08:18:11 EDT"
[3] "2001-04-11 08:21:33 EDT" "2001-04-11 08:22:52 EDT"
[5] "2001-04-11 08:25:39 EDT" "2001-04-11 08:31:18 EDT"
> length(p_times)
[1] 31164014
> class(p_times)
[1] "POSIXlt" "POSIXt"
> fp_times = p_times[p_times$year==103]
R(59593,0xa0506540) malloc: *** mmap(size=249315328) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
R(59593,0xa0506540) malloc: *** mmap(size=124657664) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
R(59593,0xa0506540) malloc: *** mmap(size=57901056) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
I was planning to filter by year to remove most of the information, and then using the same approach to filter by month / day / hour
Could you use
POSIXctinstead ofPOSIXlt?POSIXltobjects seem to take ~5x more memory thanPOSIXctobjects: