A helper function to import datasets from the accdata
package.
Arguments
- data
A character string indicating which data to load. The currently available datasets are "daily_acc_3d" and "daily_acc_7d".
Details
To import these datasets you need to install the accdata
package. It can be installed by running install_accdata()
. The
datasets documentation can be accessed by ?accdata::`dataset_name`
(e.g., ?accdata::daily_acc_3d
.
Examples
# \donttest{
# Ensure that {accdata} package is available before running the example.
# If it is not, run install_accdata() to install the required package.
if (requireNamespace("accdata", quietly = TRUE)) {
data <- import_dataset("daily_acc_3d")
data
}
#> # Start time: 2016-01-20 00:01:00
#> # Sampling frequency: 100Hz
#> # Accelerometer placement: Back
#> # Subject body mass: 119kg
#> # Filter: No filter applied
#> # Data dimensions: 25,913,900 × 4
#> timestamp acc_X acc_Y acc_Z
#> <dttm> <dbl> <dbl> <dbl>
#> 1 2016-01-20 00:01:00 0.182 0.944 -0.214
#> 2 2016-01-20 00:01:00 0.185 0.938 -0.211
#> 3 2016-01-20 00:01:00 0.185 0.944 -0.208
#> 4 2016-01-20 00:01:00 0.182 0.947 -0.208
#> 5 2016-01-20 00:01:00 0.185 0.944 -0.208
#> 6 2016-01-20 00:01:00 0.188 0.944 -0.208
#> 7 2016-01-20 00:01:00 0.188 0.947 -0.208
#> 8 2016-01-20 00:01:00 0.188 0.947 -0.208
#> 9 2016-01-20 00:01:00 0.185 0.947 -0.208
#> 10 2016-01-20 00:01:00 0.188 0.944 -0.202
#> # … with 25,913,890 more rows
#> # ℹ Use `print(n = ...)` to see more rows
# }