[R-sig-Geo] create a raster time series with negative years (years Before Present)

Edzer Pebesma edzer@pebe@m@ @end|ng |rom un|-muen@ter@de
Fri Feb 22 16:12:07 CET 2019


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
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2472 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20190222/5dd1d8f1/attachment.bin>


More information about the R-sig-Geo mailing list