moveSession: Reschedule a session within a plan

Description Usage Arguments Examples

View source: R/helper.R

Description

Add a training session to a new or existing weekly plan

Usage

1
2
3
4
5
6
7
8
moveSession(
  weeklyPlan,
  fromDay,
  fromSessionNumber,
  toDay,
  toSessionNumber = NA,
  swap = TRUE
)

Arguments

weeklyPlan

(weekPlan) An object with the weekly training plan. If NULL, a new one will be created

fromDay

(character) The day of the week where the training session was scheduled

fromSessionNumber

(numeric) The session number for fromDay, 1 or 2

toDay

(character) The day of the week where to move the training session

toSessionNumber

(numeric) The session number for that toDay, 1 or 2

swap

(logic) If TRUE, replace the TO session with the FROM and the FROM with an epty session, if FALSE swaps sessions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
##set the run threshold to 4:30
myThreshold <- addThreshold(sport = 'run', metric = 'pace', value = '4:30')
##set the bike threshold to 250
myThreshold <- addThreshold(sport = 'bike', metric = 'power', value = 250, userSettings = myThreshold)
##create a brick session
newSession <- createSession(sports=list('run', 'bike'),
                           minTargetZ = list(c(20, 30), 60), targetZ = list(c('4:20', '4:40'), 250),
                           metric = list('pace', 'power'), userSettings = myThreshold, TSS = list(NA, NA),
                           description = 'making a test session')
# create a new plan
newPlan <- storeSettings(myThreshold)
##add to the plan monday
newPlan <- addSessionToPlan(weeklyPlan = newPlan, session = newSession, day = 'monday')
newSession <- createSession(sports=list('swim'),
                           minTargetZ = list(NA), targetZ = list(NA),
                           metric = list(NA), userSettings = myThreshold, TSS = list(80),
                           description = 'making a swim session')
newPlan <- addSessionToPlan(weeklyPlan = newPlan, session = newSession, day = 'sunday')
# swap sessions
newPlan <- moveSession(weeklyPlan = newPlan, fromDay = 'monday', fromSessionNumber = 1,
toDay = 'sunday', toSessionNumber = 1, swap = TRUE)
# move a single session
newPlan <- moveSession(weeklyPlan = newPlan, fromDay = 'monday', fromSessionNumber = 1,
toDay = 'tuesday', swap = FALSE)

theasjblog/tssPlanner_package documentation built on March 8, 2020, 2:36 a.m.