Hi all. I'm fairly new R and looking to use the oaxaca-blinder decomposition. After i installed the oaxaca package as seen in Hlavac With the package installed when i try to use de data("chicago") i recieved the message:
data("chicago")
Warning message:
In data("chicago") : data set ‘chicago’ not found
Using library("oaxaca") shows this:
library("oaxaca")
Error: package or namespace load failed for ‘oaxaca’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘ggplot2’
In addition: Warning message:
package ‘oaxaca’ was built under R version 3.5.3
I use install.packages("ggplot2") and still Chicago data is not found. I don't know how to proceed. My intention is just to be able to replicate that example.
Hi, thank you for you reply. I paste this and still the data is not available. (oaxaca and ggplot2 packages ara installed)
library(oaxaca)
Error: package or namespace load failed for ‘oaxaca’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘ggplot2’
In addition: Warning message:
package ‘oaxaca’ was built under R version 3.5.3
#>
#> Please cite as:
#> Hlavac, Marek (2018). oaxaca: Blinder-Oaxaca Decomposition in R.
#> R package version 0.1.4. CRAN - Package oaxaca
data(chicago)
Warning message:
In data(chicago) : data set ‘chicago’ not found
head(chicago)
Error in head(chicago) : object 'chicago' not found
Installing package into ‘C:/Users/usuario/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘lifecycle’, ‘rlang’, ‘scales’
There are binary versions available but the source versions are later:
binary source needs_compilation
lifecycle 0.2.0 1.0.1 FALSE
rlang 0.4.5 0.4.12 TRUE
scales 1.1.0 1.1.1 FALSE
ggplot2 3.3.0 3.3.5 FALSE
Binaries will be installed
trying URL https//cran.rstudio.com/bin/windows/contrib/3.5/rlang_0.4.5.zip
Content type 'application/zip' length 1115838 bytes (1.1 MB)
downloaded 1.1 MB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\usuario\AppData\Local\Temp\Rtmp8G2VL1\downloaded_packages
installing the source packages ‘lifecycle’, ‘scales’, ‘ggplot2’
installing source package 'lifecycle' ...
** package 'lifecycle' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'rlang' 0.4.5 is being loaded, but >= 0.4.10 is required
ERROR: lazy loading failed for package 'lifecycle'
removing 'C:/Users/usuario/Documents/R/win-library/3.5/lifecycle'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status
ERROR: dependency 'lifecycle' is not available for package 'scales'
removing 'C:/Users/usuario/Documents/R/win-library/3.5/scales'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
ERROR: dependency 'scales' is not available for package 'ggplot2'
removing 'C:/Users/usuario/Documents/R/win-library/3.5/ggplot2'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\usuario\AppData\Local\Temp\Rtmp8G2VL1\downloaded_packages’
But the snippet is not working , the result is :
Error in library(ggplot2) : there is no package called ‘ggplot2’
So, looks like its not installing anything?
Thanks.
You are getting old package versions because you are installing binaries on a very old R version. For getting the latest package versions either install from source or even better, update R so you can get access to the latest precompiled binaries.