View source: R/alias_column_names.R
alias_column_names | R Documentation |
This function is used to remap the column names of a data frame containing sensor data to the
column names used in the database schema of mpathsenser. As the column names have already
changed several times over the year, we use these functions so we can easily add new aliases of
the existing columns. The function is generic and dispatches to the specific method for the
class of data
.
alias_column_names(data, ...)
data |
A data frame for which the column names are remapped according to the specific method
for this data frame. As such, |
... |
These dots are for future extensions and must be empty. |
Aliasing of the column names depends on the specific method, but column names are only changed if they have an alias available. Otherwise, they are kept unchanged.
A data frame with the column names remapped according to the specific method for this data frame.
x <- data.frame(
id = 1:3,
timestamp = as.POSIXct(c("2021-01-01 00:00:00", "2021-01-01 00:00:01", "2021-01-01 00:00:02")),
xm = c(1, 2, 3),
ym = c(4, 5, 6),
zm = c(7, 8, 9)
)
class(x) <- c("accelerometer", class(x))
mpathsenser:::alias_column_names(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.