Jump down to:
R:
R --version
R version 3.1.0 (2014-04-10) -- "Spring Dance"
chdir %BASE%\Analysis Engines\DSM\Engine\
chdir %BASE%\Analysis Engines\MRDS\Engine\mrds\
R CMD --no-manual check dsm
R CMD --no-manual check mrds
R CMD check --as-cran dsm
R CMD check --as-cran mrds
R CMD INSTALL --build dsm
R CMD INSTALL --build mrds
mkdir local
R CMD INSTALL -l local --build dsm
R CMD INSTALL -l local --build mrds
dsm_M.N.R.zip
mrds_M.N.R.zip
Version: 2.2.3
Version: 2.1.5
library(devtools)
check("dsm", args="--no-manual")
check("mrds", args="--no-manual")
install("mrds")
install("dsm")
build("dsm",binary=T)
build("mrds",binary=T)
dsm_M.N.R.zip
mrds_M.N.R.zip
Version: 2.2.3
Version: 2.1.5
Change into the parent of the directory for which documentation is to be created
library(devtools)
load_all("dsm")
load_all("mrds")
document("dsm")
document("mrds")
Change into the parent of the directory for which documentation is to be created
library(devtools)
load_all("dsm")
load_all("mrds")
run_examples("dsm")
run_examples("mrds")
Alternatively, one can build a .tar.gz package:
R CMD build dsm
R CMD build mrds
R CMD INSTALL --build dsm_M.N.R.tar.gz
R CMD INSTALL --build mrds_M.N.R.tar.gz
copy %BASE%\Analysis Engines\DSM\Engine\dsm_M.N.R.zip %BASE%\Analysis Engines\Shared Stuff\NEngineInterfaceUtilities\RPackages\
copy %BASE%\Analysis Engines\MRDS\Engine\mrds\mrds_M.N.R.zip %BASE%\Analysis Engines\Shared Stuff\NEngineInterfaceUtilities\RPackages\
Distance’s R tests are written in testthat. For more information see:
library(testthat)
library(dsm)
test_file("tests/testthat/test_input.R")
test_file("tests/testthat/")
test_package("dsm")
test_file("tests/testthat/test_input.R", "minimal")
library(testthat)
library(PACKAGENAME)
test_check("PACKAGENAME")
chdir dsm\tests\
R -file testthat.R
Within R GUI:
Within R batch mode:
Rcmd.exe BATCH in.r log.r
If reusing files elsewhere check to ensure that any paths within the files are updated.
#this reads in the file just created
forplot<-read.table(file="plot.txt", header=T, sep="\t", dec=".")
#note, depending on your language, dec might be "," rather than "."
#this plots the detection function or pdf (if point transects)
plot(forplot$C1, forplot$C2, type="l", ylim=c(0,max(forplot$C4)),
xlab="Distance", ylab="Detection probability")
#Define labels as you wish
#this adds in the data bars
lines(c(0,0), c(forplot$C3[1], forplot$C4[1]))
lines(forplot$C3, forplot$C4)
#this reads in the file just created
forplot<-read.table(file="plot.txt", header=T, sep="\t", dec=".")
#note, depending on your language, dec might be "," rather than "."
#this plots the detection function or pdf (if point transects)
plot(forplot$C1, forplot$C2, type="p", ylim=c(0,max(forplot$C4)),
pch = ".", xlab="Empirical distribution function",
ylab="Fitted cumulative distribution function")
#Define labels as you wish
#this adds in the (0,0) (1,1) line
lines(c(0,1), c(0,1))
#this reads in the file just created
forplot<-read.table(file="plot.txt", header=T, sep="\t", dec=".")
#note, depending on your language, dec might be "," rather than "."
#this plots the detection function or pdf (if point transects)
plot(forplot$C1, forplot$C2, type="l", ylim=c(0,1),
xlab="Distance", ylab="Detection probability")
#Define labels as you wish
#this adds in other two lines
lines(forplot$C3, forplot$C4, lty=2)
lines(forplot$C5, forplot$C6, lty=3)