Learn R Programming

psyosphere (version 0.1.6)

val_psyo: Validate psyo format

Description

Checks if the provided data frame is conforming to the format that is used by 'psyosphere' and returns a warning or stop if necessary.

Usage

val_psyo(tracks, id = 1, p_id = 1, time = 1, lon = 2, lat = 2)

Arguments

tracks

psyo. The data frame that is to be check if it confirms to the psyo format.

id

numeric. An error with force_id will be reported as stop when 2, warning when 1 or nothing when 0.

p_id

numeric. An error with force_p_id will be reported as stop when 2, warning when 1 or nothing when 0.

time

numeric. An error with force_time will be reported as stop when 2, warning when 1 or nothing when 0.

lon

numeric. An error with force_lon will be reported as stop when 2, warning when 1 or nothing when 0.

lat

numeric. An error with force_lat will be reported as stop when 2, warning when 1 or nothing when 0.

See Also

val_cname,val_psyo, val_var

Examples

Run this code
# NOT RUN {
\dontrun{
# Produce a warning ------------------------------------------------------------
data(psyo)
psyo$time <- NULL # remove time column
e <- val_psyo(psyo); if (e != "") {stop(e)}

# Produce a stop ---------------------------------------------------------------
data(psyo)
psyo$time <- NULL # remove time column
e <- val_psyo(psyo, time = 2); if (e != "") {stop(e)}

# Produce a stop without setting "force" ---------------------------------------
data(psyo)
psyo$lon <- NULL # remove time column
e <- val_psyo(psyo); if (e != "") {stop(e)}
}
# }

Run the code above in your browser using DataLab