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 8696129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:12:26+00:00 2026-06-13T01:12:26+00:00

Possible Duplicate: Why is as.Date slow on a character vector? I have a large

  • 0

Possible Duplicate:
Why is as.Date slow on a character vector?

I have a large data.frame (roughly 60 mil observations) that I read from a database using RMySQL. The dates are brought in as characters (there doesn’t seem to be a way to change this) and so I use as.Date to convert things to date. However, this takes an extremely long time witih so many observations. Is there anything one can do to make this faster?

  • 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-06-13T01:12:27+00:00Added an answer on June 13, 2026 at 1:12 am

    Simon Urbanek’s fasttime library is very fast for a subset of parseable datetimes:

    R> now <- Sys.time()
    R> now
    [1] "2012-10-15 10:07:28.981 CDT"
    R> fasttime::fastPOSIXct(format(now))
    [1] "2012-10-15 05:07:28.980 CDT"
    R> as.Date(fasttime::fastPOSIXct(format(now)))
    [1] "2012-10-15"
    R> 
    

    However, it only parse ISO formats and assume UTC as timezone.

    Edit after 3 1/2 years: Some commenters appear to think that the fasttime package is difficult to install. I beg to differ. Here is (once again) use install.r which is just a simple wrapper using littler (and also shipped as an example with):

    edd@max:~$ install.r fasttime
    trying URL 'https://cran.rstudio.com/src/contrib/fasttime_1.0-1.tar.gz'
    Content type 'application/x-gzip' length 2646 bytes
    ==================================================
    downloaded 2646 bytes
    
    * installing *source* package ‘fasttime’ ...
    ** package ‘fasttime’ successfully unpacked and MD5 sums checked
    ** libs
    ccache gcc -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -O3 -Wall -pipe -pedantic -std=gnu99  -c tparse.c -o tparse.o
    ccache gcc -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o fasttime.so tparse.o -L/usr/lib/R/lib -lR
    installing to /usr/local/lib/R/site-library/fasttime/libs
    ** R
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    * DONE (fasttime)
    
    The downloaded source packages are in
            ‘/tmp/downloaded_packages’
    edd@max:~$ 
    

    As you can see, the package has zero external dependencies, one source file and builds without the slightest hitch. We can also see that fasttime is now on CRAN which was not the case when the answer was written. With that, Windows and OS X binaries now do exist at that page and the installation will be as easy as it was for me even when you do not install from source.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Java 7 Date/Time API I've read rumors that Joda Time is slated
Possible Duplicate: Create a date with T-SQL I've a data table that stores each
Possible Duplicate: php date compare I have a date that I take from the
Possible Duplicate: Is there a standard date/time format that can be passed on a
Possible Duplicate: php/Mysql query with inserting date fails I have a datepicker code below:
Possible Duplicate: strtotime failing on mm-dd-yyyy hh:mm I have a date coming in like
Possible Duplicate: Format mysql datetime with php Well.. I have stored date(c) in Mysql
Possible Duplicate: Parsing XML data to NSMutableArray iOS - iPhone <ForecastResult> <Forecast> <Date>2012-06-27T00:00:00</Date> <WeatherID>4</WeatherID>
Possible Duplicate: MySQL date format i have this date which i need to make
Possible Duplicate: Formatting a date in JavaScript I have a form having lots of

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.