Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating a map with ggmap #1

Closed
lgatto opened this issue Aug 28, 2022 · 2 comments
Closed

Error creating a map with ggmap #1

lgatto opened this issue Aug 28, 2022 · 2 comments

Comments

@lgatto
Copy link

lgatto commented Aug 28, 2022

Not sure if you the package is still maintained, but in case it is, here's the error is reproduced below with the package's test data:

> library(activatr)
> filename <- system.file(
  "extdata",
  "running_example.gpx.gz",
  package = "activatr")
> df <- parse_gpx(filename)
> df
# A tibble: 4,433 × 4
     lat   lon   ele time               
 * <dbl> <dbl> <dbl> <dttm>             
 1  37.8 -122.  17   2018-11-03 14:24:45
 2  37.8 -122.  16.8 2018-11-03 14:24:46
 3  37.8 -122.  17   2018-11-03 14:24:48
 4  37.8 -122.  17   2018-11-03 14:24:49
 5  37.8 -122.  17.2 2018-11-03 14:24:50
 6  37.8 -122.  17.6 2018-11-03 14:24:51
 7  37.8 -122.  17.4 2018-11-03 14:24:52
 8  37.8 -122.  17.4 2018-11-03 14:24:53
 9  37.8 -122.  17.4 2018-11-03 14:24:54
10  37.8 -122.  17.4 2018-11-03 14:24:55
# … with 4,423 more rows
# ℹ Use `print(n = ...)` to see more rows
> get_ggmap_from_df(df)
Source : https://maps.googleapis.com/maps/api/staticmap?center=37.793041,-122.412645&zoom=14&size=640x640&scale=2&maptype=terrain&key=xxx
Error in aperm.default(map, c(2, 1, 3)) : 
  invalid first argument, must be an array
In addition: Warning message:
In get_googlemap(center = center, zoom = zoom, ...) : HTTP 400 Bad Request

Session information

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggmap_3.0.0    ggplot2_3.3.6  activatr_0.1.0 jsonlite_1.8.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9          lubridate_1.8.0     lattice_0.20-45    
 [4] tidyr_1.2.0         listenv_0.8.0       png_0.1-7          
 [7] class_7.3-20        zoo_1.8-10          assertthat_0.2.1   
[10] digest_0.6.29       ipred_0.9-13        utf8_1.2.2         
[13] parallelly_1.32.1   R6_2.5.1            plyr_1.8.7         
[16] hardhat_1.2.0       httr_1.4.4          pillar_1.8.1       
[19] RgoogleMaps_1.4.5.3 rlang_1.0.4         curl_4.3.2         
[22] geosphere_1.5-14    furrr_0.3.1         rpart_4.1.16       
[25] Matrix_1.4-1        slider_0.2.2        splines_4.2.1      
[28] gower_1.0.0         stringr_1.4.1       timetk_2.8.1       
[31] munsell_0.5.0       compiler_4.2.1      pkgconfig_2.0.3    
[34] globals_0.16.0      nnet_7.3-17         tidyselect_1.1.2   
[37] tibble_3.1.8        prodlim_2019.11.13  codetools_0.2-18   
[40] fansi_1.0.3         future_1.27.0       dplyr_1.0.9        
[43] withr_2.5.0         MASS_7.3-58.1       bitops_1.0-7       
[46] recipes_1.0.1       grid_4.2.1          gtable_0.3.0       
[49] lifecycle_1.0.1     DBI_1.1.3           magrittr_2.0.3     
[52] scales_1.2.1        warp_0.2.0          future.apply_1.9.0 
[55] cli_3.3.0           stringi_1.7.8       rsample_1.1.0      
[58] sp_1.5-0            timeDate_4021.104   xml2_1.3.3         
[61] ellipsis_0.3.2      xts_0.12.1          generics_0.1.3     
[64] vctrs_0.4.1         lava_1.6.10         rjson_0.2.21       
[67] tools_4.2.1         glue_1.6.2          purrr_0.3.4        
[70] jpeg_0.1-9          parallel_4.2.1      survival_3.4-0     
[73] colorspace_2.0-3   
@dschafer
Copy link
Owner

dschafer commented May 1, 2023

Oh, shoot, I completely missed this notification. I'm working now to get this package unarchived, and I'll try and get this resolved in the new release as well.

@dschafer
Copy link
Owner

dschafer commented May 1, 2023

Aha, this appears to be dkahle/ggmap#262, and is fixed in ggmap 3.0.1.

@dschafer dschafer closed this as completed May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants