header: Get table header

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/header.R

Description

Download header data (column names and measurement units) from the layer ("camada") or observation ("observacao") table of one or more datasets contained in the Free Brazilian Repository for Open Soil Data – febr, http://www.ufsm.br/febr. This is useful to check what are the variables contained in a dataset before downloading it via layer or observation.

Usage

1
2
header(dataset, table, variable, stack = FALSE, progress = TRUE,
  verbose = TRUE)

Arguments

dataset

Character vector indicating one or more datasets. Identification codes should be as recorded in http://www.ufsm.br/febr/catalog/. Use dataset = "all" to download all datasets.

table

Character string indicating a table, i.e. the layer table, "camada", or the observation table, "observacao".

variable

(optional) Character vector indicating one or more variables. Accepts only general identification codes, e.g. "ferro" and "carbono". If missing, then a set of standard identification variables is downloaded. Use variable = "all" to download all variables. See ‘Details’ for more information.

stack

(optional) Logical value indicating if tables from different datasets should be stacked on a single table for output. Requires standardization = list(units = TRUE) – see below. Defaults to stack = FALSE, the output being a list of tables.

progress

(optional) Logical value indicating if a download progress bar should be displayed.

verbose

(optional) Logical value indicating if informative messages should be displayed. Generally useful to identify datasets with inconsistent data. Please report to [email protected] if you find any issue.

Details

Standard identification variables

Standard identification variables and their content depend on the chosen table. See documentation of layer and observation.

Value

A list of data frames or a data frame with table header data (column names and measurement units) on the chosen variable(s) of the chosen dataset(s).

Author(s)

Alessandro Samuel-Rosa [email protected]

See Also

layer, observation

Examples

1
2
3
4
res <- header(dataset = c("ctb0001", "ctb0003"), table = "camada", variable = "ferro", stack = TRUE)
id <- grep("ferro_", colnames(res))
col <- colnames(res)[id]
col[order(col)]

samuel-rosa/febr documentation built on Dec. 11, 2018, 1:37 a.m.