make_vars_list: Make variables list

Description Usage Arguments Details Value See Also Examples

View source: R/make_vars_list.R

Description

Make variables list

Usage

1
2
make_vars_list(data, data_colnames = setdiff(names(data), c("Timestamp",
  "Sample", "Site")))

Arguments

data

data frame with columns of data to describe

data_colnames

a string vector of column names with data values. by default all columns except "Timestamp", "Sample", and "Site" if they are included.

Details

This function creates the object needed for the variables argument in db_insert_results_m, db_insert_results_ts, db_insert_results_samples, db_insert_results_samples_profile, based on a data frame with the data to insert. The data frame supplied should include only the columns with data and optionally a column called Timestamp. For each column of data, provide a unique codename for the variable as well as the term and units from the controlled vocabularies. By default the column name will be used as the variable code.

Value

nested list for each column in data describing variable name and units

See Also

Other interactive helpers: get_site_codes, get_variable_codes

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
ts <- data.frame(
 Timestamp = c(
 "2018-06-27 13:45:00",
 "2018-06-27 13:55:00"),
  "wl" = c(1, 1.5))
vars_list <- make_vars_list(ts)

## End(Not run)

khondula/rodm2 documentation built on Jan. 9, 2020, 1:48 p.m.