Learn R Programming

febr (version 1.0.1)

header: Get table header

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

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 febr-forum@googlegroups.com if you find any issue.

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).

Details

Standard identification variables

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

See Also

layer, observation

Examples

Run this code
# NOT RUN {
res <- header(dataset = c("ctb0001", "ctb0003"), table = "camada", variable = "ferro", stack = TRUE)
id <- grep("ferro_", colnames(res))
col <- colnames(res)[id]
col[order(col)]
# }

Run the code above in your browser using DataLab