getTimeSeries: Get time series from twdtw* objects

Description Usage Arguments Value Author(s) See Also Examples

Description

Get time series from objects of class twdtw*.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S4 method for signature 'twdtwTimeSeries'
getTimeSeries(object, labels = NULL)

## S4 method for signature 'twdtwMatches'
getTimeSeries(object, labels = NULL)

## S4 method for signature 'twdtwMatches'
getPatterns(object, labels = NULL)

## S4 method for signature 'twdtwRaster'
getTimeSeries(object, y, labels = NULL,
  proj4string = NULL, id.labels = NULL)

Arguments

object

an object of class of class twdtw*.

labels

character vector with time series labels. For signature twdtwRaster this argument can be used to set the labels for each sample in y, or it can be combined with id.labels to select samples with a specific label.

y

a data.frame whose attributes are: longitude, latitude, the start ”from” and the end ”to” of the time interval for each sample. This can also be a SpatialPointsDataFrame whose attributes are the start ”from” and the end ”to” of the time interval. If missing ”from” and/or ”to”, they are set to the time range of the object.

proj4string

projection string, see CRS-class. Used if y is a data.frame.

id.labels

a numeric or character with an column name from y to be used as samples labels. Optional.

Value

An object of class twdtwTimeSeries.

a list with TWDTW results or an object twdtwTimeSeries-class.

Author(s)

Victor Maus, vwmaus1@gmail.com

See Also

twdtwRaster-class, twdtwTimeSeries-class, and twdtwMatches-class

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
# Getting time series from objects of class twdtwTimeSeries
ts = twdtwTimeSeries(MOD13Q1.ts.list)
getTimeSeries(ts, 2)
# Getting time series from objects of class twdtwTimeSeries
ts = twdtwTimeSeries(MOD13Q1.ts.list)
patt = twdtwTimeSeries(MOD13Q1.patterns.list)
mat = twdtwApply(x=ts, y=patt)
getTimeSeries(mat, 2)
## This example creates a twdtwRaster object and extract time series from it. 

# Creating objects of class twdtwRaster with evi and ndvi time series 
evi = brick(system.file("lucc_MT/data/evi.tif", package="dtwSat"))
ndvi = brick(system.file("lucc_MT/data/ndvi.tif", package="dtwSat"))
timeline = scan(system.file("lucc_MT/data/timeline", package="dtwSat"), what="date")
rts = twdtwRaster(evi, ndvi, timeline=timeline)

# Location and time range 
ts_location = data.frame(longitude = -55.96957, latitude = -12.03864, 
                         from = "2007-09-01", to = "2013-09-01")
prj_string = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"

## Extract time series 
ts = getTimeSeries(rts, y = ts_location, proj4string = prj_string)
 
autoplot(ts[[1]], facets = NULL) + xlab("Time") + ylab("Value")

dtwSat documentation built on May 19, 2017, 8:05 p.m.

Search within the dtwSat package
Search all R packages, documentation and source code