This function checks for the section/nested sections in the config YAML file. Returns TRUE if it exist(s) or FALSE otherwise.

checkSection(object, sectionNames)

# S4 method for Config
checkSection(object, sectionNames)

Arguments

object

object of "Config"

sectionNames

the name of the section or names of the nested sections to look for

Value

a logical indicating whether the section exists

Details

Element indices can be used instead of the actual names, see Examples.

Methods (by class)

  • Config: checks for existence of a section in "Config" objects

Examples

projectConfig = system.file("extdata", "example_peps-master", "example_amendments1", "project_config.yaml", package="pepr") p=Project(projectConfig)
#> Loading config file: /private/var/folders/3f/0wj7rs2144l9zsgxd3jn5nxc0000gn/T/RtmpEYsaEm/temp_libpath43b174cbd72/pepr/extdata/example_peps-master/example_amendments1/project_config.yaml
#> amendments: newLib,newLib2
checkSection(config(p),sectionNames = c("amendments","newLib"))
#> [1] FALSE
checkSection(config(p),sectionNames = c("amendments",1))
#> [1] FALSE