summary.act_tbl {activatr} | R Documentation |
Summarizes act_tbl
objects.
Description
summary.act_tbl
returns a tibble with canonical information about
the activity.
Usage
## S3 method for class 'act_tbl'
summary(object, full = FALSE, units = c("imperial", "metric"), ...)
Arguments
object |
an object for which a summary is desired |
full |
Whether every column should be included, and filled with NA if
missing. Most useful to ensure the tibble has the same shape for
every file, allowing eventual use of |
units |
Which units should be used?
|
... |
Additional arguments. |
Details
This is designed to allow for easy creation of activity summary data
sets by mapping summary over each act_tbl
then using
dplyr::bind_rows()
, purrr::map_dfr()
, or equivalent to create a complete
data set.
Value
Returns a tibble with a single row, containing a summary of the given
act_tbl
.
Examples
example_gpx_file <- system.file(
"extdata",
"running_example.gpx.gz",
package = "activatr"
)
act_tbl <- parse_gpx(example_gpx_file)
summary(act_tbl)
## Not run:
files <- list.files("path/to/many/files", pattern = "*.gpx")
gpxs <- files |> purrr::map(\(f) parse_gpx(f))
summaries <- gpxs |> purrr::map_dfr(\(g) summary(g, full = TRUE))
## End(Not run)