I have this .txt file: http://pastebin.com/raw.php?i=0fdswDxF
First column (Date) shows date in month/day So 0601 is the 1st of June
When I load this into R and I show the data, it removes the first 0 in the data. So when loaded it looks like:
601
602
etc For 1st of June, 2nd of June
For the months 10,11,12, it remains unchanged.
How do I change it back to 0601
etc.?
What I am trying to do is to change these days into the day of the year, for instance, 1st of January (0101) would be 1, and 31st of December would be 365.
There is no leap year to be considered.
I have the code to change this, if my data was shown as 0601 etc, but not as 601 etc.
copperNew$Date = as.numeric(as.POSIXct(strptime(paste0("2013",copperNew$Date), format="%Y%m%d")) -
as.POSIXct("2012-12-31"), units = "days")
Where Date of course is from the file linked above.
Please ask if you do not consider the description to be good enough.