Skip to content

Commit

Permalink
Update stations_ogimet.R (#91)
Browse files Browse the repository at this point in the history
* Update stations_ogimet.R
* Update DESCRIPTION
---------
Co-authored-by: Bartosz Czernecki <[email protected]>
  • Loading branch information
Nowosad authored May 10, 2024
1 parent 9c168a6 commit 218092b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: climate
Title: Interface to Download Meteorological (and Hydrological) Datasets
Version: 1.1.1
Version: 1.1.2
Authors@R: c(person(given = "Bartosz",
family = "Czernecki",
role = c("aut", "cre"),
Expand Down
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 218092b

Please sign in to comment.