get_obs {SticsRFiles} | R Documentation |
Read STICS observation files (*.obs)
Description
Read STICS observation files from a JavaSTICS workspace and store data into a list per usm
Usage
get_obs(
workspace,
usm = NULL,
var = NULL,
dates = NULL,
usms_file = NULL,
javastics = NULL,
verbose = TRUE,
usm_name = lifecycle::deprecated(),
var_list = lifecycle::deprecated(),
dates_list = lifecycle::deprecated(),
usms_filepath = lifecycle::deprecated(),
javastics_path = lifecycle::deprecated()
)
Arguments
Details
The .obs
files names must match USMs names, e.g. for a usm
called "banana", the .obs
file should be named banana.obs
.
For intercrops, the name should be suffixed by "p" for the principal
and "a" for the associated plant.
If usm
is not specified (or equal to NULL
), the
function reads the files from all usms in the workspace
(s).
If usms_file
is provided and if the associated plant file is found,
the plant names in the "Plant" column of the generated data.frame
are either the plant code (as specified in the plant file) or
the name of the plant file, if the plant file is not found.
If usms_file
is not specified, the plants are named "plant_1"
by default (+ "plant_2" for intercrops).
Value
A list, where each element is a data.frame
of observations
for the given usm. The list is named after the USM name.
Intercrops are returned in a single data.frame
, and are identified
using either the "Plant" or "Dominance" columns.
See Details section for more information about the "Plant" column.
Examples
path <- file.path(get_examples_path(file_type = "obs"), "mixed")
# Get observations for all usms, but only banana has observations:
Meas <- get_obs(path)
# Get observations only for banana:
Meas_banana <- get_obs(path, "banana")
## Not run:
# Get observations with real plant names when plant
# folder is not in the workspace:
get_obs(path, "banana", javastics = "/path/to/JavaSTICS/folder")
## End(Not run)