Skip to content

Commit 8079973

Browse files
committed
load_tree_data(): fix PLT_CN conversion to character when necessary
1 parent 85e2d53 commit 8079973

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

R/load_tree_data.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ load_tree_data <- function(src, table = NULL, columns = DEFAULT_TREE_COLUMNS,
233233
class(d) <- "data.frame"
234234
attr(d, "gis") <- NULL
235235

236-
if ("PLT_CN" %in% colnames(d) && storage.mode(d$PLT_CN) != "character")
237-
storage.mode(d$PLT_CN) <- "character"
236+
if ("PLT_CN" %in% colnames(d) && !is.character(d$PLT_CN))
237+
d$PLT_CN <- as.character(d$PLT_CN)
238238

239239
if (nrow(d) == 0)
240240
cli::cli_alert_danger("No tree records were returned")

0 commit comments

Comments
 (0)