mmp_alldata_update: Returns the mean maximum power updated for a set of training...

Description Usage Arguments Details Value Author(s) Examples

View source: R/mmp_alldata_update.R

Description

Returns the moving maximum power for a bunch of activities, using the power data second-by-second, from all durations to the length of the training sessions. It adds mean maximum power information from new training sessions, based on an older one.

Usage

1
mmp_alldata_update(dates_list_updt, dates_list, power_list_updt, mmp_alldata)

Arguments

dates_list_updt

The dates and time vector from a period of training.

dates_list

The older dates and time vector from a period of training.

power_list_updt

A list containing the vector power data from a set of training sessions.

mmp_alldata

The older mean maximum power data calculated before.

Details

It's good to use with get_power_data() within Golden Cheetah.

Value

It gives the mean maximum power for each activity within the power list.

Author(s)

Natan Freitas Leite.

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## The function is currently defined as
function (dates_list_updt, dates_list, power_list_updt, mmp_alldata)
{
    updt = length(which(!(dates_list_updt %in% dates_list))) ==
        0
    if (updt) {
        mmp_alldata_updt = mmp_alldata
    }
    else {
        mmp_updt = list()
        condition = which(!(dates_list_updt %in% dates_list))
        for (i in condition) {
            mmp_updt[[i]] = mmp_act(power_list_updt[[i]])
        }
        mmp_alldata_updt = list()
        l_lu = length(list_updt)
        condition_2 = which((list_updt %in% list))
        for (i in 1:l_lu) {
            if (i %in% condition) {
                mmp_alldata_updt[[i]] = mmp_alldata[[which(list ==
                  list_updt[i])]]
            }
            else {
                mmp_alldata_updt[[i]] = mmp_updt[[i]]
            }
        }
      print(i)
    }
    return(mmp_alldata_updt)
  }

  data(dates_list_updt)
  data(power_list)
  data(mmp_alldata)

  dates_list=dates_list_updt[-431]
  mmp_alldata=mmp_alldata[1:430]

  mmp_sessions=mmp_alldata_update(dates_list_updt,dates_list,power_list_updt,mmp_alldata)
  plot(mmp_sessions[[1]])

Bolshom/optimumtt documentation built on May 24, 2019, 8:56 a.m.