1
I received a data frame with the coordinates of the schools of the city of São Paulo. They were separated by dot in the thousands, as a number -23,456,789. Thus, R reads the value as Chr.
There were also cases where the coordinate had fewer characters and the punctuation was (perhaps automatically) incorrectly placed -2,345,678.
However, for st_to_sf to read and transform into geospatial coordinates it is necessary that it is numerical and that there is only one point (in my case, at all times after the first two paragraphs, e.g. -23.456789)
How to format coordinates to decimal points after the first two characters?
I don’t understand your line
y <- gsub("\\.", "", sub("(^-*\\d+)\\.", "\\1,", x))
I tested like thisy <- gsub("\\.", "", sub("\\.", ",", x))
and gave the same result– A Neto
@See now, I think you’re okay.
– Rui Barradas