createSplits: createSplits

Description Usage Arguments Details Value Examples

Description

Function to split an activity into custom splits

Usage

1
2
3
4
5
createSplits(
  data,
  splitValues,
  type = c("everyKm", "thisKm", "everyMin", "thisMin")[1]
)

Arguments

data

(dataframe) an activity dataframe

splitValues

(numeric vector) the split points

  • To split for distance enter the value in meters, i.e. 1000 to split at every Km

  • To split for distance enter the value in minutes, i.e. 5.5 to split at every 5min30sec

type

(character). one of the following:

  • 'everyKm' to split at every Km, i.e. every 5Km

  • 'thisKm' to split at specific Km values, i.e. 1, 4, 6, 7 Km

  • 'everyMin' to split at every min, i.e. every 5min

  • 'thisMin' to split at specific min, i.e. 1, 4, 6, 7 min

Details

The function uses the provided split values and split type to divide the activity dataframe in a list of dataframes, each one corresponding to a split starting and finishing at the specified times/distances.

Value

The function returns a list of data frames, one for each split

Examples

1
2
3
4
5
gpx <- evenActivity
sp<-createSplits(gpx, 2000, type = "everyKm")
sp<-createSplits(gpx, c(1000, 3000, 4500), type = "thisKm")
sp<-createSplits(gpx, 2, type = "everyMin")
sp<-createSplits(gpx, c(5, 15, 35), type = "thisMin")

theasjblog/tcx_package documentation built on March 13, 2021, 2:24 a.m.