Topics in this troubleshooting:
If you use a Linux (Ubuntu-like) distribution, you are very lucky, because the following BASH script will do the job for you:
#download R from their repository
wget http://cran.es.r-project.org/src/base/R-3/R-3.0.3.tar.gz
DIR=$PWD
#install R
sudo apt-get build-dep r-base-core
sudo mv R-3.2.0.tar.gz ~
cd ~
tar xvf R-3.2.0.tar.gz
cd R-3.2.0
./configure
make
sudo make install
#install GDAL
sudo apt-get install libgdal1-dev libproj-dev
One of our users, Lucio Agostinho Rocha, reported the following solution for installation on this system.
To load muxViz in R environment, he solved modifying the muxVizGUI.R file:
Before:
devtools::install_github("shiny-incubator", "rstudio")
After:
devtools::install_github("rstudio/shiny-incubator", "rstudio")
Thank you Lucio!
muxViz uses an API to external softwares: Multimap (known as multiplex infomap) and Fanmod.
The home screen of muxViz will indicate if the available binaries are correctly installed and can be used by the platform. If it is not the case, a WARNING message is generally displayed.
It depends. If Multimap is missing, you will not be able to perform multilayer community detection based on the generalization of the Infomap algorithm for this type of networks. If FANMOD is missing, you will not be able to perform multiplex motif analysis of your network.
If you are interested in using these features, and the default installation shows a WARNING, you just need to compile the software on your own machine. This is an easy task on all OSs.
Verify that you have a c++ compiler on your machine. On Linux and most recent versions of Mac OS X, it is already installed. In Windows, you might need some extra work (Install MinGW on Windows 10 Video tutorial to install MinGW on Windows 7). You might want to take a look at the official web site: Installing GCC Host/Target specific installation notes for GCC
Go into the src
folder that is placed inside the muxViz folder
fanmod_src.zip
and/or Multiplex-Infomap_src.zip
)make
. This step is expected to go smoothly, because after a few seconds the GCC compiler will produce binary executables ad hoc for your system. If it is not the case, take a look at the official web page and if you still can not compile, post on our Google Groupbin
folder that is placed inside the muxViz folderfanmod_linux
and/or multiplex-infomap_linux
The issue is that there is a conflict between the current version of igraph and shinyjs. More details can be found here: https://github.com/igraph/igraph/issues/846
While waiting for a new release of igraph, solving the issue, we can install the dev version:
devtools::install_github("igraph/rigraph")
On Mac OS X this could be a bit tricky, because R might use clan instead of gcc/g++ to compile. A solution is to create the file
~/.R/Makevars
if it does not exist, and set the following parameters:
CFLAGS += -O3 -Wall -pipe -pedantic -std=gnu99
CXXFLAGS += -O3 -Wall -pipe -Wno-unused -pedantic
VER=-4.2
CC=gcc$(VER)
CXX=g++$(VER)
SHLIB_CXXLD=g++$(VER)
FC=gfortran
F77=gfortran
MAKE=make -j8
Restart R and try again to install the dev version of igraph.
To work properly with geographical networks, the GDAL (Geospatial Data Abstraction Library) is required and should be installed before running muxViz for the first time. GDAL should be available as an R package and should be easily installed just by typing
install.packages("sp")
install.packages("rgdal")
within the R environment. However, in a few cases it can be more complicated and some users reported problems for its installation. If this is also your case you might want to take a look at some suggestions on stackoverflow or on spatial.ly.
In any case, it is highly recommend to visit the GDAL website and follow the hints provided there.
Some users reported that, when using muxVix for the first time, they get the following error:
Warning: Error in : package or namespace load failed for ‘OpenStreetMap’:
.onLoad failed in loadNamespace() for 'rJava', details:
One possible solution is to open the terminal and type
R CMD javareconf
to reconfigure java to work correctly within R. You might read about possible solutions for Linux and Mac OS X.
Thanks Sneha Rajen!
It can happen that newest MacOS generate installation issues with rjava. MacOS Users should take a look at the following approaches: 1, 2, 3, 4.
In general try make sure R is configured with full Java support (including JDK). Run
sudo R CMD javareconf
to add Java support to R. If you still can't install it, read below.
A possible solution for MacOS versions before Sierra:
sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
But it may happen that your version of MacOS + Java does not have that path. To find the correct path try
/usr/libexec/java_home
to obtain something like
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Look for the dylib file:
find $(/usr/libexec/java_home) -name "libjvm"
If the result is null, then you might need to install (more) Java. Understand which Java you have installed already and where:
/usr/libexec/java_home -V
If you see something like this:
1.8.0_162, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
1.6.0_65-b14-468, x86_64: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_65-b14-468, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
skip the next two paragraphs, otherwise install Java SE 6 and 8.
For Java SE 6 go to Apple support, download and install.
Oracle website is the not the best user-friendly website around. Check instructions here and download Java SE 8 from here.
You should download and install the file
jdk-8u162-macosx-x64.dmg
or similar, for Java SE 8. Note that it will ask you to register an account: download is free, but you can't skip the registration phase (2 min required).
Run again
/usr/libexec/java_home -V
and hope to see
1.8.0_162, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
1.6.0_65-b14-468, x86_64: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_65-b14-468, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
so that everything is installed correctly. Then run
java -version
and hope to see something like
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
Time to tell R how to use our Java:
sudo R CMD javareconf
and pray to see at the end of the terminal something like
JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.
Now, in the terminal, paste the following:
unset JAVA_HOME
R --quiet -e 'install.packages("rJava", type="source", repos="http://cran.us.r-project.org")'
to install rJava from source with Java 8 JDK. If it works without errors, let's check everything is fine:
R --quiet -e 'library("rJava"); .jinit(); .jcall("java/lang/System", "S", "getProperty", "java.runtime.version")'
and you should get something like
1.8.0_162-b12
as a result.
muxViz depends on several R packages that, when updated by their developers, might cause issues on muxViz. In general, it might happen that you use a very new version of R (muxViz was developed for R 3.2): you should still be able to use muxViz by simply patching the initial sanity check it does to ensure full compativility.
Open muxVizGUI.R and edit:
if(grep("3.3",version$version.string)!=1){
#devtools::install_github("trestletech/ShinyDash")
to avoid the error "package ‘ShinyDash’ is not available (for R version 3.3.0)"Finally, install Shiny Dash from R console: devtools::install_github("ShinyDash", "trestletech")
Now muxViz should start and work.
Thank you Maria Pereda!
On Mac and Linux it is possible to exploit the already existing linear algebra R packages by forcing R to use a faster BLAS version. On a Mac OS X this is easily achieved by
sudo ln -sf /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.