When I install package tidyverse
from CRAN it takes forever (8mins 20 secs to be fair) to load package dependency stringi
. This problem seems to be well documented. But if I am reading this tidyverse github issue correctly it looks like this stringi dependency has been removed. Am I reading this correctly ?
Asked
Active
Viewed 269 times
-1

moreQthanA
- 43
- 9
-
4That's a github issue for one of the tidyverse packages, tidyr. The tidyverse includes many packages, one of which, stringr, is literally built on top of stringi and would not work without it. – joran Jul 14 '22 at 16:25
-
1To back up joran's comment: the `tidyverse` package [imports `stringr`](https://cran.r-project.org/web/packages/tidyverse/index.html), which in turn [imports `stringi`](https://cran.r-project.org/web/packages/stringr/index.html), so even if it has no direct dependency on it, it is still in the dependency tree. However, to address your *problem* (as well as what you asked): see bullet 2 in https://stackoverflow.com/a/63833890/3358272, it generally supports binary package installation even on linux, saving a lot of compilation time. – r2evans Jul 14 '22 at 16:52
-
2You can also *not* install `tidyverse` and just install the individual packages you need to use. If you don't need `stringr`, then you shouldn't need `stringi`. Frequently people will use `library(tidverse)` when the only packages they explicitly use are `dplyr` and `ggplot2`, and maybe 1 or 2 others. – Gregor Thomas Jul 14 '22 at 17:12
-
Thanks @joran - I'd mark your reply as an answer if I could – moreQthanA Jul 17 '22 at 16:36
1 Answers
1
Yes, although tidyverse
does not directly depend on stringi
. You can check this easily using package_dependencies
from the tools
package, which can recursively search through dependencies.
library(tools)
# Get all (non-)direct dependencies using recursive search
depends <- package_dependencies("tidyverse", which = "all", recursive = T)
# Below returns 1 if the package is a dependency - which it is!
sum(unlist(depends) == "stringi")
The tidyverse
package is large and has many dependencies. It is often a good idea to instead load any of the individual packages you may need.

socialscientist
- 3,759
- 5
- 23
- 58