since newest rstudio update ggplot : The downloaded source packages are in ‘/private/var/.../downloaded_packages’ >

ever since I updated rstudio, I have had much trouble with packages I have been using regularly. ggplot2 is the specific question right now. I continue getting the following:

The downloaded source packages are in
‘/private/var/folders/nl/7dfp7f693yb87ntg7qd70s7c0000gn/T/RtmpH2uyJ9/downloaded_packages’

so far I have:
updated the packages if available

installed rlang on its own and prior to ggplot2

other packages like lattice have had a seamless transition to the rstudio update.

I have tried repeatedly to install new packages I did not have and some get the same error as above

I am very new to r. if you are willing to help me, I need specific directions, please assume i know nothing.

part of me wants to go back to the last rstudio where things were smooth: but part of me needs to know what happened, why and step by step how to fix. this is my first question.
thanks in advance

1 Like

Hi @sklinger! Welcome!

That message on its own is not an error — R is just telling you the temporary location where it downloaded the package files it tried to install. The important part is actually everything before that line.

Here are the two things that are most helpful to provide when asking questions about package installation problems:

  1. All the console output you see when you try to install the package
  2. The output of running sessionInfo()

Here is how you should provide that information:

  1. In a new post on a blank line, click the little </> button at the top of the posting box. This will insert a small template with the words “type or paste code here” selected.
  2. Copy the output from the console (no screenshots please!)
  3. Paste the output here, replacing the “type or paste code here” line in the template,

Following these steps makes it easier for helpers to read what you post and keeps the forum software from garbling it :grin:.

I'm glad you are trying to understand how it all works! In the long run, that will make you a more confident R user. You might want to read this: Differentiating R from RStudio. Under normal circumstances, package installation doesn't have anything to do with your version of RStudio, but it can have a lot to do with your version of R.

1 Like

Also the operating system. Linux systems install from the source code and unless you get a message "Error ... non-zero exit status," you're ok. On Mojave, you sometimes have to install from source, but usually it's precompiled binaries, so you see that less often.

One thing to try from the R console or the RStudio console is

install.packages("tidyverse")

which will get you the current version of ggplot, dplyr, tibbles and a host of other tidy goodies.

Yes, but if there is indeed a problem installing ggplot2, the same problem is likely to recur when installing it via tidyverse (and possibly other related problems, as well, due to lots more dependencies attempting to install). tidyverse doesn't (yet!) do any special magic — it's still calling install.packages() under the hood.

1 Like

I guess I like to flush out all the problems at the same time! Tidyverse can be relied on to have all the related dependencies in sync. But, as Justice Holmes said when I was younger

The life of the law has been experience, not logic

hello to both of you technocrat and jcblum and thank you so much for your quick replies:

jcblum,
is the below the correct way to include the info??? I started from the very beginning and then session info... not sure whether to do both.
I am going to read the differentiating r from r studio now

type or paste code here
``
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Warning: namespace ‘ggplot2’ is not available and has been replaced
by .GlobalEnv when processing object ‘CHr_p’
[Workspace loaded from ~/.RData]

> library("ggplot2", lib.loc="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘rlang’ 0.1.6 is being loaded, but >= 0.2.1 is required
In addition: Warning message:
In format.POSIXlt(as.POSIXlt(x), ...) :
  unknown timezone 'zone/tz/2018g.1.0/zoneinfo/America/New_York'
Error: package or namespace load failed for ‘ggplot2’
> install.packages("ggplot2")
also installing the dependency ‘rlang’


  There are binary versions available but the source versions are later:
        binary  source needs_compilation
rlang    0.1.6 0.3.0.1              TRUE
ggplot2  2.2.1   3.1.0             FALSE

Do you want to install from sources the package which needs compilation?
y/n: y
installing the source packages ‘rlang’, ‘ggplot2’

trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.3.0.1.tar.gz'
Content type 'application/x-gzip' length 817008 bytes (797 KB)
==================================================
downloaded 797 KB

trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.1.0.tar.gz'
Content type 'application/x-gzip' length 2863109 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018g.1.0/zoneinfo/America/New_York'
* installing *source* package ‘rlang’ ...
** package ‘rlang’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘rlang’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rlang’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rlang’
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018g.1.0/zoneinfo/America/New_York'
* installing *source* package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘rlang’ 0.1.6 is being loaded, but >= 0.2.1 is required
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/ggplot2’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/ggplot2’
Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/nl/7dfp7f693yb87ntg7qd70s7c0000gn/T/RtmpH2uyJ9/downloaded_packages’
> library("RMySQL", lib.loc="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")
Loading required package: DBI
Warning message:
package ‘RMySQL’ was built under R version 3.3.2 
> conn <- dbConnect(MySQL() , user = 'root' , pwd = 'NYY@NK33s')
Error in .local(drv, ...) : 
  Failed to connect to database: Error: Can't initialize character set unknown (path: compiled_in)
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.14.1 (unknown)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] RMySQL_0.10.13 DBI_1.0.0     

loaded via a namespace (and not attached):
[1] colorspace_1.3-2 scales_0.5.0     lazyeval_0.2.1   plyr_1.8.4       tools_3.3.1      gtable_0.2.0    
[7] Rcpp_0.12.19     grid_3.3.1       munsell_0.5.0

I have never heard of tidyverse until just now. I will see if it is something I need: or are you suggesting to use it solely for it to force open ggpot2?

thanks again

tidyverse is a "meta package" that lets you install and load a bunch of related packages at once. Lots more here: https://www.tidyverse.org

1 Like

Thanks for following the instructions! That was just fine :grin:

The short answer is: you will be much happier if you upgrade your R to the latest version (3.5.1) and then try installing everything again. Because you are on a two-year-old version of R, newer versions of the packages you are trying to install are not available as easy-to-install pre-compiled binaries, and instead must be compiled from source. R is trying to do this, but your computer does not have the proper tools installed. If you update R, then binaries will be available and things will suddenly get a lot easier!

1 Like

jcblum
your instructions were on perfect level for me to follow. I have been using r studio only because it is not as scary looking. I never thought they may be linked in anyway. I am following instructions now and hope this solves issues. I have been trying stuff for about month and half now and very insecure in my knowledge and ability. thanks so much for your clarity.
if you do not mind I will reply when all steps are followed. I am doing laundry so I may need to step out for bit.
stephen

I see you're on Mojave. @jcblum is 100% on about installing pre-build versions of R (from https://goo.gl/alZYVs) and RStudio (from https://goo.gl/XgfRs1).

When installing or updating packages, you may get a message that a later version is available in source form. You will run into difficulties if you haven't installed the latest XCode App (free) from the App Store and then issued the terminal command

$ xcode-select -v

That will work most of the time, but there are a few source packages that won't compile without some serious under-the-hood work best avoided unless you want to do a lot of tinkering with clang, gcc and different flavors and combinations of settings. I used to have to do a lot of that kind of stuff and it can easily consume a day, so I avoid it and just wait until Saint Simon Urbanek does it for us.

You're welcome! Follow-up questions (or reports of spectacular success :smile:) are welcome! The system administration aspects of R are one of the steeper parts of the learning curve, and a common source of trouble for newcomers.

FYI, a new version of R is released every year, usually in April. Pre-compiled binaries of packages are only created for the latest version of R and (often) latest-minus-1. So it's usually a good idea to keep your R installation up to date.

It can eventually be helpful to have the tools for compiling packages yourself installed. If you decide you want to give that a try, just say so and we'll be happy to help you through that, too.

In case you're wondering what this is about, Simon Urbanek is the person who compiles all the R package binaries for Mac that are posted to CRAN. It's a big job, and he does it as a volunteer, hence the sainthood :innocent:.

1 Like

hello guys:

so far I have found quick and easy success: ggplot installed w its dependencies and I used it to do a quick and pretty grap, which I saved you from having to see, although I wouldn't be sure how to include it.
I had to install and load hexbin.
I think I am understanfding that I will need to install each package I have used so far?
thanks so much for your help.

stephen

 version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Workspace loaded from ~/.RData]

> install.packages("ggplot2")
also installing the dependencies ‘glue’, ‘magrittr’, ‘stringi’, ‘colorspace’, ‘assertthat’, ‘fansi’, ‘utf8’, ‘Rcpp’, ‘stringr’, ‘labeling’, ‘munsell’, ‘R6’, ‘RColorBrewer’, ‘cli’, ‘crayon’, ‘pillar’, ‘digest’, ‘gtable’, ‘lazyeval’, ‘plyr’, ‘reshape2’, ‘rlang’, ‘scales’, ‘tibble’, ‘viridisLite’, ‘withr’

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/glue_1.3.0.tgz'
Content type 'application/x-gzip' length 93553 bytes (91 KB)
==================================================
downloaded 91 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/magrittr_1.5.tgz'
Content type 'application/x-gzip' length 152395 bytes (148 KB)
==================================================
downloaded 148 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/stringi_1.2.4.tgz'
Content type 'application/x-gzip' length 13584342 bytes (13.0 MB)
==================================================
downloaded 13.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/colorspace_1.3-2.tgz'
Content type 'application/x-gzip' length 516228 bytes (504 KB)
==================================================
downloaded 504 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/assertthat_0.2.0.tgz'
Content type 'application/x-gzip' length 52476 bytes (51 KB)
==================================================
downloaded 51 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/fansi_0.4.0.tgz'
Content type 'application/x-gzip' length 207507 bytes (202 KB)
==================================================
downloaded 202 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/utf8_1.1.4.tgz'
Content type 'application/x-gzip' length 193968 bytes (189 KB)
==================================================
downloaded 189 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/Rcpp_1.0.0.tgz'
Content type 'application/x-gzip' length 4535632 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/stringr_1.3.1.tgz'
Content type 'application/x-gzip' length 186353 bytes (181 KB)
==================================================
downloaded 181 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/labeling_0.3.tgz'
Content type 'application/x-gzip' length 60579 bytes (59 KB)
==================================================
downloaded 59 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/munsell_0.5.0.tgz'
Content type 'application/x-gzip' length 240174 bytes (234 KB)
==================================================
downloaded 234 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/R6_2.3.0.tgz'
Content type 'application/x-gzip' length 55479 bytes (54 KB)
==================================================
downloaded 54 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/RColorBrewer_1.1-2.tgz'
Content type 'application/x-gzip' length 52941 bytes (51 KB)
==================================================
downloaded 51 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/cli_1.0.1.tgz'
Content type 'application/x-gzip' length 574111 bytes (560 KB)
==================================================
downloaded 560 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/crayon_1.3.4.tgz'
Content type 'application/x-gzip' length 750568 bytes (732 KB)
==================================================
downloaded 732 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/pillar_1.3.0.tgz'
Content type 'application/x-gzip' length 151337 bytes (147 KB)
==================================================
downloaded 147 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/digest_0.6.18.tgz'
Content type 'application/x-gzip' length 187193 bytes (182 KB)
==================================================
downloaded 182 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/gtable_0.2.0.tgz'
Content type 'application/x-gzip' length 85683 bytes (83 KB)
==================================================
downloaded 83 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/lazyeval_0.2.1.tgz'
Content type 'application/x-gzip' length 152654 bytes (149 KB)
==================================================
downloaded 149 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/plyr_1.8.4.tgz'
Content type 'application/x-gzip' length 946407 bytes (924 KB)
==================================================
downloaded 924 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/reshape2_1.4.3.tgz'
Content type 'application/x-gzip' length 286207 bytes (279 KB)
==================================================
downloaded 279 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/rlang_0.3.0.1.tgz'
Content type 'application/x-gzip' length 1074996 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/scales_1.0.0.tgz'
Content type 'application/x-gzip' length 701217 bytes (684 KB)
==================================================
downloaded 684 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/tibble_1.4.2.tgz'
Content type 'application/x-gzip' length 230077 bytes (224 KB)
==================================================
downloaded 224 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/viridisLite_0.3.0.tgz'
Content type 'application/x-gzip' length 57149 bytes (55 KB)
==================================================
downloaded 55 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/withr_2.1.2.tgz'
Content type 'application/x-gzip' length 151252 bytes (147 KB)
==================================================
downloaded 147 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/ggplot2_3.1.0.tgz'
Content type 'application/x-gzip' length 3622365 bytes (3.5 MB)
==================================================
downloaded 3.5 MB


The downloaded binary packages are in
	/var/folders/nl/7dfp7f693yb87ntg7qd70s7c0000gn/T//RtmpfV1cFd/downloaded_packages
> library("ggplot2", lib.loc="/Library/Frameworks/R.framework/Versions/3.5/Resources/library")
> install.packages("hexbin")
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/hexbin_1.27.2.tgz'
Content type 'application/x-gzip' length 838355 bytes (818 KB)
==================================================
downloaded 818 KB


The downloaded binary packages are in
	/var/folders/nl/7dfp7f693yb87ntg7qd70s7c0000gn/T//RtmpfV1cFd/downloaded_packages
> library("hexbin", lib.loc="/Library/Frameworks/R.framework/Versions/3.5/Resources/library")
> ggplot(F4verl, aes(px, pz)) +
+   geom_point() +
+   facet_wrap(~ batter_hand) +
+   coord_equal() +
+   geom_path(aes(x, y), data = kZone, lwd = 2, col = "white")
> ggplot(F4verl, aes(px, pz)) +
+     stat_binhex() +
+     facet_wrap(~ batter_hand) +
+     coord_equal() +
+     geom_path(aes(x, y), data = kZone, lwd = 2, col = "white", alpha = .3)
> 
> 

Hooray! :confetti_ball:

Yes, by default R makes a new library for a new version, so you'll need to reinstall any packages you had installed before. Hopefully it will be relatively painless!

1 Like

no, that will not be a problem at all. and small price to pay if I can get everything running smooth.
I hate to piggyback, but I am going to and let me know if you can help, or I will post a new topic as I am hab=ving another sore spot for days and it is preventing forward movement: I am following a book and it is telling me to use RMysql to work btwn r and MySQL. I just can never connect: the following error. I have signed into MySQL thru terminal w success with this suer and password.
it is my understanding thta RMysql is being replaced. could this be an issue? should I just skip thes instructions from a book a few years old and use new package for MySQl?

sorry to try and piggyback issues. I believe this may be incorrect behavior?

conn <- dbConnect(MySQL() , user = 'root' , pwd = 'NYY@NK33s' , dbname = 'BDB_2011_03_23')


Error in .local(drv, ...) : 
  Failed to connect to database: Error: Plugin caching_sha2_password could not be loaded: dlopen(lib/mariadb/plugin/caching_sha2_password.so, 2): image not found

It will help those who come with the same problem find help faster if you can repost this as a new question.

RMySQL still works, but you're missing a driver and if it's a remote server, a [disguised] hostname.

I'll look out for your post and get you started with a snippet.

1 Like

great thanks techncrat

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.