I cannot load the package plm to R Studio

Error Information:

Description of issue -

Steps taken so far -

System Information:

  • RStudio Edition: (Desktop or Server)
  • RStudio Version:
  • OS Version:
  • R Version:

Also:

  • RStudio diagnostics report:
  • Your sessionInfo():
  • RStudio crash report:
  • RStudio application log files:

From Troubleshooting Guide: Using RStudio

Hi Richard, and welcome to community.rstudio.com! It looks like you may have forgotten to add details pertaining to your error (the description, steps taken so far, etc.). Can you please complete these sections so that we can help troubleshoot?

Also, have you tried the following?:

install.packages("plm")
library(plm)

Katherine,

Thanks for replying.

I successfully typed install.packages ("plm').

When I typed library(plm), the program replied:

Loading required package: plm  
Error: package or namespace load failed for ‘plm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘miscTools’ 
Warning message: package ‘plm’ was built under R version 3.4.4

How do I install R version 3.4.4?

Regards,

Richard

The warning about the R version isn’t actually what’s causing your problem. One of the packages that plm depends on isn’t installed. Here’s the key bit of the (rather opaque) error message:

Your next step is typically to try install.packages("miscTools") and, assuming that’s successful, then restarting your R session and running library("plm") again.

If plm complains about yet another missing package, you can try install.packages("plm", dependencies = TRUE) — compared to the default (dependencies = NA), this tries to install a greater number of dependent packages and can be quicker than going through all the missing dependencies one by one.

3 Likes

A side note about that warning message:

It happens when there is a difference between the version of R you have installed and the version the package binary was compiled against. Most typically, people see this when their version of R is older than the one the package was compiled for, and the usual prescription is to upgrade R. But it can also happen the other way around (for whatever reason, the only binary available for your system was compiled under an older version of R than the one you are running). The warning doesn’t necessarily mean anything terrible will happen, but if possible it’s good to keep everything in sync.

To get to the bottom of your situation, can you start by pasting in the output of running sessionInfo()? (This gives you a whole bunch of info about your R environment)

4 Likes