search for: addlay

Displaying 7 results from an estimated 7 matches for "addlay".

Did you mean: addlag
2018 Mar 05
4
raster time series statistics
...at" require(raster) require(rts) require(stringi) r <- raster(ncol=100, nrow=100) values(r) <- runif(ncell(r)) list(ID=seq(1:24),month=rep(str_pad(1:12, pad = 0,width = 2 , "left"),2),year=sort(rep(2016:2017,12)))->dt stack(r)->s r->rs for(i in 1:23){ rs[]<-r[]*i addLayer(s,rs)->s print(nlayers(s)) } timelst<-paste0(unlist(dt['year']),'-',unlist(dt['month'])) rts(s,time=as.yearmon(timelst))->rsts str(rsts at time) apply.monthly(rsts,mean) I was expecting that the statistics accept the yearmonth format of the timeslot, as it allows...
2018 Mar 06
2
raster time series statistics
Last line in the following (updated) code produces the error require(raster) require(rts) require(stringr) r <- raster(ncol=100, nrow=100) values(r) <- runif(ncell(r)) stack(r)->s r->rs for(i in 1:23){ rs[]<-r[]*i addLayer(s,rs)->s print(nlayers(s)) } dt<-list(ID=seq(1:24),month=rep(formatC(1:12,flag=0,width=2),2), year=sort(rep(2016:2017,12))) timelst<-paste0(unlist(dt['year']),'-',unlist(dt['month']),"-01") strptime(timelst,format="%Y-%m-%d")->t1 rts(s,t...
2018 Mar 06
0
raster time series statistics
...require(stringi) > r <- raster(ncol=100, nrow=100) > values(r) <- runif(ncell(r)) > list(ID=seq(1:24),month=rep(str_pad(1:12, pad = 0,width = 2 , "left"),2),year=sort(rep(2016:2017,12)))->dt > stack(r)->s > r->rs > for(i in 1:23){ > rs[]<-r[]*i > addLayer(s,rs)->s > print(nlayers(s)) > } > timelst<-paste0(unlist(dt['year']),'-',unlist(dt['month'])) > rts(s,time=as.yearmon(timelst))->rsts > str(rsts at time) > apply.monthly(rsts,mean) > > I was expecting that the statistics accept the yearmo...
2018 Mar 06
0
raster time series statistics
...u> wrote: > Last line in the following (updated) code produces the error > require(raster) > require(rts) > require(stringr) > r <- raster(ncol=100, nrow=100) > values(r) <- runif(ncell(r)) > stack(r)->s > r->rs > for(i in 1:23){ > rs[]<-r[]*i > addLayer(s,rs)->s > print(nlayers(s)) > } > dt<-list(ID=seq(1:24),month=rep(formatC(1:12,flag=0,width=2),2), > year=sort(rep(2016:2017,12))) > timelst<-paste0(unlist(dt['year']),'-',unlist(dt['month']),"-01") > strptime(timelst,format="%...
2018 Mar 06
0
raster time series statistics
...equire(stringi) > r <- raster(ncol=100, nrow=100) > values(r) <- runif(ncell(r)) > list(ID=seq(1:24),month=rep(str_pad(1:12, pad = 0,width = 2 , "left"),2),year=sort(rep(2016:2017,12)))->dt > stack(r)->s > r->rs > for(i in 1:23){ > rs[]<-r[]*i > addLayer(s,rs)->s > print(nlayers(s)) > } > timelst<-paste0(unlist(dt['year']),'-',unlist(dt['month'])) > rts(s,time=as.yearmon(timelst))->rsts > str(rsts at time) > apply.monthly(rsts,mean) > > I was expecting that the statistics accept the yearmon...
2018 Mar 06
1
raster time series statistics
It works if you use as.Date. But this defeates the purpose for the yearmon notion... require(raster) require(rts) require(stringr) r <- raster(ncol=100, nrow=100) values(r) <- runif(ncell(r)) stack(r)->s r->rs for(i in 1:23){ rs[]<-r[]*i addLayer(s,rs)->s print(nlayers(s)) } dt<-list(ID=seq(1:24),month=rep(formatC(1:12,flag=0,width=2),2), year=sort(rep(2016:2017,12))) timelst<-paste0(unlist(dt['year']),'-',unlist(dt['month']),"-01") strptime(timelst,format="%Y-%m-%d")->t1 rts(s,t...
2012 Apr 07
6
Drawing a line in xyplot
i am trying to replicate the following graph using xyplot : attach(x) plot ( jitter(type), mortality, pch=16, xlim = c(0.25, 3.75)) lines ( c(1-0.375,1.375) , c ( median(mortality[type==1]), median(mortality[type==1])), lwd=5,col=2) lines ( c(2-0.375,2.375) , c ( median(mortality[type==2]), median(mortality[type==2])), lwd=5,col=2) lines ( c(3-0.375,3.375) , c ( median(mortality[type==3]),