mcgf {mcgf} | R Documentation |
Create mcgf object
Description
Create mcgf object
Usage
mcgf(data, locations, dists, time, longlat = TRUE, origin = 1L)
Arguments
data |
Time series data set in space-wide format. |
locations |
A matrix of data.frame of 2D points, first column
x/longitude, second column y/latitude. Required when |
dists |
List of signed distance matrices on a 2D Euclidean Plane.
Required when |
time |
Optional, a vector of equally spaced time stamps. |
longlat |
Logical, if TURE |
origin |
Optional; used when |
Details
An mcgf
object extends the S3 class data.frame
.
For inputs, data
must be in space-wide format where rows correspond to
different time stamps and columns refer to spatial locations. Supply either
locations
or dists
. locations
is a matrix or data.frame of 2D points
with first column x/longitude and second column y/latitude. By default it is
treated as a matrix of Earth's coordinates in decimal degrees. Number of rows
in locations
must be the same as the number of columns of data
. dists
must be a list of signed distance matrices with names h1
, h2
, and h
.
If h
is not given, it will be calculated as the Euclidean distance of h1
and h2
. time
is a vector of equally spaced time stamps. If it is not
supplied then data
is assumed to be temporally equally spaced.
An mcgf
object extends the S3 class data.frame
, all methods remain valid
to the data
part of the object.
Value
An S3 object of class mcgf
. As it inherits and extends the
data.frame
class, all methods remain valid to the data
part of the
object. Additional attributes may be assigned and extracted.
Examples
data <- cbind(S1 = 1:5, S2 = 4:8, S3 = 5:9)
lon <- c(110, 120, 130)
lat <- c(50, 55, 60)
locations <- cbind(lon, lat)
obj <- mcgf(data, locations = locations)
print(obj, "locations")