Im want to extract the numbers and add some - (minus) for new variables. Are 1800 rows like that.
test-> structure(list(GNUMBER = c("G12879D", "G13004A", "G51770", "G51771",
"G51772", "G10017", "G12862", "G19898A", "G51361", "G51664B",
"G51665", "G51665A", "G51666", "G51663", "G51663A", "G51664",
"G51664A", "G51653C", "G51652B"), LATITUD = c("18.35N", NA, "20.62N",
"20.62N", "20.62N", "19.00N", "19.78N", "27.34S", "27.39S", "9.90N",
"9.90N", "9.90N", "9.90N", "9.90N", "9.90N", "9.90N", "9.90N",
"9.90N", "9.90N"), LONGITUD = c("99.99W", NA, "101.72W", "101.72W",
"101.72W", "99.11W", "103.11W", "65.96W", "65.98W", "83.93W",
"83.93W", "83.93W", "83.93W", "83.93W", "83.93W", "83.93W", "83.93W",
"83.93W", "83.93W")), class = c("tbl_df", "tbl", "data.frame"
), row.names = c(NA, -19L))
library(tidyverse)
library(stringr)
regexp <- "[^1:9]+$"
test %>%
mutate(LATITUD_NEW = str_extract(test$LATITUD, regexp))
Im want this. Add (-) when the column have a S and W, but no N. Because are the coordinates and need make a map.

