Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5982177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:02:58+00:00 2026-05-22T22:02:58+00:00

Total newbie to R here (so far very pleased!). I have a large array(vector?)

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:02:59+00:00Added an answer on May 22, 2026 at 10:02 pm

    Could you use POSIXct instead of POSIXlt? POSIXlt objects seem to take ~5x more memory than POSIXct objects:

    > set.seed(21)
    > x <- Sys.time() - trunc(runif(31164014)*3e8); range(x)
    [1] "2001-12-03 11:55:25 CST" "2011-06-06 18:15:07 CDT"
    > print(object.size(x), units="Mb")
    237.8 Mb
    > print(object.size(as.POSIXlt(x)), units="Mb")
    1188.8 Mb
    > 1188.8/237.8
    [1] 4.999159
    > sessionInfo()
    R version 2.13.0 (2011-04-13)
    Platform: x86_64-pc-linux-gnu (64-bit)
    
    locale:
     [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
     [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
     [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
     [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
     [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Total newbie here, regarding sqlite, so don't flame too hard :) I have a
Total newbie question here; I apologize in advance. Suppose I have a daemon written
I'm a total newbie to Facebook programming and would like to know, as a
Total newbie here, please bear with me. Building a very small personal app that
I am a total Groovy newbie. I saw the following code here . def
Ok, total Cucumber newbie here so please be gentle. As a learning Ruby/Cucumber/MongoDB endeavor
Total newbie to XPath and Java here. What I'm attempting to do is something
A total newbie question, so please bear with me here ;) When a key
So, total newbie to Git. Been reading through the guides and think I have
total newbie here. i was trying to replace a character in char * but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.