Skip to contents

Since schema versions may change during the life cycle of project, it is important that users have access to all schema versions via this package. This function allows you to quickly retrieve whichever version of the data templates you may need.

Usage

wdds_data_templates(version = NULL, file = NULL)

Arguments

version

Character. Version of the wdds deposit. Leave as NULL to see all versions.

file

Character. Specific file from the wdds deposit. Leave as NULL to see all files in a version.

Value

Character. Either version identifiers or file paths.

Details

This function does three things.

  1. Shows all versions of the schema in the package,

  2. Provides paths to all example data files associated with a version of the schema

  3. Provides a specific file path in a specific version of the example data

Examples


# see which versions are in the package

wdds_data_templates()
#> The following versions of the standard are availble in the package:
#>         -  latest
#>         -  v_1_0_0
#>         -  v_1_0_1
#>         -  v_1_0_2
#>         -  v_1_0_3
#> [1] "latest"  "v_1_0_0" "v_1_0_1" "v_1_0_2" "v_1_0_3"

# see files associated with a version

wdds_data_templates(version = "latest")
#> /home/runner/work/_temp/Library/wddsWizard/extdata/wdds_archive/latest/data_templates/disease_data_template.csv
#> /home/runner/work/_temp/Library/wddsWizard/extdata/wdds_archive/latest/data_templates/disease_data_template.xlsx
#> /home/runner/work/_temp/Library/wddsWizard/extdata/wdds_archive/latest/data_templates/project_metadata_template.csv

# get the file path for a specific file

wdds_data_templates(version = "v_1_0_2",file = "disease_data_template.csv")
#> [1] "/home/runner/work/_temp/Library/wddsWizard/extdata/wdds_archive/v_1_0_2/data_templates/disease_data_template.csv"