See ?as.Date: "Years before 1CE (aka 1AD) will probably not be handled correctly."
On 2/22/19 3:59 PM, Jackson Rodrigues wrote:
> Hey guys,
>
> I need some help to set a time serie (ts) to raster stack, however my
> raster serie has negative ages (years Before Present (yrBP)).
>
> I have tried several codes and packages unsuccessfully.
>
> If succeed, I would like to apply seasonal and other calculations to my
> new raster time serie.
>
> Below are some codes from package rts. I adapted years to negative value
> only as a example.
>
> #####
>> path <- system.file("external", package="rts") # location of files
>> lst <- list.files(path=path,pattern='.asc$',full.names=TRUE)
>> lst # list of raster files
>> r <- stack(lst) # creating a RasterStack object
>> r
>> d <- c("-2000-02-01","-2000-03-01","-2000-04-01","-2000-05-01") #
> corresponding dates to 4 rasters
>> d <- as.Date(d) # or d <- as.POSIXct(d)
> Error in charToDate(x) :
> character string is not in a standard unambiguous format
>> rt <- rts(r,d) # creating a RasterStackTS object
>> rt
>> plot(rt)
> #########
>
> best,
>
> Jackson Rodrigues
> --
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081
pEpkey.asc
Description: application/pgp-keys
_______________________________________________ R-sig-Geo mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
