Skip to contents

The census fields of "INTPTLAT" and "INTPTLON" contain "+" and "-" characters. For this reason, sf::read_sf interprets them as character, not numeric, columns. This function rectifies that.

Usage

fix_latlong_to_numeric(.features)

Arguments

.features

a tibble with fields that start with "INTPT"

Value

the same tibble, but with those fields converted to numbers

Examples

data.frame(
  INTPTLAT = c("-4.4", "+3.3", "-2.2", "+1.1"),
  INTPTLON = c(3, 1, 4, 1)
) |>
fix_latlong_to_numeric()
#>   INTPTLAT INTPTLON
#> 1     -4.4        3
#> 2      3.3        1
#> 3     -2.2        4
#> 4      1.1        1