0

I tired to run install_github("dkahle/ggmap"), but it seems like there is an error when I try to install the ggmap.

install.packages("devtools")
library(devtools)
install_github("dkahle/ggmap", ref = "tidyup")

Here is the error message I get in my console when running the install_github code.

Downloading GitHub repo dkahle/ggmap@tidyup
tar: Failed to set default locale
tar: Failed to set default locale
These packages have more recent versions available.
Which would you like to update?

1:   mime    (0.5   -> 0.6) [CRAN]
2:   openssl (1.0.2 -> 1.1) [CRAN]
3:   CRAN packages only
4:   All
5:   None

Enter one or more numbers separated by spaces, or an empty line to cancel
1: 5
v  checking for file '/private/var/folders/c2/98cb8xgx7m92m7x7g_ffthy00000gn/T/RtmpiOyVaS/remotes3326374be9c6/dkahle-ggmap-4dfe516/DESCRIPTION'
   During startup - Warning messages:
   1: Setting LC_CTYPE failed, using "C" 
   2: Setting LC_TIME failed, using "C" 
   3: Setting LC_MESSAGES failed, using "C" 
   4: Setting LC_MONETARY failed, using "C" 
-  preparing 'ggmap':
v  checking DESCRIPTION meta-information
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
   Removed empty directory 'ggmap/.github'
-  looking to see if a 'data/datalist' file should be added
-  building 'ggmap_2.7.904.tar.gz' (694ms)

Error: (converted from warning) Setting LC_CTYPE failed, using "C"
Execution halted
Error in i.p(...) : 
  (converted from warning) installation of package '/var/folders/c2/98cb8xgx7m92m7x7g_ffthy00000gn/T//RtmpiOyVaS/file332666bc795e/ggmap_2.7.904.tar.gz' had non-zero exit status
Ola
  • 81
  • 1
  • 8

1 Answers1

1

Looks like a Mac locale issue.

Run defaults write org.R-project.R force.LANG en_US.UTF-8 in Terminal.

Source

Roman
  • 4,744
  • 2
  • 16
  • 58
  • It seems like it worked; but it came with another problem. I try to run register_google(key = "my_api_key"), with my API key from google, but i get the error "could not find function "register_google"" – Ola Nov 25 '18 at 19:21
  • Then you don’t have the GitHub version of ggmap. It’s part of the latest Github release, but not on CRAN. – Roman Nov 25 '18 at 19:51
  • How do I get the GitHub version of ggmap? – Ola Nov 25 '18 at 19:54
  • @Ola `devtools::install_github("dkahle/ggmap", ref = "tidyup")` (you need to have the devtools library installed) – Roman Dec 24 '18 at 10:52