How do I install an R package from the source tarball on windows?
I know this is an old question but it came up first in my Google search for this same question, even though I knew the answer I just wanted something to copy and paste. Which makes it worth improving the answer for future reference. So here is what works for me:
Install rtools, then:
install.packages(path_to_file, repos = NULL, type="source")
Installing package from source R
After spending about an hour, thanks to @user20650 and @GWD I was able to solve my problem as follows:
- I previously had R 3.5.3, I upgraded to the latest version 3.6.2
- Steps to upgrade R if you already have it: tutorial 1 and tutorial 2
- After having R 3.6.2, I used
RGui
rather thatRStudio
to installHmisc
- I typed in the GUI console:
install.packages("Hmisc");
it prompts you for a message about compilation, I clicked on NO
Install R package from source, without changing PATH (Windows)
Since you have to set the PATH
, but you're hesitant to do so because you're afraid you may hose something up, you can do it temporarily in your R session via:
pathRtools <- paste(c("c:\\Rtools\\bin",
"c:\\Rtools\\MinGW\\bin",
"c:\\MiKTeX\\miktex\\bin",
"c:\\R\\bin\\i386",
"c:\\windows",
"c:\\windows\\system32"), collapse=";")
Sys.setenv(PATH=paste(pathRtools,Sys.getenv("PATH"),sep=";"))
R: make not found when installing a R-package from local tar.gz
what do you need is to update the Rtool, here is the link I had the same issue before once you update it will work.
Related Topics
When Importing CSV into R How to Generate Column with Name of the CSV
Creating a New Variable from a Lookup Table
The Cause of "Bad Magic Number" Error When Loading a Workspace and How to Avoid It
Non-Standard Evaluation (Nse) in Dplyr's Filter_ & Pulling Data from MySQL
Comma Separator for Numbers in R
How to Assign the Result of the Previous Expression to a Variable
How to Add a Cumulative Column to an R Dataframe Using Dplyr
Why Does Unlist() Kill Dates in R
How to Create a Marimekko/Mosaic Plot in Ggplot2
What Does the Capital Letter "I" in R Linear Regression Formula Mean
Creating a Plot Window of a Particular Size
How to Change Library Location in R
Explain Ggplot2 Warning: "Removed K Rows Containing Missing Values"
Issue with Geom_Text When Using Position_Dodge
Add "Filename" Column to Table as Multiple Files Are Read and Bound
Merge and Perfectly Align Histogram and Boxplot Using Ggplot2