Get column index for codebook variables in a list of data frames
Source:R/access_controlled_vocab.R
get_col_index.Rd
This function is used to get the column index numbers for selected columns. The index vectors are used to set column styling for Excel data templates, i.e. highlighting required columns. Invalid codebook_names will throw an error.
Arguments
- datalist
A list of dataframes with columns that match codebook variables
- db_folder
A string path to the database controlled vocabulary folder
- codebook_name
A string denoting the book name. Use
list_db_books()
to see options- required_only
A logical, FALSE returns all columns; TRUE returns required columns only
- crop_types
A vector containing the crop_types. This is used to select the appropriate traits if codebook_name == "trial_data"
See also
Other access codebook functions:
get_variety_db()
,
list_db_books()
,
list_db_var()
,
readin_db()