diff --git a/404.html b/404.html index d35dbcf..d6823b2 100644 --- a/404.html +++ b/404.html @@ -27,7 +27,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/LICENSE-text.html b/LICENSE-text.html index a7db483..5afadaa 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -7,7 +7,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/articles/activatr.html b/articles/activatr.html index 491c6fa..f285734 100644 --- a/articles/activatr.html +++ b/articles/activatr.html @@ -26,7 +26,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/articles/index.html b/articles/index.html index bdf1717..d8d182b 100644 --- a/articles/index.html +++ b/articles/index.html @@ -7,7 +7,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/articles/pace.html b/articles/pace.html index 6355add..a2b4628 100644 --- a/articles/pace.html +++ b/articles/pace.html @@ -26,7 +26,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/articles/parsing.html b/articles/parsing.html index 637cddc..4f96fc4 100644 --- a/articles/parsing.html +++ b/articles/parsing.html @@ -26,7 +26,7 @@ activatr - 0.2.0.9000 + 0.2.1 @@ -221,7 +221,7 @@ Sampling datapoints#> [1] 4433 full_time #> user system elapsed -#> 0.158 0.000 0.158 +#> 0.161 0.000 0.161 # Grabbing every hundredth data point runs much faster sample_time <- system.time({ @@ -231,7 +231,7 @@ Sampling datapoints#> [1] 44 sample_time #> user system elapsed -#> 0.041 0.000 0.041 +#> 0.042 0.000 0.042 diff --git a/authors.html b/authors.html index ee63bcf..b24cda3 100644 --- a/authors.html +++ b/authors.html @@ -7,7 +7,7 @@ activatr - 0.2.0.9000 + 0.2.1 @@ -51,14 +51,14 @@ Citation Schafer D (2024). activatr: Utilities for Parsing and Plotting Activities. -R package version 0.2.0.9000, +R package version 0.2.1, https://dschafer.github.io/activatr/, https://github.com/dschafer/activatr. @Manual{, title = {activatr: Utilities for Parsing and Plotting Activities}, author = {Daniel Schafer}, year = {2024}, - note = {R package version 0.2.0.9000, + note = {R package version 0.2.1, https://dschafer.github.io/activatr/}, url = {https://github.com/dschafer/activatr}, } diff --git a/index.html b/index.html index b48cfa4..fc90763 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/news/index.html b/news/index.html index c78cda9..6dbe797 100644 --- a/news/index.html +++ b/news/index.html @@ -7,7 +7,7 @@ activatr - 0.2.0.9000 + 0.2.1 @@ -38,7 +38,11 @@ -activatr (development version) +activatr 0.2.1 + +Other Improvements +Remove lintr and styler as dependencies (#17). + activatr 0.2.0CRAN release: 2023-08-22 diff --git a/pkgdown.yml b/pkgdown.yml index 8e10b35..0e6efe4 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -5,7 +5,7 @@ articles: activatr: activatr.html pace: pace.html parsing: parsing.html -last_built: 2024-07-27T21:08Z +last_built: 2024-07-27T21:12Z urls: reference: https://dschafer.github.io/activatr/reference article: https://dschafer.github.io/activatr/articles diff --git a/reference/act_tbl-class.html b/reference/act_tbl-class.html index edfd5fa..227c94e 100644 --- a/reference/act_tbl-class.html +++ b/reference/act_tbl-class.html @@ -9,7 +9,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/activatr.html b/reference/activatr.html index 00b30dd..7beedb3 100644 --- a/reference/activatr.html +++ b/reference/activatr.html @@ -15,7 +15,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/get_ggmap_from_df.html b/reference/get_ggmap_from_df.html index 18515c3..9a8b6c3 100644 --- a/reference/get_ggmap_from_df.html +++ b/reference/get_ggmap_from_df.html @@ -11,7 +11,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/index.html b/reference/index.html index 000d948..c5bff39 100644 --- a/reference/index.html +++ b/reference/index.html @@ -7,7 +7,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/localize_to_time_zone.html b/reference/localize_to_time_zone.html index 4cdaf88..a770307 100644 --- a/reference/localize_to_time_zone.html +++ b/reference/localize_to_time_zone.html @@ -15,7 +15,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/mutate_with_speed.html b/reference/mutate_with_speed.html index 875e3ad..37b8bb4 100644 --- a/reference/mutate_with_speed.html +++ b/reference/mutate_with_speed.html @@ -11,7 +11,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/pace_formatter.html b/reference/pace_formatter.html index c2df01f..ee81001 100644 --- a/reference/pace_formatter.html +++ b/reference/pace_formatter.html @@ -7,7 +7,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/parse_gpx.html b/reference/parse_gpx.html index 8534144..bbf6aae 100644 --- a/reference/parse_gpx.html +++ b/reference/parse_gpx.html @@ -11,7 +11,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/parse_tcx.html b/reference/parse_tcx.html index 9126e23..de8d6f8 100644 --- a/reference/parse_tcx.html +++ b/reference/parse_tcx.html @@ -11,7 +11,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/running_example_ggmap.html b/reference/running_example_ggmap.html index 12531d2..f6f6d72 100644 --- a/reference/running_example_ggmap.html +++ b/reference/running_example_ggmap.html @@ -9,7 +9,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/speed_to_mile_pace.html b/reference/speed_to_mile_pace.html index 52c2f23..5f93b1f 100644 --- a/reference/speed_to_mile_pace.html +++ b/reference/speed_to_mile_pace.html @@ -13,7 +13,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/reference/summary.act_tbl.html b/reference/summary.act_tbl.html index e558de3..31bf865 100644 --- a/reference/summary.act_tbl.html +++ b/reference/summary.act_tbl.html @@ -9,7 +9,7 @@ activatr - 0.2.0.9000 + 0.2.1 diff --git a/search.json b/search.json index cae2382..017d28d 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://dschafer.github.io/activatr/articles/activatr.html","id":"getting-gpx-files","dir":"Articles","previous_headings":"","what":"Getting GPX Files","title":"Visualizing Activities with activatr","text":"process get GPX file varies depending service use. Garmin Connect, can click gear menu activity click “Export GPX”. package includes sample GPXs examples.","code":""},{"path":"https://dschafer.github.io/activatr/articles/activatr.html","id":"parsing-gpx-files","dir":"Articles","previous_headings":"","what":"Parsing GPX Files","title":"Visualizing Activities with activatr","text":"Basic parsing GPX file simple: use parse_gpx() function pass name GPX file. parse_gpx() returns act_tbl, column latitude (lat), longitude (lon), elevation (ele, meters), time (time). activatr also overrides summary() create basic one-row tibble summarizing activity. advanced parsing options, see vignette(\"parsing\").","code":"library(activatr) # Get the running_example.gpx file included with this package. filename <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) df <- parse_gpx(filename) summary(df)"},{"path":"https://dschafer.github.io/activatr/articles/activatr.html","id":"analyzing-gpx-files","dir":"Articles","previous_headings":"","what":"Analyzing GPX Files","title":"Visualizing Activities with activatr","text":"Since just tibble, can analyze plot using usual techniques libraries. activatr includes helpers, like mutate_with_speed(), speed_to_mile_pace() pace_formatter() make easier analyze pace using libraries. details helpers, see vignette(\"pace\").","code":"library(ggplot2) library(dplyr) df |> mutate_with_speed(lead = 10, lag = 10) |> mutate(pace = speed_to_mile_pace(speed)) |> filter(as.numeric(pace) < 1200) |> ggplot() + geom_line(aes(x = time, y = as.numeric(pace)), color = \"blue\") + scale_y_reverse(label = pace_formatter) + xlab(\"Time\") + ylab(\"Pace (min/mile)\")"},{"path":"https://dschafer.github.io/activatr/articles/activatr.html","id":"visualizing-gpx-files","dir":"Articles","previous_headings":"","what":"Visualizing GPX Files","title":"Visualizing Activities with activatr","text":"data, ’s useful visualize . basic visualizations work expected data frame: ’s helpful overlay information map. aid , get_ggmap_from_df() wrapper around ggmap::get_map() returns correctly sized zoomed map, atop can visualize track using ggmap::ggmap(). Let’s see start: now map right size visualize run. Putting together, can make nice basic graphic run:","code":"library(ggplot2) qplot(lon, lat, data = df) library(ggmap) ggmap::ggmap(get_ggmap_from_df(df)) + theme_void() ggmap::ggmap(get_ggmap_from_df(df)) + theme_void() + geom_path(aes(x = lon, y = lat), linewidth = 1, data = df, color = \"red\")"},{"path":"https://dschafer.github.io/activatr/articles/parsing.html","id":"parsing-extension-data","dir":"Articles","previous_headings":"","what":"Parsing extension data","title":"Advanced Parsing with activatr","text":"GPX file contains additional extension information, activatr can parse well. case, running_example.gpx contains heart rate, cadence, temperature information. can parse setting detail = \"advanced\" parse_gpx: Now can plots like heart rate time, distribution cadences:","code":"df_advanced <- parse_gpx(filename, detail = \"advanced\") library(ggplot2) library(dplyr) ggplot(df_advanced) + geom_line(aes(x = time, y = hr), color = \"red\") ggplot(filter(df_advanced, cad > 80)) + geom_density(aes(x = cad * 2), fill = \"blue\", bw = 1)"},{"path":"https://dschafer.github.io/activatr/articles/parsing.html","id":"sampling-datapoints","dir":"Articles","previous_headings":"","what":"Sampling datapoints","title":"Advanced Parsing with activatr","text":"’re parsing many GPX files GPX files sampled every second, often don’t need “full resolution” view activity. every argument parse_gpx allows sample points GPX, speeding parsing:","code":"# Parsing as normal gets all of the rows, but takes longer full_time <- system.time({ df_full <- parse_gpx(filename) }) nrow(df_full) #> [1] 4433 full_time #> user system elapsed #> 0.158 0.000 0.158 # Grabbing every hundredth data point runs much faster sample_time <- system.time({ df_sample <- parse_gpx(filename, every = 100) }) nrow(df_sample) #> [1] 44 sample_time #> user system elapsed #> 0.041 0.000 0.041"},{"path":"https://dschafer.github.io/activatr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Daniel Schafer. Author, copyright holder, maintainer.","code":""},{"path":"https://dschafer.github.io/activatr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Schafer D (2024). activatr: Utilities Parsing Plotting Activities. R package version 0.2.0.9000, https://dschafer.github.io/activatr/, https://github.com/dschafer/activatr.","code":"@Manual{, title = {activatr: Utilities for Parsing and Plotting Activities}, author = {Daniel Schafer}, year = {2024}, note = {R package version 0.2.0.9000, https://dschafer.github.io/activatr/}, url = {https://github.com/dschafer/activatr}, }"},{"path":"https://dschafer.github.io/activatr/index.html","id":"activatr-","dir":"","previous_headings":"","what":"Utilities for Parsing and Plotting Activities","title":"Utilities for Parsing and Plotting Activities","text":"activatr (pronounced like word “activator”) library parsing GPX files standard format, manipulating visualizing files.","code":""},{"path":"https://dschafer.github.io/activatr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utilities for Parsing and Plotting Activities","text":"can install released version activatr CRAN : development version GitHub :","code":"install.packages(\"activatr\") # install.packages(\"devtools\") devtools::install_github(\"dschafer/activatr\")"},{"path":"https://dschafer.github.io/activatr/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Utilities for Parsing and Plotting Activities","text":"","code":"library(activatr)"},{"path":"https://dschafer.github.io/activatr/index.html","id":"parsing","dir":"","previous_headings":"Usage","what":"Parsing","title":"Utilities for Parsing and Plotting Activities","text":"activatr contains function parse, analyze, display GPX activities. basic thing can parse GPX file tibble:","code":"# Get the running_example.gpx file included with this package. filename <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) df <- parse_gpx(filename)"},{"path":"https://dschafer.github.io/activatr/index.html","id":"visualizing","dir":"","previous_headings":"Usage","what":"Visualizing","title":"Utilities for Parsing and Plotting Activities","text":"data, can visualize atop map: details use package, check vignette(\"activatr\").","code":"library(ggmap) library(ggplot2) ggmap::ggmap(get_ggmap_from_df(df)) + theme_void() + geom_path(aes(x = lon, y = lat), linewidth = 1, data = df, color = \"red\")"},{"path":"https://dschafer.github.io/activatr/reference/act_tbl-class.html","id":null,"dir":"Reference","previous_headings":"","what":"act_tbl class — act_tbl-class","title":"act_tbl class — act_tbl-class","text":"act_tbl S3 class subclass data.frame tibble.","code":""},{"path":"https://dschafer.github.io/activatr/reference/act_tbl-class.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"act_tbl class — act_tbl-class","text":"nearly every respect, can treated like tibble; however, allows package provide improved summary.act_tbl() function get overview activity.","code":""},{"path":"https://dschafer.github.io/activatr/reference/activatr.html","id":null,"dir":"Reference","previous_headings":"","what":"activatr: Utilities for Parsing and Plotting Activities — activatr","title":"activatr: Utilities for Parsing and Plotting Activities — activatr","text":"contains helpful functions parsing, managing, plotting, visualizing activities, often GPX (GPS Exchange Format) files recorded GPS devices. allows easy parsing source files standard R data formats, along functions compute derived data activity, plot activity variety ways.","code":""},{"path":[]},{"path":"https://dschafer.github.io/activatr/reference/activatr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"activatr: Utilities for Parsing and Plotting Activities — activatr","text":"Maintainer: Daniel Schafer dan.schafer@gmail.com [copyright holder]","code":""},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a map for a given act_tbl — get_ggmap_from_df","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"get_ggmap_from_df takes act_tbl object, computes correct zoom center activity, returns ggmap object zoom center.","code":""},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"","code":"get_ggmap_from_df(df, ...)"},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"df act_tbl object. ... Additional arguments forwarded ggmap::get_googlemap().","code":""},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"ggmap object, result calling ggmap::get_googlemap(), correct center size include entire activity represented act_tbl.","code":""},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"Note since calls ggmap::get_googlemap(), must previously called ggmap::register_google() register API key.","code":""},{"path":[]},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"","code":"if (FALSE) { # \\dontrun{ example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) act_tbl <- parse_gpx(example_gpx_file) ggmap::ggmap(get_ggmap_from_df(act_tbl)) } # }"},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":null,"dir":"Reference","previous_headings":"","what":"Localize time zone values — localize_to_time_zone","title":"Localize time zone values — localize_to_time_zone","text":"localize_to_time_zone uses Google Maps Time Zone APIs localize time zone act_tbl. modifies mutated act_tbl time column updated contain absolute time, appropriate time zone activity took place.","code":""},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Localize time zone values — localize_to_time_zone","text":"","code":"localize_to_time_zone(df)"},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Localize time zone values — localize_to_time_zone","text":"df act_tbl object.","code":""},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Localize time zone values — localize_to_time_zone","text":"act_tbl, time column updated local time zone rather UTC.","code":""},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Localize time zone values — localize_to_time_zone","text":"Note avoid overuse APIs, \"approximation\", finds correct time zone first point data frame, assumes points data frame use time zone. Runs time zones (runs cross daylight savings time shifts) hence recorded using consistent, always pointwise correct, timezone. Note must previously called ggmap::register_google() register API key calling .","code":""},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Localize time zone values — localize_to_time_zone","text":"","code":"if (FALSE) { # \\dontrun{ example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) act_tbl <- parse_gpx(example_gpx_file) act_tbl_with_tz <- localize_to_time_zone(act_tbl) } # }"},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":null,"dir":"Reference","previous_headings":"","what":"Augments an act_tbl with a speed column — mutate_with_speed","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"returns mutated act_tbl new column representing speed, meters per second. See vignette(\"pace\") examples.","code":""},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"","code":"mutate_with_speed(df, method = c(\"2D\", \"3D\"), lead = 0, lag = 1)"},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"df act_tbl object method \"2D\" (default), ignores elevation. \"3D\", includes elevation. \"3D\" often necessary, skiing activities likely yield accurate value. lead far ahead look \"end\" point. lag far behind look \"start\" point.","code":""},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"act_tbl, new speed column, meters per second.","code":""},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"speed determined looking time difference current point previous point: hence, always NA first row data frame. lead lag values helpful get \"smoother\" values, especially provided activity file GPS errors .","code":""},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"","code":"example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) example_act_tbl <- parse_gpx(example_gpx_file) example_act_tbl_with_speed <- mutate_with_speed(example_act_tbl) example_act_tbl_with_speed #> # A tibble: 4,433 × 5 #> lat lon ele time speed #> #> 1 37.8 -122. 17 2018-11-03 14:24:45 NA #> 2 37.8 -122. 16.8 2018-11-03 14:24:46 1.87 #> 3 37.8 -122. 17 2018-11-03 14:24:48 2.25 #> 4 37.8 -122. 17 2018-11-03 14:24:49 2.90 #> 5 37.8 -122. 17.2 2018-11-03 14:24:50 3.05 #> 6 37.8 -122. 17.6 2018-11-03 14:24:51 3.06 #> 7 37.8 -122. 17.4 2018-11-03 14:24:52 3.01 #> 8 37.8 -122. 17.4 2018-11-03 14:24:53 2.71 #> 9 37.8 -122. 17.4 2018-11-03 14:24:54 2.74 #> 10 37.8 -122. 17.4 2018-11-03 14:24:55 2.68 #> # ℹ 4,423 more rows"},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":null,"dir":"Reference","previous_headings":"","what":"Format pace durations — pace_formatter","title":"Format pace durations — pace_formatter","text":"pace_formatter takes pace duration returns formatted string.","code":""},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format pace durations — pace_formatter","text":"","code":"pace_formatter(pace)"},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format pace durations — pace_formatter","text":"pace lubridate duration, returned lubridate::duration methods family.","code":""},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format pace durations — pace_formatter","text":"formatted string representing pace.","code":""},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Format pace durations — pace_formatter","text":"useful plotting pace one axes graph; rather \"number seconds\" axis value, method can convert readable format. commonly, using something like ggplot2::scale_y_reverse(label = pace_formatter) ensure y-axis goes \"slowest\" \"fastest\", shows paces like \"8:30\" rather \"510\"","code":""},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Format pace durations — pace_formatter","text":"","code":"pace_formatter(lubridate::dseconds(380)) #> [1] \"6:20\" pace_formatter(lubridate::dseconds(510)) #> [1] \"8:30\" pace_formatter(lubridate::dseconds(680)) #> [1] \"11:20\""},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":null,"dir":"Reference","previous_headings":"","what":"Parses a GPX file into a act_tbl — parse_gpx","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"parses standard GPS Exchange Format XML (GPX) file data frame class act_tbl. See vignette(\"parsing\") examples.","code":""},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"","code":"parse_gpx(filename, detail = c(\"basic\", \"latlon\", \"advanced\"), every = NA)"},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"filename GPX file parse detail much detail parse GPX. basic (default), parse lat / lon / ele / time columns. latlon, parse lat/lon. particularly useful GPX files exported without time information, Strava. advanced, load everything basic, plus hr / cad. useful files heart rate cadence information. every Optional. provided, determines frequently points sampled file, 10 provided, every tenth point selected. omitted set 1, every point selected. Must positive integer. useful quickly analyze large file, since parsing much faster skipping 90% data points.","code":""},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"act_tbl one row trackpoint . GPX (modified every), columns determined detail. lat Latitude, double degrees -90 90. lon Longitude, double degrees -180 180. ele Elevation, double meters. time date-time representing time point. hr Heart rate, int beats per minute. cad Cadence, int one-foot steps per minute. Additionally, attributes set returned object containing top level data GPX. NA provided file. filename filename parsed , string. always present, always value filename parameter. time date-time representing time activity. title string. desc string. type string.","code":""},{"path":[]},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"","code":"example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) act_tbl <- parse_gpx(example_gpx_file) print(act_tbl, n = 5) #> # A tibble: 4,433 × 4 #> lat lon ele time #> * #> 1 37.8 -122. 17 2018-11-03 14:24:45 #> 2 37.8 -122. 16.8 2018-11-03 14:24:46 #> 3 37.8 -122. 17 2018-11-03 14:24:48 #> 4 37.8 -122. 17 2018-11-03 14:24:49 #> 5 37.8 -122. 17.2 2018-11-03 14:24:50 #> # ℹ 4,428 more rows attr(act_tbl, \"title\") #> [1] \"Sunrise 15K PR (sub-8:00)\" nrow(parse_gpx(example_gpx_file)) #> [1] 4433 nrow(parse_gpx(example_gpx_file, every = 100)) #> [1] 44 colnames(parse_gpx(example_gpx_file)) #> [1] \"lat\" \"lon\" \"ele\" \"time\" colnames(parse_gpx(example_gpx_file, detail = \"latlon\")) #> [1] \"lat\" \"lon\" colnames(parse_gpx(example_gpx_file, detail = \"advanced\")) #> [1] \"lat\" \"lon\" \"ele\" \"time\" \"hr\" \"cad\""},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":null,"dir":"Reference","previous_headings":"","what":"Parses a TCX file into a act_tbl — parse_tcx","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"parses standard Training Center XML (TCX) file data frame class act_tbl. See vignette(\"parsing\") examples.","code":""},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"","code":"parse_tcx(filename, detail = c(\"basic\", \"latlon\", \"advanced\"), every = NA)"},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"filename TCX file parse detail much detail parse TCX basic (default), parse lat / lon / ele / time columns. latlon, parse lat/lon. particularly useful TCX files exported without time information, Strava. advanced, load everything basic, plus hr / cad. useful files heart rate cadence information. every Optional. provided, determines frequently points sampled file, 10 provided, every tenth point selected. omitted set 1, every point selected. Must positive integer. useful quickly analyze large file, since parsing much faster skipping 90% data points.","code":""},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"act_tbl one row trackpoint TCX (modified every), columns determined detail. lat Latitude, double degrees -90 90. lon Longitude, double degrees -180 180. ele Elevation, double meters. time date-time representing time point. hr Heart rate, int beats per minute. cad Cadence, int one-foot steps per minute. Additionally, attributes set tibble containing top level data TCX. NA provided file. filename filename parsed , string. always present, always value filename parameter. time date-time representing time activity. type string.","code":""},{"path":[]},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"","code":"example_tcx_file <- system.file( \"extdata\", \"running_example.tcx.gz\", package = \"activatr\" ) act_tbl <- parse_tcx(example_tcx_file) print(act_tbl, n = 5) #> # A tibble: 4,442 × 4 #> lat lon ele time #> * #> 1 37.8 -122. 17 2018-11-03 14:24:45 #> 2 37.8 -122. 16.8 2018-11-03 14:24:46 #> 3 37.8 -122. 17 2018-11-03 14:24:48 #> 4 37.8 -122. 17 2018-11-03 14:24:49 #> 5 37.8 -122. 17.2 2018-11-03 14:24:50 #> # ℹ 4,437 more rows attr(act_tbl, \"title\") #> NULL nrow(parse_tcx(example_tcx_file)) #> [1] 4442 nrow(parse_tcx(example_tcx_file, every = 100)) #> [1] 37 colnames(parse_tcx(example_tcx_file)) #> [1] \"lat\" \"lon\" \"ele\" \"time\" colnames(parse_tcx(example_tcx_file, detail = \"latlon\")) #> [1] \"lat\" \"lon\" colnames(parse_tcx(example_tcx_file, detail = \"advanced\")) #> [1] \"lat\" \"lon\" \"ele\" \"time\" \"hr\" \"cad\""},{"path":"https://dschafer.github.io/activatr/reference/running_example_ggmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Precomputed example ggmap — running_example_ggmap","title":"Precomputed example ggmap — running_example_ggmap","text":"precomputed ggmap running_example.gpx, avoid needing API key vignettes, get_ggmap_from_df() requires.","code":""},{"path":"https://dschafer.github.io/activatr/reference/running_example_ggmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Precomputed example ggmap — running_example_ggmap","text":"","code":"running_example_ggmap"},{"path":"https://dschafer.github.io/activatr/reference/running_example_ggmap.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Precomputed example ggmap — running_example_ggmap","text":"object class ggmap (inherits raster) 1280 rows 1280 columns.","code":""},{"path":"https://dschafer.github.io/activatr/reference/running_example_ggmap.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Precomputed example ggmap — running_example_ggmap","text":"result running: setting valid API key.","code":"running_file <- system.file( \"extdata\", \"running_example.gpx\", package = \"activatr\") running_df <- parse_gpx(running_file) running_example_ggmap <- get_ggmap_from_df(running_df)"},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert speed to mile pace — speed_to_mile_pace","title":"Convert speed to mile pace — speed_to_mile_pace","text":"speed_to_mile_pace converts speed (meters per second) mile pace. method vectorized, works column data frame. useful calling mutate_with_speed(), convert speed -commonly-used pace. See vignette(\"pace\") examples.","code":""},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert speed to mile pace — speed_to_mile_pace","text":"","code":"speed_to_mile_pace(speed)"},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert speed to mile pace — speed_to_mile_pace","text":"speed vector doubles representing speed meters per second, mutate_with_speed().","code":""},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert speed to mile pace — speed_to_mile_pace","text":"corresponding vector lubridate::duration values, representing mile pace.","code":""},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert speed to mile pace — speed_to_mile_pace","text":"","code":"speed_to_mile_pace(3) #> [1] \"536.446666666667s (~8.94 minutes)\" speed_to_mile_pace(1) #> [1] \"1609.34s (~26.82 minutes)\""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarizes act_tbl objects. — summary.act_tbl","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"summary.act_tbl returns tibble canonical information activity.","code":""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"","code":"# S3 method for class 'act_tbl' summary(object, full = FALSE, units = c(\"imperial\", \"metric\"), ...)"},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"object object summary desired full Whether every column included, filled NA missing. useful ensure tibble shape every file, allowing eventual use dplyr::bind_rows() purrr::map_dfr() create full summary data set. units units used? \"imperial\" returns distance miles, pace minutes per mile, elevation feet. \"metric\" returns distance kilometers, pace minutes per kilometer, elevation meters. ... Additional arguments.","code":""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"Returns tibble single row, containing summary given act_tbl.","code":""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"designed allow easy creation activity summary data sets mapping summary act_tbl using dplyr::bind_rows(), purrr::map_dfr(), equivalent create complete data set.","code":""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"","code":"example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) act_tbl <- parse_gpx(example_gpx_file) summary(act_tbl) #> # A tibble: 1 × 9 #> Distance Date Time #> #> 1 9.41 2018-11-03 14:24:45 4622s (~1.28 hours) #> # ℹ 6 more variables: AvgPace , MaxPace , ElevGain , #> # ElevLoss , AvgElev , Title if (FALSE) { # \\dontrun{ 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)) } # }"},{"path":[]},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"activatr-020","dir":"Changelog","previous_headings":"","what":"activatr 0.2.0","title":"activatr 0.2.0","text":"CRAN release: 2023-08-22","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"activatr 0.2.0","text":"Require R 4.1, use native pipe rather magrittr.","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"other-improvements-0-2-0","dir":"Changelog","previous_headings":"","what":"Other Improvements","title":"activatr 0.2.0","text":"Use slider::slide_index_mean rather slider::slide_index_dbl. Update documentation part pkgdown site creation. Fix incorrect documentation package (#14).","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"activatr-011","dir":"Changelog","previous_headings":"","what":"activatr 0.1.1","title":"activatr 0.1.1","text":"CRAN release: 2023-05-01 Switch dependency timetk slider avoid unnecessary indirection (#3).","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"activatr-010","dir":"Changelog","previous_headings":"","what":"activatr 0.1.0","title":"activatr 0.1.0","text":"CRAN release: 2021-01-15 Initial release.","code":""}] +[{"path":"https://dschafer.github.io/activatr/articles/activatr.html","id":"getting-gpx-files","dir":"Articles","previous_headings":"","what":"Getting GPX Files","title":"Visualizing Activities with activatr","text":"process get GPX file varies depending service use. Garmin Connect, can click gear menu activity click “Export GPX”. package includes sample GPXs examples.","code":""},{"path":"https://dschafer.github.io/activatr/articles/activatr.html","id":"parsing-gpx-files","dir":"Articles","previous_headings":"","what":"Parsing GPX Files","title":"Visualizing Activities with activatr","text":"Basic parsing GPX file simple: use parse_gpx() function pass name GPX file. parse_gpx() returns act_tbl, column latitude (lat), longitude (lon), elevation (ele, meters), time (time). activatr also overrides summary() create basic one-row tibble summarizing activity. advanced parsing options, see vignette(\"parsing\").","code":"library(activatr) # Get the running_example.gpx file included with this package. filename <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) df <- parse_gpx(filename) summary(df)"},{"path":"https://dschafer.github.io/activatr/articles/activatr.html","id":"analyzing-gpx-files","dir":"Articles","previous_headings":"","what":"Analyzing GPX Files","title":"Visualizing Activities with activatr","text":"Since just tibble, can analyze plot using usual techniques libraries. activatr includes helpers, like mutate_with_speed(), speed_to_mile_pace() pace_formatter() make easier analyze pace using libraries. details helpers, see vignette(\"pace\").","code":"library(ggplot2) library(dplyr) df |> mutate_with_speed(lead = 10, lag = 10) |> mutate(pace = speed_to_mile_pace(speed)) |> filter(as.numeric(pace) < 1200) |> ggplot() + geom_line(aes(x = time, y = as.numeric(pace)), color = \"blue\") + scale_y_reverse(label = pace_formatter) + xlab(\"Time\") + ylab(\"Pace (min/mile)\")"},{"path":"https://dschafer.github.io/activatr/articles/activatr.html","id":"visualizing-gpx-files","dir":"Articles","previous_headings":"","what":"Visualizing GPX Files","title":"Visualizing Activities with activatr","text":"data, ’s useful visualize . basic visualizations work expected data frame: ’s helpful overlay information map. aid , get_ggmap_from_df() wrapper around ggmap::get_map() returns correctly sized zoomed map, atop can visualize track using ggmap::ggmap(). Let’s see start: now map right size visualize run. Putting together, can make nice basic graphic run:","code":"library(ggplot2) qplot(lon, lat, data = df) library(ggmap) ggmap::ggmap(get_ggmap_from_df(df)) + theme_void() ggmap::ggmap(get_ggmap_from_df(df)) + theme_void() + geom_path(aes(x = lon, y = lat), linewidth = 1, data = df, color = \"red\")"},{"path":"https://dschafer.github.io/activatr/articles/parsing.html","id":"parsing-extension-data","dir":"Articles","previous_headings":"","what":"Parsing extension data","title":"Advanced Parsing with activatr","text":"GPX file contains additional extension information, activatr can parse well. case, running_example.gpx contains heart rate, cadence, temperature information. can parse setting detail = \"advanced\" parse_gpx: Now can plots like heart rate time, distribution cadences:","code":"df_advanced <- parse_gpx(filename, detail = \"advanced\") library(ggplot2) library(dplyr) ggplot(df_advanced) + geom_line(aes(x = time, y = hr), color = \"red\") ggplot(filter(df_advanced, cad > 80)) + geom_density(aes(x = cad * 2), fill = \"blue\", bw = 1)"},{"path":"https://dschafer.github.io/activatr/articles/parsing.html","id":"sampling-datapoints","dir":"Articles","previous_headings":"","what":"Sampling datapoints","title":"Advanced Parsing with activatr","text":"’re parsing many GPX files GPX files sampled every second, often don’t need “full resolution” view activity. every argument parse_gpx allows sample points GPX, speeding parsing:","code":"# Parsing as normal gets all of the rows, but takes longer full_time <- system.time({ df_full <- parse_gpx(filename) }) nrow(df_full) #> [1] 4433 full_time #> user system elapsed #> 0.161 0.000 0.161 # Grabbing every hundredth data point runs much faster sample_time <- system.time({ df_sample <- parse_gpx(filename, every = 100) }) nrow(df_sample) #> [1] 44 sample_time #> user system elapsed #> 0.042 0.000 0.042"},{"path":"https://dschafer.github.io/activatr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Daniel Schafer. Author, copyright holder, maintainer.","code":""},{"path":"https://dschafer.github.io/activatr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Schafer D (2024). activatr: Utilities Parsing Plotting Activities. R package version 0.2.1, https://dschafer.github.io/activatr/, https://github.com/dschafer/activatr.","code":"@Manual{, title = {activatr: Utilities for Parsing and Plotting Activities}, author = {Daniel Schafer}, year = {2024}, note = {R package version 0.2.1, https://dschafer.github.io/activatr/}, url = {https://github.com/dschafer/activatr}, }"},{"path":"https://dschafer.github.io/activatr/index.html","id":"activatr-","dir":"","previous_headings":"","what":"Utilities for Parsing and Plotting Activities","title":"Utilities for Parsing and Plotting Activities","text":"activatr (pronounced like word “activator”) library parsing GPX files standard format, manipulating visualizing files.","code":""},{"path":"https://dschafer.github.io/activatr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utilities for Parsing and Plotting Activities","text":"can install released version activatr CRAN : development version GitHub :","code":"install.packages(\"activatr\") # install.packages(\"devtools\") devtools::install_github(\"dschafer/activatr\")"},{"path":"https://dschafer.github.io/activatr/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Utilities for Parsing and Plotting Activities","text":"","code":"library(activatr)"},{"path":"https://dschafer.github.io/activatr/index.html","id":"parsing","dir":"","previous_headings":"Usage","what":"Parsing","title":"Utilities for Parsing and Plotting Activities","text":"activatr contains function parse, analyze, display GPX activities. basic thing can parse GPX file tibble:","code":"# Get the running_example.gpx file included with this package. filename <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) df <- parse_gpx(filename)"},{"path":"https://dschafer.github.io/activatr/index.html","id":"visualizing","dir":"","previous_headings":"Usage","what":"Visualizing","title":"Utilities for Parsing and Plotting Activities","text":"data, can visualize atop map: details use package, check vignette(\"activatr\").","code":"library(ggmap) library(ggplot2) ggmap::ggmap(get_ggmap_from_df(df)) + theme_void() + geom_path(aes(x = lon, y = lat), linewidth = 1, data = df, color = \"red\")"},{"path":"https://dschafer.github.io/activatr/reference/act_tbl-class.html","id":null,"dir":"Reference","previous_headings":"","what":"act_tbl class — act_tbl-class","title":"act_tbl class — act_tbl-class","text":"act_tbl S3 class subclass data.frame tibble.","code":""},{"path":"https://dschafer.github.io/activatr/reference/act_tbl-class.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"act_tbl class — act_tbl-class","text":"nearly every respect, can treated like tibble; however, allows package provide improved summary.act_tbl() function get overview activity.","code":""},{"path":"https://dschafer.github.io/activatr/reference/activatr.html","id":null,"dir":"Reference","previous_headings":"","what":"activatr: Utilities for Parsing and Plotting Activities — activatr","title":"activatr: Utilities for Parsing and Plotting Activities — activatr","text":"contains helpful functions parsing, managing, plotting, visualizing activities, often GPX (GPS Exchange Format) files recorded GPS devices. allows easy parsing source files standard R data formats, along functions compute derived data activity, plot activity variety ways.","code":""},{"path":[]},{"path":"https://dschafer.github.io/activatr/reference/activatr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"activatr: Utilities for Parsing and Plotting Activities — activatr","text":"Maintainer: Daniel Schafer dan.schafer@gmail.com [copyright holder]","code":""},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a map for a given act_tbl — get_ggmap_from_df","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"get_ggmap_from_df takes act_tbl object, computes correct zoom center activity, returns ggmap object zoom center.","code":""},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"","code":"get_ggmap_from_df(df, ...)"},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"df act_tbl object. ... Additional arguments forwarded ggmap::get_googlemap().","code":""},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"ggmap object, result calling ggmap::get_googlemap(), correct center size include entire activity represented act_tbl.","code":""},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"Note since calls ggmap::get_googlemap(), must previously called ggmap::register_google() register API key.","code":""},{"path":[]},{"path":"https://dschafer.github.io/activatr/reference/get_ggmap_from_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a map for a given act_tbl — get_ggmap_from_df","text":"","code":"if (FALSE) { # \\dontrun{ example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) act_tbl <- parse_gpx(example_gpx_file) ggmap::ggmap(get_ggmap_from_df(act_tbl)) } # }"},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":null,"dir":"Reference","previous_headings":"","what":"Localize time zone values — localize_to_time_zone","title":"Localize time zone values — localize_to_time_zone","text":"localize_to_time_zone uses Google Maps Time Zone APIs localize time zone act_tbl. modifies mutated act_tbl time column updated contain absolute time, appropriate time zone activity took place.","code":""},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Localize time zone values — localize_to_time_zone","text":"","code":"localize_to_time_zone(df)"},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Localize time zone values — localize_to_time_zone","text":"df act_tbl object.","code":""},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Localize time zone values — localize_to_time_zone","text":"act_tbl, time column updated local time zone rather UTC.","code":""},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Localize time zone values — localize_to_time_zone","text":"Note avoid overuse APIs, \"approximation\", finds correct time zone first point data frame, assumes points data frame use time zone. Runs time zones (runs cross daylight savings time shifts) hence recorded using consistent, always pointwise correct, timezone. Note must previously called ggmap::register_google() register API key calling .","code":""},{"path":"https://dschafer.github.io/activatr/reference/localize_to_time_zone.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Localize time zone values — localize_to_time_zone","text":"","code":"if (FALSE) { # \\dontrun{ example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) act_tbl <- parse_gpx(example_gpx_file) act_tbl_with_tz <- localize_to_time_zone(act_tbl) } # }"},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":null,"dir":"Reference","previous_headings":"","what":"Augments an act_tbl with a speed column — mutate_with_speed","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"returns mutated act_tbl new column representing speed, meters per second. See vignette(\"pace\") examples.","code":""},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"","code":"mutate_with_speed(df, method = c(\"2D\", \"3D\"), lead = 0, lag = 1)"},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"df act_tbl object method \"2D\" (default), ignores elevation. \"3D\", includes elevation. \"3D\" often necessary, skiing activities likely yield accurate value. lead far ahead look \"end\" point. lag far behind look \"start\" point.","code":""},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"act_tbl, new speed column, meters per second.","code":""},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"speed determined looking time difference current point previous point: hence, always NA first row data frame. lead lag values helpful get \"smoother\" values, especially provided activity file GPS errors .","code":""},{"path":"https://dschafer.github.io/activatr/reference/mutate_with_speed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Augments an act_tbl with a speed column — mutate_with_speed","text":"","code":"example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) example_act_tbl <- parse_gpx(example_gpx_file) example_act_tbl_with_speed <- mutate_with_speed(example_act_tbl) example_act_tbl_with_speed #> # A tibble: 4,433 × 5 #> lat lon ele time speed #> #> 1 37.8 -122. 17 2018-11-03 14:24:45 NA #> 2 37.8 -122. 16.8 2018-11-03 14:24:46 1.87 #> 3 37.8 -122. 17 2018-11-03 14:24:48 2.25 #> 4 37.8 -122. 17 2018-11-03 14:24:49 2.90 #> 5 37.8 -122. 17.2 2018-11-03 14:24:50 3.05 #> 6 37.8 -122. 17.6 2018-11-03 14:24:51 3.06 #> 7 37.8 -122. 17.4 2018-11-03 14:24:52 3.01 #> 8 37.8 -122. 17.4 2018-11-03 14:24:53 2.71 #> 9 37.8 -122. 17.4 2018-11-03 14:24:54 2.74 #> 10 37.8 -122. 17.4 2018-11-03 14:24:55 2.68 #> # ℹ 4,423 more rows"},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":null,"dir":"Reference","previous_headings":"","what":"Format pace durations — pace_formatter","title":"Format pace durations — pace_formatter","text":"pace_formatter takes pace duration returns formatted string.","code":""},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format pace durations — pace_formatter","text":"","code":"pace_formatter(pace)"},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format pace durations — pace_formatter","text":"pace lubridate duration, returned lubridate::duration methods family.","code":""},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format pace durations — pace_formatter","text":"formatted string representing pace.","code":""},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Format pace durations — pace_formatter","text":"useful plotting pace one axes graph; rather \"number seconds\" axis value, method can convert readable format. commonly, using something like ggplot2::scale_y_reverse(label = pace_formatter) ensure y-axis goes \"slowest\" \"fastest\", shows paces like \"8:30\" rather \"510\"","code":""},{"path":"https://dschafer.github.io/activatr/reference/pace_formatter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Format pace durations — pace_formatter","text":"","code":"pace_formatter(lubridate::dseconds(380)) #> [1] \"6:20\" pace_formatter(lubridate::dseconds(510)) #> [1] \"8:30\" pace_formatter(lubridate::dseconds(680)) #> [1] \"11:20\""},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":null,"dir":"Reference","previous_headings":"","what":"Parses a GPX file into a act_tbl — parse_gpx","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"parses standard GPS Exchange Format XML (GPX) file data frame class act_tbl. See vignette(\"parsing\") examples.","code":""},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"","code":"parse_gpx(filename, detail = c(\"basic\", \"latlon\", \"advanced\"), every = NA)"},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"filename GPX file parse detail much detail parse GPX. basic (default), parse lat / lon / ele / time columns. latlon, parse lat/lon. particularly useful GPX files exported without time information, Strava. advanced, load everything basic, plus hr / cad. useful files heart rate cadence information. every Optional. provided, determines frequently points sampled file, 10 provided, every tenth point selected. omitted set 1, every point selected. Must positive integer. useful quickly analyze large file, since parsing much faster skipping 90% data points.","code":""},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"act_tbl one row trackpoint . GPX (modified every), columns determined detail. lat Latitude, double degrees -90 90. lon Longitude, double degrees -180 180. ele Elevation, double meters. time date-time representing time point. hr Heart rate, int beats per minute. cad Cadence, int one-foot steps per minute. Additionally, attributes set returned object containing top level data GPX. NA provided file. filename filename parsed , string. always present, always value filename parameter. time date-time representing time activity. title string. desc string. type string.","code":""},{"path":[]},{"path":"https://dschafer.github.io/activatr/reference/parse_gpx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parses a GPX file into a act_tbl — parse_gpx","text":"","code":"example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) act_tbl <- parse_gpx(example_gpx_file) print(act_tbl, n = 5) #> # A tibble: 4,433 × 4 #> lat lon ele time #> * #> 1 37.8 -122. 17 2018-11-03 14:24:45 #> 2 37.8 -122. 16.8 2018-11-03 14:24:46 #> 3 37.8 -122. 17 2018-11-03 14:24:48 #> 4 37.8 -122. 17 2018-11-03 14:24:49 #> 5 37.8 -122. 17.2 2018-11-03 14:24:50 #> # ℹ 4,428 more rows attr(act_tbl, \"title\") #> [1] \"Sunrise 15K PR (sub-8:00)\" nrow(parse_gpx(example_gpx_file)) #> [1] 4433 nrow(parse_gpx(example_gpx_file, every = 100)) #> [1] 44 colnames(parse_gpx(example_gpx_file)) #> [1] \"lat\" \"lon\" \"ele\" \"time\" colnames(parse_gpx(example_gpx_file, detail = \"latlon\")) #> [1] \"lat\" \"lon\" colnames(parse_gpx(example_gpx_file, detail = \"advanced\")) #> [1] \"lat\" \"lon\" \"ele\" \"time\" \"hr\" \"cad\""},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":null,"dir":"Reference","previous_headings":"","what":"Parses a TCX file into a act_tbl — parse_tcx","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"parses standard Training Center XML (TCX) file data frame class act_tbl. See vignette(\"parsing\") examples.","code":""},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"","code":"parse_tcx(filename, detail = c(\"basic\", \"latlon\", \"advanced\"), every = NA)"},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"filename TCX file parse detail much detail parse TCX basic (default), parse lat / lon / ele / time columns. latlon, parse lat/lon. particularly useful TCX files exported without time information, Strava. advanced, load everything basic, plus hr / cad. useful files heart rate cadence information. every Optional. provided, determines frequently points sampled file, 10 provided, every tenth point selected. omitted set 1, every point selected. Must positive integer. useful quickly analyze large file, since parsing much faster skipping 90% data points.","code":""},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"act_tbl one row trackpoint TCX (modified every), columns determined detail. lat Latitude, double degrees -90 90. lon Longitude, double degrees -180 180. ele Elevation, double meters. time date-time representing time point. hr Heart rate, int beats per minute. cad Cadence, int one-foot steps per minute. Additionally, attributes set tibble containing top level data TCX. NA provided file. filename filename parsed , string. always present, always value filename parameter. time date-time representing time activity. type string.","code":""},{"path":[]},{"path":"https://dschafer.github.io/activatr/reference/parse_tcx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parses a TCX file into a act_tbl — parse_tcx","text":"","code":"example_tcx_file <- system.file( \"extdata\", \"running_example.tcx.gz\", package = \"activatr\" ) act_tbl <- parse_tcx(example_tcx_file) print(act_tbl, n = 5) #> # A tibble: 4,442 × 4 #> lat lon ele time #> * #> 1 37.8 -122. 17 2018-11-03 14:24:45 #> 2 37.8 -122. 16.8 2018-11-03 14:24:46 #> 3 37.8 -122. 17 2018-11-03 14:24:48 #> 4 37.8 -122. 17 2018-11-03 14:24:49 #> 5 37.8 -122. 17.2 2018-11-03 14:24:50 #> # ℹ 4,437 more rows attr(act_tbl, \"title\") #> NULL nrow(parse_tcx(example_tcx_file)) #> [1] 4442 nrow(parse_tcx(example_tcx_file, every = 100)) #> [1] 37 colnames(parse_tcx(example_tcx_file)) #> [1] \"lat\" \"lon\" \"ele\" \"time\" colnames(parse_tcx(example_tcx_file, detail = \"latlon\")) #> [1] \"lat\" \"lon\" colnames(parse_tcx(example_tcx_file, detail = \"advanced\")) #> [1] \"lat\" \"lon\" \"ele\" \"time\" \"hr\" \"cad\""},{"path":"https://dschafer.github.io/activatr/reference/running_example_ggmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Precomputed example ggmap — running_example_ggmap","title":"Precomputed example ggmap — running_example_ggmap","text":"precomputed ggmap running_example.gpx, avoid needing API key vignettes, get_ggmap_from_df() requires.","code":""},{"path":"https://dschafer.github.io/activatr/reference/running_example_ggmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Precomputed example ggmap — running_example_ggmap","text":"","code":"running_example_ggmap"},{"path":"https://dschafer.github.io/activatr/reference/running_example_ggmap.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Precomputed example ggmap — running_example_ggmap","text":"object class ggmap (inherits raster) 1280 rows 1280 columns.","code":""},{"path":"https://dschafer.github.io/activatr/reference/running_example_ggmap.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Precomputed example ggmap — running_example_ggmap","text":"result running: setting valid API key.","code":"running_file <- system.file( \"extdata\", \"running_example.gpx\", package = \"activatr\") running_df <- parse_gpx(running_file) running_example_ggmap <- get_ggmap_from_df(running_df)"},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert speed to mile pace — speed_to_mile_pace","title":"Convert speed to mile pace — speed_to_mile_pace","text":"speed_to_mile_pace converts speed (meters per second) mile pace. method vectorized, works column data frame. useful calling mutate_with_speed(), convert speed -commonly-used pace. See vignette(\"pace\") examples.","code":""},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert speed to mile pace — speed_to_mile_pace","text":"","code":"speed_to_mile_pace(speed)"},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert speed to mile pace — speed_to_mile_pace","text":"speed vector doubles representing speed meters per second, mutate_with_speed().","code":""},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert speed to mile pace — speed_to_mile_pace","text":"corresponding vector lubridate::duration values, representing mile pace.","code":""},{"path":"https://dschafer.github.io/activatr/reference/speed_to_mile_pace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert speed to mile pace — speed_to_mile_pace","text":"","code":"speed_to_mile_pace(3) #> [1] \"536.446666666667s (~8.94 minutes)\" speed_to_mile_pace(1) #> [1] \"1609.34s (~26.82 minutes)\""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarizes act_tbl objects. — summary.act_tbl","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"summary.act_tbl returns tibble canonical information activity.","code":""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"","code":"# S3 method for class 'act_tbl' summary(object, full = FALSE, units = c(\"imperial\", \"metric\"), ...)"},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"object object summary desired full Whether every column included, filled NA missing. useful ensure tibble shape every file, allowing eventual use dplyr::bind_rows() purrr::map_dfr() create full summary data set. units units used? \"imperial\" returns distance miles, pace minutes per mile, elevation feet. \"metric\" returns distance kilometers, pace minutes per kilometer, elevation meters. ... Additional arguments.","code":""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"Returns tibble single row, containing summary given act_tbl.","code":""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"designed allow easy creation activity summary data sets mapping summary act_tbl using dplyr::bind_rows(), purrr::map_dfr(), equivalent create complete data set.","code":""},{"path":"https://dschafer.github.io/activatr/reference/summary.act_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarizes act_tbl objects. — summary.act_tbl","text":"","code":"example_gpx_file <- system.file( \"extdata\", \"running_example.gpx.gz\", package = \"activatr\" ) act_tbl <- parse_gpx(example_gpx_file) summary(act_tbl) #> # A tibble: 1 × 9 #> Distance Date Time #> #> 1 9.41 2018-11-03 14:24:45 4622s (~1.28 hours) #> # ℹ 6 more variables: AvgPace , MaxPace , ElevGain , #> # ElevLoss , AvgElev , Title if (FALSE) { # \\dontrun{ 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)) } # }"},{"path":[]},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"other-improvements-0-2-1","dir":"Changelog","previous_headings":"","what":"Other Improvements","title":"activatr 0.2.1","text":"Remove lintr styler dependencies (#17).","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"activatr-020","dir":"Changelog","previous_headings":"","what":"activatr 0.2.0","title":"activatr 0.2.0","text":"CRAN release: 2023-08-22","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"activatr 0.2.0","text":"Require R 4.1, use native pipe rather magrittr.","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"other-improvements-0-2-0","dir":"Changelog","previous_headings":"","what":"Other Improvements","title":"activatr 0.2.0","text":"Use slider::slide_index_mean rather slider::slide_index_dbl. Update documentation part pkgdown site creation. Fix incorrect documentation package (#14).","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"activatr-011","dir":"Changelog","previous_headings":"","what":"activatr 0.1.1","title":"activatr 0.1.1","text":"CRAN release: 2023-05-01 Switch dependency timetk slider avoid unnecessary indirection (#3).","code":""},{"path":"https://dschafer.github.io/activatr/news/index.html","id":"activatr-010","dir":"Changelog","previous_headings":"","what":"activatr 0.1.0","title":"activatr 0.1.0","text":"CRAN release: 2021-01-15 Initial release.","code":""}]
Schafer D (2024). activatr: Utilities for Parsing and Plotting Activities. -R package version 0.2.0.9000, +R package version 0.2.1, https://dschafer.github.io/activatr/, https://github.com/dschafer/activatr.
@Manual{, title = {activatr: Utilities for Parsing and Plotting Activities}, author = {Daniel Schafer}, year = {2024}, - note = {R package version 0.2.0.9000, + note = {R package version 0.2.1, https://dschafer.github.io/activatr/}, url = {https://github.com/dschafer/activatr}, }
lintr
styler
CRAN release: 2023-08-22