Install local package from zip archive
This is a common question ... so common, in fact, I didn't immediately find a SO question that was actually answered in an answer vice a comment. The most recent I found was @DirkEddelbuettel's comment here: add type="binary"
to your command.
install.packages(repos=NULL) in RStudio
You can bypass the extra things that RStudio does when installing packages by calling utils::install.packages
directly. Alternatively, under the Tools menu, there is an "Install Packages..." dialog which allows in the first dropdown to select installing from "Package Archive File (.zip; .tar.gz)"
The fact that the RStudio version of install.packages
does not respect repos=NULL
should probably be filed as a bug with RStudio.
Getting errors when installing R packages manually
- Download the .zip file for the package from
https://cran.r-project.org/
- Open RGui
- Packages -> Install package(s) from local file(s)
- Navigate to the desired .zip file and click OK
- Wait a short while whilst the package installs
Rstudio unable to install 'psimetrica-R' package from Github
A github source repository is not an R package repository like CRAN -- so you cannot use install.packages()
.
Instead, use remotes::install_gihub()
as in
if (!requireNamespace("remotes", quietly=TRUE)) install.packages("remotes")
remotes::install_github("stmueller/psimetrica-R")
This will install remotes
if needed, and use it to install the desired package.
Or, at least, that would work in principle if psimetrica-R
was a regular R source package. Here it fails because of its layout:
> remotes::install_github("stmueller/psimetrica-R")
Error: Failed to install 'unknown package' from GitHub:
cannot open URL 'https://api.github.com/repos/stmueller/psimetrica-R/contents/DESCRIPTION?ref=HEAD'
>
So you could fork the repo and make it proper package first. At least open source lets you do that.
Related Topics
How to Display Line Numbers for Code Chunks in Rmarkdown HTML and PDF
How to Pop Up the Graphics Window from Rscript
How to Substitute Symbols in a Language Object
R - Check If String Contains Dates Within Specific Date Range
Combining Grid.Table and Base Package Plots in R Figure
Importing Multiple .CSV Files with Variable Column Types into R
Character "|" in Strsplit Function (Vertical Bar/Pipe)
Preventing Incosistent Spacing/Bar Widths in Geom_Bar with Many Bars
How to Manage Parallel Processing with Animated Ggplot2-Plot
Rank Vector with Some Equal Values
Change Values in Row Based on a Column Value R
Data.Table Joins - Select All Columns in the I Argument
R - Identify Consecutive Sequences
Selecting Unique Rows in Matrix Using R
Round But .5 Should Be Floored
R: Get the Min/Max of Each Item of a Vector Compared to Single Value