Skip to contents

new_config() copies an empty config file template to the current working directory.

Usage

new_config(config_type = c("movement", "holding"))

Arguments

config_type

Character vector representing the type of config file for which to copy the template: one of c("movement", "holding") (default, indicating the combined config file template), "movement" or "holding".

Value

No return value, but new_config() has the effect of writing a YAML-format config file template to the current working directory. If this is successful, a message is printed.

See also

vignette("configurations") for an explanation of the movenet config system.

Other configurations-related functions: change_config(), get_config(), load_config(), save_config(), validate_config()

Examples

# Copy the movement config file template to your working directory
new_config(config_type = "movement")
#> Saved movementconfig_template.yml to working directory. It can be found at: C:/Users/cboga/Documents/movenet/docs/reference/movementconfig_template.yml

# Examine file contents
xfun::file_string(paste0(getwd(),"/movementconfig_template.yml"))
#> movedata_fileopts:
#>   separator:   #Separator (delimiter) character used in movement datafile
#>   encoding:    #Encoding used in movement datafile
#>   decimal:     #Decimal mark used in movement datafile
#>   date_format: #Date format specification used in movement datafile (empty string "" for "%AD" flexible YMD parser, or see ?readr::parse_date for guidance)
#> 
#> movedata_cols:
#>   from:   #Column name or number for Identifier of origin holding/establishment/..
#>   to:     #Column name or number for Identifier of destination holding/establishment/..
#>   date:   #Column name or number for Date of transport (if multiple date types are available, use the one deemed most appropriate)
#>   weight:     #Column name or number for movement weight (e.g. nr of pigs moved)

# Clean-up: Remove the saved file
file.remove(paste0(getwd(),"/movementconfig_template.yml"))
#> [1] TRUE