knitr::opts_chunk$set( fig.path='figure/graphics-', cache.path='cache/graphics-', fig.align='center', external=TRUE, echo=TRUE, warning=FALSE # fig.pos="H" )
Since TASSEL is written primarily in Java, a Java JDK will need to be
installed on your machine. Additionally, for R to communicate with Java,
the R package rJava
will need to be
installed. In order to use rTASSEL
, ensure that you have:
JDK
(Java Development Kit $\geq$ 8
) installed on your system.JAVA_HOME
is configured
appropriately and points to your JDK
of choice. This will usually
be included in your PATH environment variable as well. Options and
system environmental variables that are available from R can be seen
with Sys.getenv()
and more specifically
Sys.getenv("JAVA_HOME")
.NOTE: If you are using a UNIX system (e.g. Ubuntu) and are experiencing issues, you may need to reconfigure R with Java. To perform this, open a terminal and enter the command:
R CMD javareconf
You may need to have root privileges when performing this so you may
need to add sudo
to the prior command.
If you need additional steps on how to perform these actions, detailed information can be found using the following links, depending on your OS:
After you have rJava
up and running on your machine, install rTASSEL
by installing the source code from our GitHub repository using the
devtools
package. Here, we show how you can install the package and build
vignettes locally:
if (!require("devtools")) install.packages("devtools") devtools::install_github( repo = "maize-genetics/rTASSEL", ref = "master", build_vignettes = TRUE, dependencies = TRUE )
The dependencies = TRUE
parameter will have to be set if you do not have the
suggested packages described in the
DESCRIPTION
file of this package.
If you wish to not build vignettes, the prior method can be simplified as shown below:
if (!require("devtools")) install.packages("devtools") devtools::install_github("maize-genetics/rTASSEL")
rTASSEL
After source code has been compiled, the package can be loaded using:
library(rTASSEL)
Or, if you want to use a function without violating your environment you
can use rTASSEL::<function>
, where <function>
is an rTASSEL
function.
If you wish to run a containerized version of rTASSEL
, we also have a
Docker image
available. This can be retrieved from DockerHub using the following command:
docker pull maizegenetics/rtassel:latest
Once downloaded, you can run rTASSEL
from a terminal window:
docker run --rm -ti maizegenetics/rtassel R
This image also contains an RStudio Server instance. To run this, you will
need to publish the container's port(s) to the host (-p
). For example:
docker run --rm -ti -p 8787:8787 maizegenetics/rtassel
From here, you can go to localhost:8787
on a web browser and enter a:
rstudio
)If you are running into issues with installing rJava
using the newer
Mac chip architecture, Oracle JDK currently (as of writing this) does not
work. Consider an alternative JDK source such as OpenJDK
or Azul JDK.
More detailed information about a possible workaround can be found in this Stack Overflow post.
If you are using a machine that has both architectures
installed for R, you might run into problems pulling code using
devtools
. If this is the case, one solution would be to add the
parameter --no-multiarch
option in INSTALL_opts
. This will force
building the package for your currently running R version:
devtools::install_github( repo = "maize-genetics/rTASSEL", ref = "master", build_vignettes = FALSE, INSTALL_opts = "--no-multiarch" )
rJava
if you have upgraded JavaOn macOS: if you previously had rJava
working through RStudio, then
you upgraded your Java and it now longer works, try the following:
At the command line type:
R CMD javareconf
Then check for a left over symbolic link via:
ls -ltr /usr/local/lib/libjvm.dylib
If the link exists, remove it, then create it fresh via these commands:
rm /usr/local/lib/libjvm.dylib sudo ln -s $(/usr/libexec/java_home)/lib/server/libjvm.dylib /usr/local/lib
You should now be able to enter RStudio and setup rJava
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.