This avoids the necessary use of quiet = TRUE, stringsAsFactors = FALSE, as_tibble = TRUE with st_read().
This was especially needed as it appeared that the patches element of read_habitatmap_stdized() and read_watersurfaces_hab() had all NA's in the polygon_id column when using options(stringsAsFactors = FALSE) in an R script. That's because the stringsAsFactors argument of previously used st_read() was not set, and it then takes the environment's setting. Consequence: the polygon_id of the polygons element was not automatically set as a factor, resulting in its levels being NULL .
This avoids the necessary use of
quiet = TRUE, stringsAsFactors = FALSE, as_tibble = TRUE
withst_read()
.This was especially needed as it appeared that the patches element of
read_habitatmap_stdized()
andread_watersurfaces_hab()
had allNA
's in thepolygon_id
column when usingoptions(stringsAsFactors = FALSE)
in an R script. That's because thestringsAsFactors
argument of previously usedst_read()
was not set, and it then takes the environment's setting. Consequence: thepolygon_id
of the polygons element was not automatically set as a factor, resulting in its levels beingNULL
.read_sf()
appliesquiet = TRUE, stringsAsFactors = FALSE, as_tibble = TRUE
by default.