-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with converting date formats for entire column #73
Comments
Dear Laurence, |
Hi Lars, http://datapub.cdlib.org/2014/04/10/abandon-all-hope-ye-who-enter-dates-in-excel/ https://cran.r-project.org/web/packages/timeDate/timeDate.pdf Checked out your R scripts, found the lapply(Packages, require, character.only = TRUE) example but not sure how the syntax works. Hopefully can discuss sometime! :-) Best, |
Do you have the original Excel file? If so you might be able to recategorised the dates to, strings for example, before exporting to CSV, thereby side stepping the whole problem. |
Hi Christopher, We thought of this, but the original excel files are according to firm (so
|
Check out the The help file actually has a discussion of the Excel issue: http://www.inside-r.org/r-doc/base/as.Date |
Hi Chris, That was actually one of the first commands I tried, but I only got this far:
The output is correct, but I then had trouble creating an object, or better yet to format the existing corresponding column, for all the existing day values. |
Imagine that you you have a data frame called DATA$new_date <- as.Date(DATA$date, origin = '1900-01-01') The new variable |
thank you, this worked |
Great. Very useful question btw. |
Hi all,
Firstly, thanks to @christophergandrud @ChristopherCosler for advice on merging the datasets (it worked really well, and the variables have now also been renamed). Unfortunately we are now having no luck reformatting the dates column for our observations (the dates were entered with the 'days since 1900 (or 1904)' microsoft excel convention). The offending code occurs at lines 79 and 80:
https://github.com/laurencehendry/SRISK_Thesis/blob/master/Gather
We can successfully convert one value but haven't succeeded in applying this to the whole column.
Grateful for consideration,
Laurence
The text was updated successfully, but these errors were encountered: