Locally Installed R package not showing up in RStudio Packages Window

Hi, I have successfully installed a package that I downloaded to my computer but it does not show up in the packages menu of RStudio. I apologize that I am not an experienced programmer but I have searched for solutions and nothing is working. I have the latest versions of R and R Studio installed.

The package is DynOccuPow downloaded from DynOccuPow · master · usgs / NOROCK / Irvine_K / ip-097746 · GitLab

Here is my code:

setwd("~/Documents/R/R-4.1.1/library/DynOccuPow/")

load

devtools::load_all(".")
i Loading DynOccuPow

document

devtools::document(".")
i Updating DynOccuPow documentation
i Loading DynOccuPow

library(DynOccuPow)

library(Xmisc)
is.package.loaded(DynOccuPow)
[1] TRUE

So it is loaded but does not show up in R Studio. Any help is appreciated!

Hi @cherylb,
Welcome to the RStudio Community Forum.

Try clicking on the "Refresh package listing" icon in the top-right of the "Packages" panel. It should also appear on the list if you restart RStudio.

Unfortunately these solutions did not work. If I use

search() # see packages currently loaded
###DynOccuPow shows on the list
library() # see all packages installed
###it does not show up

What happens if you start R from the desktop or terminal and say

library(DynOccuPow)

?

Hi @cherylb,
In the console, run:

.libPaths()

The two directories you see reported are where R and RStudio will look for installed packages. In your case, it looks like DynOccuPow was installed somewhere else
"~/Documents/R/R-4.1.1/library/DynOccuPow/". Try reinstalling it in the R_USER library which, on Windows, is usually located at:

"C:/Users/your_name/Documents/R/win-library/4.1"

Hope this helps.

Hi David,
Thanks so much for continuing to help on this. I ran the libpaths command and it gave me one path
"C:/Users/my_name/Documents/R/R-4.1.1/library" which is where I installed the package. The path you noted in my library is to R version 3.6. All other packages are working fine.

As you can see, it looks like the package loads, but I cannot access it from RStudio. I have tried refreshing etc. and it is still not appearing in my package list.
Thanks again, C

> setwd("C:/Users/cbrehme/Documents/R/R-4.1.1/library/DynOccuPow")
> # load
> devtools::load_all(".")
i Loading DynOccuPow
Loading required package: dplyr

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

Loading required package: magrittr
Loading required package: rjags
Loading required package: coda
Linked to JAGS 4.3.0
Loaded modules: basemod,bugs
Loading required package: gridExtra

Attaching package: ‘gridExtra’

The following object is masked from ‘package:dplyr’:

    combine

Loading required package: raster
Loading required package: sp

Attaching package: ‘raster’

The following object is masked from ‘package:magrittr’:

    extract

The following object is masked from ‘package:dplyr’:

    select

Loading required package: broom
Loading required package: ROCR
Loading required package: unmarked
Loading required package: lattice

Attaching package: ‘unmarked’

The following objects are masked from ‘package:raster’:

    coordinates, getData, projection

The following object is masked from ‘package:sp’:

    coordinates

Loading required package: ggplot2
Loading required package: latex2exp
Loading required package: roxygen2
> 
> # document
> devtools::document(".")
i Updating DynOccuPow documentation
i Loading DynOccuPow

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.