Skip to content

Commit

Permalink
Remove numbering of queries on progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jan 9, 2024
1 parent 5f9d124 commit e09351c
Show file tree
Hide file tree
Showing 15 changed files with 166 additions and 170 deletions.
1 change: 0 additions & 1 deletion R/geo_lite.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ geo_lite <- function(address,
ad <- key[x]
if (progressbar) {
setTxtProgressBar(pb, x)
cat(paste0(" (", x, "/", ntot, ") "))
}
geo_lite_single(
address = ad,
Expand Down
1 change: 0 additions & 1 deletion R/geo_lite_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ geo_lite_sf <- function(address,
ad <- key[x]
if (progressbar) {
setTxtProgressBar(pb, x)
cat(paste0(" (", x, "/", ntot, ") "))
}
geo_lite_sf_single(
address = ad,
Expand Down
1 change: 0 additions & 1 deletion R/reverse_geo_lite.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ reverse_geo_lite <- function(lat,
all_res <- lapply(seql, function(x) {
if (progressbar) {
setTxtProgressBar(pb, x)
cat(paste0(" (", x, "/", ntot, ") "))
}
rw <- key[x, ]
res_single <- reverse_geo_lite_single(
Expand Down
1 change: 0 additions & 1 deletion R/reverse_geo_lite_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ reverse_geo_lite_sf <- function(lat,
all_res <- lapply(seql, function(x) {
if (progressbar) {
setTxtProgressBar(pb, x)
cat(paste0(" (", x, "/", ntot, ") "))
}
rw <- key[x, ]
res_single <- reverse_geo_lite_sf_single(
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ some_addresses <- tribble(

# geocode the addresses
lat_longs <- geo_lite(some_addresses$addr, lat = "latitude", long = "longitude")
#> | | | 0% | |================= | 33% (1/3) | |================================= | 67% (2/3) | |==================================================| 100% (3/3)
#> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100%
```

Only latitude and longitude are returned from the geocoder service in
Expand All @@ -181,7 +181,7 @@ reverse <- reverse_geo_lite(
lat = lat_longs$latitude, long = lat_longs$longitude,
address = "address_found"
)
#> | | | 0% | |================= | 33% (1/3) | |================================= | 67% (2/3) | |==================================================| 100% (3/3)
#> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100%
```

| address_found | lat | lon |
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -187,7 +187,7 @@
},
"applicationCategory": "cartography",
"keywords": ["r", "geocoding", "openstreetmap", "address", "nominatim", "reverse-geocoding", "rstats", "shapefile", "r-package", "spatial", "cran", "api-wrapper", "api", "gis"],
"fileSize": "251.765KB",
"fileSize": "246.956KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"version": "0.2.1.9000"
},
{
Expand Down
Binary file modified man/figures/README-line-object-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-pizzahut-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-statue_liberty-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/test-geo_lite.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ test_that("Progress bar", {
expect_silent(geo_lite("Madrid", progressbar = TRUE))

# Get a pbar
expect_output(aa <- geo_lite(c("Madrid", "Barcelona")), "1/2")
expect_output(aa <- geo_lite(c("Madrid", "Barcelona")))

# Not
expect_silent(aa <- geo_lite(c("Madrid", "Barcelona"), progressbar = FALSE))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-geo_lite_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ test_that("Progress bar", {
expect_silent(geo_lite_sf("Madrid", progressbar = TRUE))

# Get a pbar
expect_output(aa <- geo_lite_sf(c("Madrid", "Barcelona")), "1/2")
expect_output(aa <- geo_lite_sf(c("Madrid", "Barcelona")))

# Not
expect_silent(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-reverse_geo_lite.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ test_that("Progress bar", {
expect_silent(reverse_geo_lite(lat[1], long[1], progressbar = TRUE))

# Get a pbar
expect_output(aa <- reverse_geo_lite(lat, long), "1/2")
expect_output(aa <- reverse_geo_lite(lat, long))

# Not
expect_silent(aa <- reverse_geo_lite(lat, long, progressbar = FALSE))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-reverse_geo_lite_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ test_that("Progress bar", {
expect_silent(reverse_geo_lite_sf(lat[1], long[1], progressbar = TRUE))

# Get a pbar
expect_output(aa <- reverse_geo_lite_sf(lat, long), "1/2")
expect_output(aa <- reverse_geo_lite_sf(lat, long))

# Not
expect_silent(aa <- reverse_geo_lite_sf(lat, long, progressbar = FALSE))
Expand Down
Loading

0 comments on commit e09351c

Please sign in to comment.