rfilltimegaps: Disaggregation in the time dimension through the use of...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/rfilltimegaps.R

Description

The function creates an object of STFDF class, spatio-temporal data with full space-time grid, from another STFDF and fills attribute data for missing dates using splines.

Usage

1
 rfilltimegaps(stfdf,tunits="day",attrname=1, ...)

Arguments

stfdf

STFDF object with time information of minimum length 2, and gap between

tunits

increment of the sequence used to generete time infromation for temporal gap. See 'Details'

attrname

varible from STFDF to be splined

...

arguments passed to spline

Details

tunits can be specified in several ways:

The difference between "day" and "DSTday" is that the former ignores changes to/from daylight savings time and the latter takes the same clock time each day. ("week" ignores DST (it is a period of 144 hours), but "7 DSTdays") can be used as an alternative. "month" and "year" allow for DST.)

Value

STFDF object

Author(s)

Milan Kilibarda kili@grf.bg.ac.rs

References

Kilibarda, M., T. Hengl, G. B. M. Heuvelink, B. Graeler, E. Pebesma, M. Percec Tadic, and B. Bajat (2014), Spatio-temporal interpolation of daily temperatures for global land areas at 1 km resolution, J. Geophys. Res. Atmos., 119, 2294-2313, doi:10.1002/2013JD020803;

Kilibarda M., M. Percec Tadic, T. Hengl, J. Lukovic, B. Bajat - Spatial Statistics (2015), Global geographic and feature space coverage of temperature data in the context of spatio-temporal interpolation, doi:10.1016/j.spasta.2015.04.005.

See Also

rfillspgaps pred.strk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  data(nlmodis20110704)
  data(nlmodis20110712)

  
  # fill spatial gaps
  library(raster)
  NLpol <- as(extent(5, 6, 51.5, 52), 'SpatialPolygons')
  NLpol@proj4string <- nlmodis20110704@proj4string
  nlmodis20110704 <- rfillspgaps(nlmodis20110704,NLpol)
  nlmodis20110712 <- rfillspgaps(nlmodis20110712,NLpol)
  
  nlmodis20110704 <- as(nlmodis20110704,"SpatialPixelsDataFrame")
  names(nlmodis20110704)='m1'
  nlmodis20110712 <- as(nlmodis20110712,"SpatialPixelsDataFrame")
  names(nlmodis20110712)='m2'
  
  nlmodis20110704@data <- cbind(nlmodis20110704@data, nlmodis20110712@data)
  
  df<-reshape(nlmodis20110704@data , varying=list(1:2), v.names="modis",direction="long", 
            times=as.Date(c('2011-07-04','2011-07-12')), ids=1:dim(nlmodis20110704)[1])
  
  library(spacetime)
  stMODIS<- STFDF(as( nlmodis20110704, "SpatialPixels"), 
                  time= as.Date(c('2011-07-04','2011-07-12')), 
                  data.frame(modis=df[,'modis']))
  
  # stplot(stMODIS, col.regions=bpy.colors())
  stMODIS <- rfilltimegaps(stMODIS)
  # stplot(stMODIS, col.regions=bpy.colors())

meteo documentation built on May 2, 2019, 3:29 p.m.

Related to rfilltimegaps in meteo...