[R] date conversion problem
Abdoulaye Sarr
@bdou|@ye@@r @end|ng |rom gm@||@com
Wed Aug 12 14:27:39 CEST 2020
I have dataset with time sine 1800-01-01 and extracted data from 1981 to
2019 and used these lines for the data conversion:
> time_d <- as.Date(time, format="%j", origin=as.Date("1800-01-01"))
> time_years <- format(time_d, "%Y")
> time_months <- format(time_d, "%m")
> time_year_months <- format(time_d, "%Y-%m")
> head(time_d)
[1] "6095-12-22" "6096-01-15" "6096-02-08" "6096-03-03" "6096-03-27"
"6096-04-20"
As you see these gregorian dates are unrealistic and wonder what I am doing
wrong?
The time from the raw file in Jd are like this:
> time
[1] 1569072 1569096 1569120 1569144 1569168 1569192 1569216 1569240etc.
Hope hint and/or suggestion to solve this.
Best regards
[[alternative HTML version deleted]]
More information about the R-help
mailing list