Pre-analysis

File Configuration

Load Packages and Chunk Options

# libraries
library(SLAM)
library(yaml)
#setting global knitr options for r markdown output
knitr::opts_chunk$set(include = FALSE) 
knitr::opts_chunk$set(warning = FALSE) 
knitr::opts_chunk$set(message = FALSE) 
knitr::opts_chunk$set(echo = FALSE) 
knitr::opts_chunk$set(cache = FALSE) 
knitr::opts_chunk$set(autodep = TRUE) 

Create config

# Read in default and config yaml files
default_yaml <- yaml::read_yaml(file = params$default_yaml)
config_yaml <- yaml::read_yaml(file = params$config_yaml)

### Create config by replacing defautl_yaml with config_yaml Values

## make config the default yaml
config <- default_yaml

## if there are values in config_yaml add them to config
in_config <- names(default_yaml) %in% names(config_yaml)
config[in_config] <- config_yaml

File Utilities

Render


Print file parameters

names <- names(params)
param_vec <- unlist(params)

param_df <- data.frame(cbind(names, param_vec), row.names = NULL)
if(length(param_df != 0)){
  names(param_df) <- c("Param Name", "Param Value")
}

param_df

Print config parameters

names <- names(config)
config_vec <- unlist(config)

config_df <- data.frame(cbind(names, config_vec), row.names = NULL)
if(length(config_df != 0)){
  names(config_df) <- c("Config Name", "Config Value")
}

config_df

Analysis



wfmueller29/SLAM documentation built on April 5, 2025, 5:09 a.m.