R Install Package Loaded Namespace

package or namespace load failed error in loading R package from GitHub

The package has no function named d_cmb, but it tries to export that function. That's what the error message says, and it's true.

I think the reason for this error is that the author used Roxygen2 to generate his NAMESPACE file where the exports are declared, but that file is out of sync with the contents of the package.

It's possible this happened because the author forgot to commit a new file containing the new code. In that case, the best solution is to contact the author, and point out the issue.

Alternatively, it may have happened because at one time there was a d_cmb function, but the author removed it, without updating the NAMESPACE file. This one you might be able to fix yourself.

To fix this, you'll need to run Roxygen2 yourself, which is a little more complicated than just installing what's on Github. Here are the steps:

  • Fork the package to your own Github account if you have one. (This step is optional, but it makes some later steps easier.)
  • Download the source for the package. In RStudio, the quickest way to do this is to create a new project using Version Control, Git, and give the URL
    of your forked copy, or the original URL if you skipped that.
  • Run Roxygen2 on the package. In RStudio, you do this by choosing "Document" in the "More" menu of the Build tab.
  • Try to build it. If you're lucky, it will now build properly. If not, fix the next problem.
  • This is very important: send your changes back to the original author. If you forked the package, this is easy; if not, figure out a way to do it.

R package Error: package or namespace load failed for ‘reshape2’ in loadNamespace: there is no package called ‘magrittr’

Fixed by the below command:

install.packages("https://cran.r-project.org/src/contrib/Archive/magrittr/magrittr_1.5.tar.gz", repos = NULL, type="source")

package or namespace load failed error in loading R package litteR

You need to install the commando line tools. Open the Terminal.app and run the following line xcode-select --install

What is `.__DEVTOOLS__.` environment in R package namespace?

.__DEVTOOLS__. was the name of an environment created by the devtools package. If you search for that in the `devtools package NEWS you'll find that it says

Packages loaded with load_all now store devtools metadata in their namespace environment, in a variable called .__DEVTOOLS__. This can be accessed with the dev_meta function. (Winston Chang. Fixes #128)

It appeared in a the metatdata.R file. It appears that this environment is no longer used by the package to track metadata so the function seems to be written to work with an older version of the package.



Related Topics



Leave a reply



Submit