Skip to contents

Extract a subset of environmental data by specifying rows and/or columns.

Usage

envDataSubset(
  env.data = stop("You need to specify the data!", call. = FALSE),
  col.names,
  row.names,
  col.ids,
  row.ids,
  file.out = "my_data_part",
  dir.out = ".",
  overwrite = NULL
)

Arguments

env.data

The dataset (class env.data) from which to extract data.

col.names

Character vector with column names to extract (optional).

row.names

Character vector with row names to extract (optional).

col.ids

Numeric vector with column IDs (optional).

row.ids

Numeric vector with row IDs (optional).

file.out

The base for the output filename (default: "my_data_part").

dir.out

The path to the directory where the output files will be saved.

overwrite

Whether to overwrite the output files: if NULL (default), will prompt the user to give answer; set to TRUE, will automatically overwrite any existing files; and set to FALSE, will stop if the output files exist.

Value

A matrix with the subset of data.

Warning

The parameter col.names cannot be used jointly with col.ids, similarly for the rows!