ateucher / rmapshaper

An R wrapper for the mapshaper javascript library
http://andyteucher.ca/rmapshaper/
Other
200 stars 13 forks source link

modification of names with special character #91

Closed sebdalgarno closed 1 year ago

sebdalgarno commented 5 years ago

hi @ateucher I'm not sure if this behaviour is intended, but it caught me a bit off guard.

library(sf)
library(rmapshaper)
nc <- st_read(system.file(package = "sf", "shape/nc.shp"))
nc[["new name"]] <- 1
nc <- nc[, "new name"]

tmp <- ms_simplify(nc)

> names(nc)
[1] "new name" "geometry"
> names(tmp)
[1] "new.name" "geometry"
> 

Is it possible to leave the variable names as they were even if they have special characters?

ateucher commented 5 years ago

I think it should be possible, thanks for reporting this.

ateucher commented 2 years ago

This should be fixed in ongoing work in #118