cubble {cubble} | R Documentation |
Create a cubble object
Description
Create a cubble object
Usage
cubble(..., key, index, coords)
make_cubble(
spatial,
temporal,
by = NULL,
key,
index,
coords,
potential_match = NULL,
key_use = "temporal"
)
Arguments
... |
a set of name-value pairs to create a cubble, need to include the
|
key |
a character (or symbol), the spatial identifier. See the Key
section in |
index |
a character (or symbol), the temporal identifier.
Currently support base R classes |
coords |
a vector of character (or symbol) of length two, in the order of longitude first and then latitude, the argument can be omitted if created from an sf and its subclasses. In case the sf geometry column is not POINT, coords will be the centroid coordinates. |
spatial |
a tibble object or an sf object, the spatial component
containing the |
temporal |
a tibble object or a tsibble object, the temporal component
containing the |
by |
in the syntax of the |
potential_match |
a |
key_use |
a character of either "spatial" or "temporal". When
|
Value
a cubble object
Examples
cubble(
id = rep(c("perth", "melbourne", "sydney"), each = 3),
date = rep(as.Date("2020-01-01") + 0:2, times = 3),
long = rep(c(115.86, 144.96, 151.21), each = 3),
lat = rep(c(-31.95, -37.81, -33.87), each = 3),
value = rnorm(n = 9),
key = id, index = date, coords = c(long, lat)
)
# stations and climate are in-built data in cubble
make_cubble(spatial = stations, temporal = meteo,
key = id, index = date, coords = c(long, lat))