| Title: | Maximal Fat Oxidation and Kinetics Calculation |
| Version: | 0.1.0 |
| Description: | Calculate the maximal fat oxidation, the exercise intensity that elicits the maximal fat oxidation and the SIN model to represent the fat oxidation kinetics. Three variables can be obtained from the SIN model: dilatation, symmetry and translation. Examples of these methods can be found in Montes de Oca et al (2021) <doi:10.1080/17461391.2020.1788650> and Chenevière et al. (2009) <doi:10.1249/MSS.0b013e31819e2f91>. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| LazyData: | true |
| RoxygenNote: | 7.1.1 |
| URL: | https://github.com/JorgeDelro/MFO |
| BugReports: | https://github.com/JorgeDelro/MFO/issues |
| Imports: | stats, dplyr, ggplot2, magrittr, tibble, minpack.lm, openxlsx,readxl, stringr, tidyr |
| Depends: | R (≥ 2.10) |
| Suggests: | covr, testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2022-02-10 18:15:10 UTC; jorge |
| Author: | Jorge R Fernandez-Santos |
| Maintainer: | Jorge R Fernandez-Santos <jorgedelrosario.fernandez@uca.es> |
| Repository: | CRAN |
| Date/Publication: | 2022-02-11 19:00:13 UTC |
Maximal Fat Oxidation & Fat Max Function
Description
Maximal Fat Oxidation & Fat Max Function
Usage
MFO( step_time, db_MFO, db_basal, db_graded = NULL, cv_var, author, VO2max = NULL)Arguments
step_time | how often the data was collected (in seconds). |
db_MFO | database containing MFO test. |
db_basal | database containing basal test. |
db_graded | database containing incremental exercise test. |
cv_var | variable to estimate coefficient of variation. Can be: VO2, VCO2 or RER. |
author | author to estimate MFO. Can be: Frayn or Jeukendrup. |
VO2max | VO2max can be passed directly using this argument instead of use db_graded argument. |
Value
Returns a list which contains:
MFO_db: database used to create the MFO plot.
MFO_plot: ggplot object with the MFO plot.
MFO: Maximal fat oxidation.
FAT_MAX: Intensity that elicits MFO.
x_CHO: carbohydrates in basal metabolism.
x_FAT: fat in basal metabolism.
x_Kcal: Kcal in basal metabolism.
Examples
## Not run: # Get old working directoryoldwd <- getwd()# Set temporary directorysetwd(tempdir())# Read dfsdata(list = c("basal_df", "MFO_df", "VO2max_df"), package = "MFO")# Convert to data.framebasal_df <- data.frame(basal_df)MFO_df <- data.frame(MFO_df)VO2max_df <- data.frame(VO2max_df)# Calculate MFO and Fatmaxresult_MFO <- MFO(step_time = 20, db_MFO = MFO_df, db_basal = basal_df, db_graded = VO2max_df, cv_var = "RER", author = "Frayn", VO2max = NULL)# set user working directorysetwd(oldwd)## End(Not run)MFO test dataframe
Description
A dataframe with the results of a test to assess MFO metabolism
Usage
data(MFO_df)Format
An object of classtbl_df (inherits fromtbl,data.frame) with 45 rows and 8 columns.
Variables
- Time
time test, in minutess
- HR
heart rate, in beats/min
- VO2
volume of oxygen consumption, in ml/min
- VCO2
volume of exhaled carbon dioxide, in ml/min
- RER
respiratory exchange ratio
- VE
ventilation, in l/min
- PETCO2
end-tidal carbondioxide pressure, in mmHg
Maximal Fat Oxidation Kinetics
Description
Maximal Fat Oxidation Kinetics
Usage
MFO_kinetics(MFO_data)Arguments
MFO_data | a data frame obtained from MFO function |
Value
Returns a list which contains:
MFO_kinetics_data: database used to create the MFO kinetics plot.
MFO_kinetics_plot: ggplot object with the MFO kinetics plot.
d: dilatation.
t: translation.
s: symmetry.
Examples
## Not run: # Get old working directoryoldwd <- getwd()# Set temporary directorysetwd(tempdir())# Read dfsdata(list = c("basal_df", "MFO_df", "VO2max_df"), package = "MFO")# Convert to data.framebasal_df <- data.frame(basal_df)MFO_df <- data.frame(MFO_df)VO2max_df <- data.frame(VO2max_df)# Calculate MFO and Fatmaxresult_MFO <- MFO(step_time = 20, db_MFO = MFO_df, db_basal = basal_df, db_graded = VO2max_df, cv_var = "RER", author = "Frayn", VO2max = NULL)# Calculate MFO Kineticsresult_MFO_kinetics <- MFO_kinetics(result_MFO$MFO_db)# set user working directorysetwd(oldwd)## End(Not run)Maximal Fat Oxidation calculation of multiple databases
Description
Maximal Fat Oxidation calculation of multiple databases
Usage
MFOs( from = c("folder", "files"), path, db_basal_name, db_MFO_name, db_graded_name, step_time, cv_var, author, VO2max = NULL, remove_rows = NULL, col_name_VO2 = "VO2", col_name_VCO2 = "VCO2", col_name_RER = "RER", col_name_HR = "HR", save_plot = TRUE, save_result = TRUE)Arguments
from | select or folder (basal, MFO and graded databases of the same participant are store indifferent files but in the same folder) or files (basal, MFO and graded databases of thesame participant are store in one file but in different sheets) |
path | path to the folder with the databases |
db_basal_name | name given to the basal database, eg: basal_df |
db_MFO_name | name given to the MFO database, eg: MFO_df |
db_graded_name | name given to the graded database, eg: VO2max_df |
step_time | how often the data was collected (in seconds). |
cv_var | variable to estimate coefficient of variation. Can be: VO2, VCO2 or RER. |
author | author to estimate MFO. Can be: Frayn or Jeukendrup. |
VO2max | VO2max can be passed directly using this argument instead of use db_graded argument. Default set to NULL. |
remove_rows | An integer (or a vector of integers) representing the position of the rows to delete |
col_name_VO2 | name given to the variable VO2 in the databases. Must be the same for all databases. Default set to "VO2" |
col_name_VCO2 | name given to the variable VCO2 in the databases. Must be the same for all databases. Default set to "VCO2" |
col_name_RER | name given to the variable RER in the databases. Must be the same for all databases. Default set to "RER" |
col_name_HR | name given to the variable HR in the databases. Must be the same for all databases. Default set to "HR" |
save_plot | to save the plot or not. Default set to True. |
save_result | to save the results in a .xlsx file or not. Default set to True. |
Value
This function creates an .xlsx file in the working directory with thefollowing variables:
MFO_db: database used to create the MFO plot.
MFO_plot: ggplot object with the MFO plot.
MFO: Maximal fat oxidation.
FAT_MAX: Intensity that elicits MFO.
x_CHO: carbohydrates in basal metabolism.
x_FAT: fat in basal metabolism.
x_Kcal: Kcal in basal metabolism.
Examples
## Not run: # Get old working directoryoldwd <- getwd()# Set temporary directorysetwd(tempdir())# Create path to store databasesdir.create(paste(getwd(),"/MFO_databases", sep = ""))# Get path to databasespath <- paste(getwd(),"/MFO_databases", sep = "")# MFOs function# "path" is the path to the databasesMFOs <- function(from = "folder", path = path, db_basal_name = "basal_df", db_MFO_name = "MFO_df", db_graded_name = "graded_df", step_time = 20, cv_var = "RER", author = "Frayn", VO2max = NULL, remove_rows = NULL, col_name_VO2 = "VO2", col_name_VCO2 = "VCO2", col_name_RER = "RER", col_name_HR = "HR", save_plot = TRUE, save_result = TRUE)# set user working directorysetwd(oldwd)## End(Not run)Graded exercise test dataframe
Description
A dataframe with the results of a graded exercise test
Usage
data(VO2max_df)Format
An object of classtbl_df (inherits fromtbl,data.frame) with 30 rows and 9 columns.
Variables
- Time
time test, in minutess
- HR
heart rate, in beats/min
- Load
Load of the test, in watts
- VO2
volume of oxygen consumption, in ml/min
- VCO2
volume of exhaled carbon dioxide, in ml/min
- RER
respiratory exchange ratio
- VE
ventilation, in l/min
- PETCO2
end-tidal carbondioxide pressure, in mmHg
Basal test dataframe
Description
A dataframe with the results of a test to assess basal metabolism
Usage
data(basal_df)Format
A data frame with 88 rows and 8 variables:
- Time
time test, in minutess
- HR
heart rate, in beats/min
- VO2
volume of oxygen consumption, in ml/min
- VCO2
volume of exhaled carbon dioxide, in ml/min
- RER
respiratory exchange ratio
- BF
breathe frequency, in breaths/min
- VE
ventilation, in l/min
- PETCO2
end-tidal carbondioxide pressure, in mmHg
Calculate steps
Description
Calculate steps
Usage
calculate_steps(step_time, db, db_type)Arguments
step_time | how often the data was collected (in seconds). |
db | a database |
db_type | either "basal" or "MFO" |
Calculation of CHO, FAT and Kcal
Description
Calculation of CHO, FAT and Kcal
Usage
calculate_vars(step_time, db_MFO, VO2max, author)Arguments
step_time | how often the data was collected (in seconds). |
db_MFO | dtabase with MFO test |
VO2max | maximum oxygen uptake |
author | eithe "Frayn" or "Jeukendrup" |
Get a 5 minutes database
Description
Get a 5 minutes database
Usage
get_5min(db, cv_var, n_row)Arguments
db | a database |
cv_var | variable to calculate coefficient of variation |
n_row | number of rows |
Basal metabolic rate
Description
Basal metabolic rate
Usage
met_basal(step_time, db, cv_var)Arguments
step_time | how often the data was collected (in seconds). |
db | a database |
cv_var | variable to calculate coefficient of variation |
Read databases for MFO package
Description
Read databases for MFO package
Usage
read_MFO_databases( from = c("folder", "files"), path, db_basal_name, db_MFO_name, db_graded_name, col_name_VO2, col_name_VCO2, col_name_RER, col_name_HR, remove_rows = NULL)Arguments
from | select either from folder or files |
path | path to the the databases |
db_basal_name | name of the database with the basal metabolic rate test |
db_MFO_name | name of the database of MFO test |
db_graded_name | name of the database of the graded exercise test |
col_name_VO2 | name given to the variable VO2 in the databases. Must be the same for all databases. Default set to "VO2" |
col_name_VCO2 | name given to the variable VCO2 in the databases. Must be the same for all databases. Default set to "VCO2" |
col_name_RER | name given to the variable RER in the databases. Must be the same for all databases. Default set to "RER" |
col_name_HR | name given to the variable HR in the databases. Must be the same for all databases. Default set to "HR" |
remove_rows | An integer (or a vector of integers) representing the position of the rows to delete |
Value
Returns 3 databases:
participant_db_basal: database with basal metabolism.
participant_db_MFO: database with MFO test.
participant_db_graded: graded exercise test.