Title: | Maximal Fat Oxidation and Kinetics Calculation |
---|---|
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>. |
Authors: | Jorge R Fernandez-Santos [aut, cre]
|
Maintainer: | Jorge R Fernandez-Santos <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-02-28 03:01:34 UTC |
Source: | https://github.com/jorgedelro/mfo |
A dataframe with the results of a test to assess basal metabolism
data(basal_df)
data(basal_df)
A data frame with 88 rows and 8 variables:
time test, in minutess
heart rate, in beats/min
volume of oxygen consumption, in ml/min
volume of exhaled carbon dioxide, in ml/min
respiratory exchange ratio
breathe frequency, in breaths/min
ventilation, in l/min
end-tidal carbondioxide pressure, in mmHg
Calculate steps
calculate_steps(step_time, db, db_type)
calculate_steps(step_time, db, db_type)
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
calculate_vars(step_time, db_MFO, VO2max, author)
calculate_vars(step_time, db_MFO, VO2max, author)
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
get_5min(db, cv_var, n_row)
get_5min(db, cv_var, n_row)
db |
a database |
cv_var |
variable to calculate coefficient of variation |
n_row |
number of rows |
Basal metabolic rate
met_basal(step_time, db, cv_var)
met_basal(step_time, db, cv_var)
step_time |
how often the data was collected (in seconds). |
db |
a database |
cv_var |
variable to calculate coefficient of variation |
Maximal Fat Oxidation & Fat Max Function
MFO( step_time, db_MFO, db_basal, db_graded = NULL, cv_var, author, VO2max = NULL )
MFO( step_time, db_MFO, db_basal, db_graded = NULL, cv_var, author, VO2max = NULL )
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. |
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.
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read dfs data(list = c("basal_df", "MFO_df", "VO2max_df"), package = "MFO") # Convert to data.frame basal_df <- data.frame(basal_df) MFO_df <- data.frame(MFO_df) VO2max_df <- data.frame(VO2max_df) # Calculate MFO and Fatmax result_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 directory setwd(oldwd) ## End(Not run)
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read dfs data(list = c("basal_df", "MFO_df", "VO2max_df"), package = "MFO") # Convert to data.frame basal_df <- data.frame(basal_df) MFO_df <- data.frame(MFO_df) VO2max_df <- data.frame(VO2max_df) # Calculate MFO and Fatmax result_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 directory setwd(oldwd) ## End(Not run)
A dataframe with the results of a test to assess MFO metabolism
data(MFO_df)
data(MFO_df)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 45 rows and 8 columns.
time test, in minutess
heart rate, in beats/min
volume of oxygen consumption, in ml/min
volume of exhaled carbon dioxide, in ml/min
respiratory exchange ratio
ventilation, in l/min
end-tidal carbondioxide pressure, in mmHg
Maximal Fat Oxidation Kinetics
MFO_kinetics(MFO_data)
MFO_kinetics(MFO_data)
MFO_data |
a data frame obtained from MFO function |
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.
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read dfs data(list = c("basal_df", "MFO_df", "VO2max_df"), package = "MFO") # Convert to data.frame basal_df <- data.frame(basal_df) MFO_df <- data.frame(MFO_df) VO2max_df <- data.frame(VO2max_df) # Calculate MFO and Fatmax result_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 Kinetics result_MFO_kinetics <- MFO_kinetics(result_MFO$MFO_db) # set user working directory setwd(oldwd) ## End(Not run)
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read dfs data(list = c("basal_df", "MFO_df", "VO2max_df"), package = "MFO") # Convert to data.frame basal_df <- data.frame(basal_df) MFO_df <- data.frame(MFO_df) VO2max_df <- data.frame(VO2max_df) # Calculate MFO and Fatmax result_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 Kinetics result_MFO_kinetics <- MFO_kinetics(result_MFO$MFO_db) # set user working directory setwd(oldwd) ## End(Not run)
Maximal Fat Oxidation calculation of multiple databases
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 )
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 )
from |
select or folder (basal, MFO and graded databases of the same participant are store in different files but in the same folder) or files (basal, MFO and graded databases of the same 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. |
This function creates an .xlsx file in the working directory with the following 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.
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Create path to store databases dir.create(paste(getwd(),"/MFO_databases", sep = "")) # Get path to databases path <- paste(getwd(),"/MFO_databases", sep = "") # MFOs function # "path" is the path to the databases MFOs <- 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 directory setwd(oldwd) ## End(Not run)
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Create path to store databases dir.create(paste(getwd(),"/MFO_databases", sep = "")) # Get path to databases path <- paste(getwd(),"/MFO_databases", sep = "") # MFOs function # "path" is the path to the databases MFOs <- 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 directory setwd(oldwd) ## End(Not run)
Read databases for MFO package
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 )
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 )
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 |
Returns 3 databases:
participant_db_basal: database with basal metabolism.
participant_db_MFO: database with MFO test.
participant_db_graded: graded exercise test.
A dataframe with the results of a graded exercise test
data(VO2max_df)
data(VO2max_df)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 30 rows and 9 columns.
time test, in minutess
heart rate, in beats/min
Load of the test, in watts
volume of oxygen consumption, in ml/min
volume of exhaled carbon dioxide, in ml/min
respiratory exchange ratio
ventilation, in l/min
end-tidal carbondioxide pressure, in mmHg