val_psyo: Validate psyo format

Description Usage Arguments Author(s) See Also Examples

View source: R/val_psyo.R

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

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

Author(s)

Benjamin Ziepert. Please send feedback to: feedback-psyosphere@analyse-gps.com.

See Also

val_cname,val_psyo, val_var

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## 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)}
}
## End(Not run)

psyosphere documentation built on July 2, 2020, 12:08 a.m.