pivot_data | R Documentation |
Pivot data obtained with the function gwr
. Groups all the data
points for each entity/row into a single list of elements.
pivot_data(
.data,
timestep = "^T[0-9]*",
cols = colnames(.data) %>% stringr::str_detect(timestep, negate = TRUE) %>% which(),
scale = 1,
add = 0,
varname = "value"
)
.data |
Data frame ( |
timestep |
String with the pattern used to name each data point at each
time-step. Default: |
cols |
Metadata columns ( |
scale |
Numeric value to scale the data. Default: |
add |
Numeric value to be added/subtracted from the data points.
Default: |
varname |
Output variable name. Default: |
Data frame (tibble
object) with a new column named according
to the string passed with value
, this new column contains a list
of the data points at each time step for each observation/row.
## Not run:
`%>%` <- magrittr::`%>%`
data <- tibble::tibble(entity_name = "University of Reading",
latitude = 51.44140,
longitude = -0.9418,
elevation = 61)
smpds::gwr(.ref = "/path/to/reference-tmp.nc",
.tar = data,
varid = "tmp") %>%
smpds::pivot_data(varname = "tmp")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.