deleteSession: Delete a session from a plan

Description Usage Arguments Examples

View source: R/helper.R

Description

Delete a training session from weekly plan

Usage

1
deleteSession(weeklyPlan, day, sessionNumber)

Arguments

weeklyPlan

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

day

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

sessionNumber

(numeric) the session id to delete

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
##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')
##add to the plan sunday
newPlan <- addSessionToPlan(weeklyPlan = newPlan, session = newSession, day = 'sunday')
cat(summary(newPlan))
##delete the session
newPlan <- deleteSession(weeklyPlan = newPlan, day = 'monday', sessionNumber = 1)
cat(summary(newPlan))

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