Skip to contents

This function checks the condition of a graph object.

Usage

graph_assert(graph, condition = "graph")

Arguments

graph

a GeoPressureR graph object

condition

condition to assert graph for. One of "graph" (default), "movement", or "full".

Value

TRUE if the graph object fulfils the condition, otherwise an error is raised.

Examples

# Load a tag with pressure and light likelihood maps computed with `geopressuretemplate()`
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
  tag <- load_interim("18LX", var = "tag")
})
graph <- graph_create(tag, quiet = TRUE)
graph_assert(graph)
#> [1] TRUE

graph <- graph_set_movement(graph)
graph_assert(graph, "movement")
#> [1] TRUE