Skip to content

Error in validateScalarName using some specific variable names #477

@latot

Description

@latot

Hi, I found this very weird.... when we try to show the map of the next variables, it throws an error, but if you change the variable names then it works:

houses_with_water_inblock <- local({
  geom <- sf::st_sfc(
    sf::st_point(c(0.5, 0.5)),
    sf::st_point(c(-0.5, -0.5))
  )
  sf::st_sf(
    id = seq_len(length(geom)),
    geom = geom
  )
})

houses_without_water_inblock <- local({
  geom <- sf::st_sfc(
    sf::st_point(c(0.3, 0.25/2)),
    sf::st_point(c(-0.3, -0.25/2))
  )
  sf::st_sf(
    id = seq_len(length(geom)),
    geom = geom
  )
})

houses_outblocks <- local({
  geom <- sf::st_sfc(
    sf::st_point(c(0, 2)),
    sf::st_point(c(0, -2))
  )
  sf::st_sf(
    id = seq_len(length(geom)),
    geom = geom
  )
})

mapview::mapview(list(
  houses_with_water_inblock,
  houses_without_water_inblock,
  houses_outblocks
))

writing: substituting ENGCRS["Undefined Cartesian SRS with unknown unit"] for missing CRS
writing: substituting ENGCRS["Undefined Cartesian SRS with unknown unit"] for missing CRS
writing: substituting ENGCRS["Undefined Cartesian SRS with unknown unit"] for missing CRS
Error in validateScalarName(name) : 
  Invalid argument 'name' (must be a non-empty character string and contain no '/' or '\')

If you remove any of the maps will works, edit a name and works.

sessionInfo:

R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Gentoo Linux

Matrix products: default
BLAS:   /usr/lib64/libblas.so.3.12.0 
LAPACK: /usr/lib64/liblapack.so.3.12.0

locale:
 [1] LC_CTYPE=es_CL.utf8       LC_NUMERIC=C             
 [3] LC_TIME=es_CL.utf8        LC_COLLATE=es_CL.utf8    
 [5] LC_MONETARY=es_CL.utf8    LC_MESSAGES=es_CL.utf8   
 [7] LC_PAPER=es_CL.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=es_CL.utf8 LC_IDENTIFICATION=C      

time zone: Chile/Continental
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] utf8_1.2.4         generics_0.1.3     tcltk_4.3.2        class_7.3-22      
 [5] KernSmooth_2.23-22 lattice_0.22-5     digest_0.6.33      magrittr_2.0.3    
 [9] grid_4.3.2         fastmap_1.1.1      jsonlite_1.8.8     e1071_1.7-14      
[13] DBI_1.2.1          promises_1.2.1     fansi_1.0.6        crosstalk_1.2.1   
[17] scales_1.3.0       codetools_0.2-19   jquerylib_0.1.4    cli_3.6.2         
[21] mapview_2.11.2     rlang_1.1.3        units_0.8-5        ellipsis_0.3.2    
[25] munsell_0.5.0      base64enc_0.1-3    tools_4.3.2        raster_3.6-26     
[29] dplyr_1.1.4        colorspace_2.1-0   httpuv_1.6.12      vctrs_0.6.5       
[33] R6_2.5.1           png_0.1-8          stats4_4.3.2       proxy_0.4-27      
[37] lifecycle_1.0.4    classInt_0.4-10    leaflet_2.2.1      htmlwidgets_1.6.3 
[41] pkgconfig_2.0.3    later_1.3.1        terra_1.7-71       pillar_1.9.0      
[45] glue_1.7.0         Rcpp_1.0.12        servr_0.27         sf_1.0-16         
[49] xfun_0.41          tibble_3.2.1       tidyselect_1.2.0   rstudioapi_0.15.0 
[53] farver_2.1.1       htmltools_0.5.7    leafem_0.2.3       satellite_1.0.4   
[57] compiler_4.3.2     sp_2.1-2 

Thx!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions