Skip to content

Commit

Permalink
Update stations_ogimet.R
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad authored May 10, 2024
1 parent 9c168a6 commit 7b7898c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/stations_ogimet.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ stations_ogimet_bp = function(country = country, date = date, add_map = add_map)
pattern = paste0(" (", gsub(x = country, pattern = "+", replacement = " ", fixed = TRUE))
b22 = unlist(lapply(gregexpr(pattern = pattern, b1[[1]], fixed = TRUE), function(x) x[1]))

b1 = data.frame(str = b1[[1]], start = b21, stop = b22, stringsAsFactors = FALSE)
b1 = data.frame(str = b1[[1]], start = b21, stop = b22 - 1, stringsAsFactors = FALSE)

res = substr(b1$str, b1$start, b1$stop)

station_names = unlist(lapply(strsplit(res, " - "), function(x) x[length(x)]))
Expand Down

0 comments on commit 7b7898c

Please sign in to comment.