Search code examples
rshinyopenstreetmap

error in R while installing packages: problems with shiny or java_home? is it due to opensteetmap?


I'm new with R unfortunately, but i need it to open a specific file which should be a graphical user interface. After the source command:

source("D:\\R\\win-library\\3.5\\muxViz-master\\muxVizGUI.R")

I'm facing this error:

"Installing package into ‘D:/R/win-library/3.5’
(as ‘lib’ is unspecified)

Warning: package ‘shiny’ is in use and will not be installed

Carico il pacchetto richiesto: OpenStreetMap

Error: package or namespace load failed for ‘OpenStreetMap’:
 .onLoad failed in loadNamespace() for 'rJava', details:

  call: fun(libname, pkgname)

  error: JAVA_HOME cannot be determined from the Registry

Installing package into ‘D:/R/win-library/3.5’
(as ‘lib’ is unspecified)

provo con l'URL 'https://cran.stat.unipd.it/bin/windows/contrib/3.5/OpenStreetMap_0.3.3.zip'

Content type 'application/zip' length 2264648 bytes (2.2 MB)
downloaded 2.2 MB

package ‘OpenStreetMap’ successfully unpacked and MD5 sums checked


The downloaded binary packages are in
        C:\Users\Camla\AppData\Local\Temp\RtmpE9NQB2\downloaded_packages

Error in shinyAppDir(x) : App dir must contain either app.R or server.R.".

The contents of this directory come from http://github.com/manlius/muxViz.

Please help.


Solution

  • The last line of muxVizGUI.R is runApp(getwd()). It expects that your working directory is the same directory in which the ui.R and server.R files are located. You should change to that directory before sourcing the file:

    setwd("D:\\R\\win-library\\3.5\\muxViz-master")
    source("muxVizGUI.R")