1

Realted to this question

It may be the same question as this, however it stood unanswerd

I do have the same problem , that I can not load the library "shinydashboard". I found the question above, but the solution was only given for Ubuntu/Linux. I am using RStudio and Windows and couldn't use the solution for me.

My code:

## app.R ##
install.packages("shinydashboard")
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody()
)

server <- function(input, output) { }

shinyApp(ui, server)

I get the following Error message:

Error in library(shinydashboard) : there is no package called ‘shinydashboard’

After changing the lib parameter in install.packages to

 install.packages("shinydashboard",lib="C:/Program Files/R/R-3.4.1/library")

I get the following error : For yes:

Warning in install.packages :
  'lib = "C:/Program Files/R/R-3.4.1/library"' is not writable
trying URL 
'https://cran.rstudio.com/bin/windows/contrib/3.4/shinydashboard_0.6.1.zip'
Content type 'application/zip' length 305360 bytes (298 KB)
downloaded 298 KB

package ‘shinydashboard’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  unable to move temporary installation ‘C:\Users\D0282530\Documents\R\win-
library\3.4\file1e4419db2614\shinydashboard’ to 
‘C:\Users\D0282530\Documents\R\win-library\3.4\shinydashboard’

The downloaded binary packages are in
    C:\Users\D0282530\AppData\Local\Temp\Rtmpg3TVPL\downloaded_packages
Error in library(shinydashboard) : 
  there is no package called ‘shinydashboard’ 

For no:

Warning in install.packages :
  'lib = "C:/Program Files/R/R-3.4.1/library"' is not writable
Error in install.packages : unable to install packages
Error in library(shinydashboard) : 
  there is no package called ‘shinydashboard’
Sebbo
  • 75
  • 1
  • 9
  • What does `.libPaths()` tell you? – Roland Jan 05 '18 at 11:11
  • I only have one directory. When installing however, I get the warning message 'Warning in install.packages : unable to move temporary installation `C:\Users\\Documents\R\win-library\3.4\file1e443af274f1\shinydashboard’ to ‘C:\Users\\Documents\R\win-library\3.4\shinydashboard’` – Sebbo Jan 05 '18 at 11:19
  • 1
    .libPaths() `"C:/Users//Documents/R/win-library/3.4" "C:/Program Files/R/R-3.4.1/library"` – Sebbo Jan 05 '18 at 11:21
  • 5
    Well, there you have it. `install.packages` installs into the first library on your path (which is available only to your user account). The shiny user uses the second library. Install the package into that library by using the `lib` parameter of `install.packages`. If you are the only user on your machine, you should change the `.libPaths` by removing the first library and use only one library from now on. – Roland Jan 05 '18 at 11:32
  • If I use `install.packages("shinydashboard",lib="C:/Program Files/R/R-3.4.1/library")` I get the question: `Would you Like to use a personal library instead? (Yes/No)` and no matter what I choose it won't work – Sebbo Jan 05 '18 at 12:05
  • I will eddit my original post with the information I get. It's the problem that this file seems to be unwriteable. Can I just add any another (non-user) directory, or can I get somehow the permission to write in that directory? – Sebbo Jan 05 '18 at 12:18
  • If you use a personal library only your user account can use it. It took some talking but I've been able to convince even my paranoid system admin to give me write access to `C:/Program Files/R`. – Roland Jan 05 '18 at 13:16
  • Alternatively you could use a different location for the default library, but you would need to ensure that R knows about this. I believe this can be achieved by setting the `R_LIBS` environment variable in the Rprofile.site file but I have never tried. – Roland Jan 05 '18 at 13:23
  • You can also pass your personal library path in the `library` call with the `lib.loc` argument or use `run_as ;` in `/etc/shiny-server/shiny-server.conf`. – Gregor de Cillia Jan 05 '18 at 18:58

1 Answers1

0

As @Roland mentioned the packages got installed into the wrong library (only available to my own user account). After trying to install it to another library and problems with write access , I finally manually copied the folder to the second(available to all users) library.

Sebbo
  • 75
  • 1
  • 9