Problem with the ggplot2 package and the ggpairs command?

Good afternoon,
when running the following script

iris <- read.csv("~/R software/RR SCRIPT/Introduction to course R/iris.csv")
mean(iris$Petal.Length )

ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width))+geom_point()

ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species))+geom_point()

ggplot(iris, aes(x = Petal.Length, fill = Species)) +geom_histogram()

ggplot(iris, aes(x = Petal.Length, fill = Species)) +
  geom_histogram() +
  facet_wrap(~ Species, dir = 'v')

ggpairs(iris, aes(color = Species))

I have the following alert:

ggpairs(iris, aes(color = Species))
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘stringi’

when installing the "stringi" package
I receive the following statements:


  There is a binary version available but the source version is later:
        binary source needs_compilation
stringi  1.1.7  1.2.3              TRUE

installing the source package ‘stringi’

trying URL ''
Content type 'application/x-gzip' length 7270993 bytes (6.9 MB)
downloaded 6.9 MB

* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
Warning in system("sh ./") : 'sh' not found
ERROR: configuration failed for package 'stringi'
* removing 'C:/Program Files/R/R-3.5.0/library/stringi'
Warning in install.packages :
  installation of package ‘stringi’ had non-zero exit status

The downloaded source packages are in

and running the script again repeats the first alert:

ggpairs(iris, aes(color = Species))
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘stringi’

Any recommendation to run the script successfully?

now at all times I have the same alert:

# We could also do `library(dplyr)`, but we need the rest of the
> # tidyverse packages later, so we might as well import the entire collection.
> l .... [TRUNCATED] 
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘stringi’

When I installed the package, Rstudio sent the following msg:

Do you have RTools? If you're on Windows, you might need that to compile from source.


To hopefully clarify a bit (since the installation messages are definitely not the most user-friendly), this line:

means that stringi failed to install (because, in this case, you were installing from source, stringi needs compilation, and it failed to compile). That's why you keep getting error messages about stringi being missing.

As Mara said, if you haven't installed RTools before, you will need to do that if you want to install packages from source that need compilation (these are ones with C++ or Fortran code). But if you want to try to quickly get moving again, you can see what happens if you install the older pre-compiled binary version of stringi (run install.packages("stringi", type = "binary"). It's possible that there will be incompatibilities with the packages depending on stringi, but this can sometimes be a useful stopgap.

You might also want to check out the installr project, which tries to make package installation on Windows easier:


I receive the following alert:

install.packages("Rtools", dependencies = TRUE, repos = "")
Warning in install.packages :
  package ‘Rtools’ is not available (for R version 3.5.0)

How to proceed?

Rtools isn't an R package. See details here:

This is how you install Rtools on Windows