[R] install.packages and package dependencies

Achim Zeileis Ach|m@Ze||e|@ @end|ng |rom u|bk@@c@@t
Thu Feb 13 12:42:21 CET 2025


On Thu, 13 Feb 2025, arilamstein using gmail.com wrote:

> Duncan and Berwin,
>
> Thank you for your help.
>
> I really wanted confirmation from someone more experienced than me that I
> wasn't missing something. It looks like there is no way to do this in one
> line in base R, and that's fine.
>
> For reference, the packages that I am doing this for are acs and
> choroplethr, both of which were archived today. (choroplethr depends on
> acs, and acs was archived due to a NOTE. I was the maintainer of
> chroplethr).
>
> I believe that at least a few people will still want to use choroplethr, at
> least for a little while.

Maybe it would be an option for you to adopt and fix the NOTE for "acs"?

Its CRAN page (https://CRAN.R-project.org/package=acs) conveys that the 
original acs author will not keep on maintaining it. But the problems seem 
like they can be addressed without too much effort. Then you could bring 
back both acs and choroplethr.

Best wishes,
Achim

> The instructions I have posted on this are consistent with what I wrote 
> above for:
>
> # Install binary versions of acs' dependencies, then install acs from source
> acs_imports = c("stringr", "XML", "plyr", "httr")
> install.packages(acs_imports)
> install.packages("
> https://cran.r-project.org/src/contrib/Archive/acs/acs_2.1.4.tar.gz")
>
> # Install binary versions of choroplethr's dependencies, then install
> choroplethr from source
> choroplethr_imports = c("Hmisc", "ggplot2", "dplyr", "R6", "WDI", "ggmap",
> "RgoogleMaps", "tigris", "gridExtra", "xml2", "tidyr", "tidycensus",
> "testthat", "choroplethrMaps", "choroplethrAdmin1")
> install.packages(choroplethr_imports)
> install.packages("
> https://cran.r-project.org/src/contrib/Archive/choroplethr/choroplethr_3.7.3.tar.gz
> ")
>
> I believe that both the remotes and devtools packages have functions that
> can do this in one line of code. But I believe that they install all the
> dependencies from source. I found that there were intermittent failures
> with that (not in the acs or choroplethr packages, surprisingly). And also
> it was substantially slower (319 seconds for devtools' install_version vs.
> 43 seconds for the code I showed above).
>
> Berwin, your post actually made me chuckle. In the original draft of my
> post I wrote something like "I tried to look at what install.packages does
> by typing 'install.packages' but it shows me something I can't understand:
>
>> install.packages
> function (...)
> .rs.callAs(name, hook, original, ...)
> <environment: 0x118030cc0>"
>
> I am indeed using RStudio and I had no idea that they overwrote that
> function!
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list