Cirad-ASTRE / mapMCDA

Produce an epidemiological risk map by weighting multiple risk factors
https://umr-astre.pages.mia.inra.fr/mapMCDA/
1 stars 2 forks source link

load_layer() fails to load csv files with integer columns #15

Closed famuvie closed 5 years ago

famuvie commented 5 years ago
library(mapMCDA)
td <- data.frame(
  from = LETTERS[1:3],
  to = LETTERS[2:4],
  fx = 1:3 + .1,   # double
  fy = 1:3L,       # int
  tx = 2:4 + .1,
  ty = c(2:3, 1),
  hc = 10 * (1:3)
)
tf <- tempfile(fileext = ".csv")
write.csv(td, tf, row.names = FALSE)

n1 <- load_layer(tf)
#> Error in class(dat[vapply(dat, is.integer, T)]) <- "numeric": (list) object cannot be coerced to type 'double'

Created on 2019-04-06 by the reprex package (v0.2.0).