Installing / using the XHMM R scripts
The XHMM R code is now available as an R library.
There are still two options for using the scripts:
Newer (preferred) option
-
Install the xhmmScripts package via one of the following methods (you only need to do this once):
- Compile it from the main XHMM source code downloaded from the Git repository above:
cd statgen-xhmm-*
make R
Then, run in R:
install.packages(list.files(path=".", pattern="xhmmScripts_.+\\.tar\\.gz"), repos=NULL, type="source")
- Download and install the package from CRAN using the install.packages() command in R:
install.packages("xhmmScripts")
- Download it from the xhmmScripts page at CRAN.
Then, run in R:
install.packages(list.files(path=".", pattern="xhmmScripts_.+\\.tar\\.gz"), repos=NULL, type="source")
-
To use the R code, preface your R scripts with:
library(xhmmScripts)
Older option
Directly source the R code found in the downloaded source code, by running the following at the top of your R scripts:
XHMM_PATH = "./"
XHMM_SCRIPTS_PATH = paste(XHMM_PATH, "/sources/scripts/R_functions", sep="")
source(paste(XHMM_SCRIPTS_PATH, "/sourceDir.R", sep=""))
sourceDir(XHMM_SCRIPTS_PATH, trace = FALSE, recursive = TRUE)
library(gplots)
library(plotrix)