Overview
The RMark library is a collection of R functions that can be used as an
interface to MARK for analysis of capture-recapture data. The library
contains various functions that import/export capture data, build
capture-recapture models, run the FORTRAN program MARK.EXE, and extract
and display output. Program MARK has its own user interface; however,
model development can be rather tedious and error-prone because the
parameter structure and design matrix are created by hand. This
interface in R was created to use the formula and design matrix
functions in R to ease model development and reduce errors. For more
details about its capabilities, read the RMark appendix from
the MARK book. If you have
already been using RMark, you can find out "what’s new" in the current
version.
Installing and using RMark...
To use RMark under MS Windows, you must do the following (instructions for
RMark under Linux can be found here):
If you haven’t already done so, you must install MARK on your
computer if you haven’t already done so. Click
here to download the most recent version of MARK. More complete details on
installing MARK can be found
here. If you choose the default options during the
installation process, MARK.EXE will be stored in the default location of
c:/Program Files/Mark where the R library will expect it. If you modify
the default location, you’ll need to create a MarkPath variable in R.
See the help for “mark” once you have completed step 5 below.
If you haven’t already done so, you must install R from the
following website http://cran.r-project.org. Select Windows95 or
later, then select base and finally select r-vvvv-win32.exe (where vvvv
is the current version (e.g., R-2.6.1-win32.exe)). Select run and then
follow the directions and choose the default setup by clicking on “next”
at each prompt.
Next download the RMark library here.
Next startup R from either the desktop icon or from the Start/All
Programs list. From within R, select Packages from the menu and then
choose “Install package(s) from local zip…” at the bottom of the list.
Doing so will show a “select files” window. Navigate to the location
where you downloaded the RMark.zip and select the zip file. This will
load the package into c:/Program Files/R/Rvvvvv/library, where vvvvv
represents the current version of R that you are using. Note that R
installs into separate directories of c:/Program Files/R for each
version.
Next you need to use the command library(RMark) to attach the
package so you can use the functions. Every time you start R you need
to issue the command library(RMark) to attach the library but you only
need to install it once.
To avoid entering library(RMark) each time you initiate R, you have
a couple of options. You can enter the library(RMark) command by
editing the file rprofile.site located in the directory C:\Program
Files\R\R-vvvvv\etc\. If you choose that option, the RMark library will
be loaded anytime you load R. Or you can write a function
.First<-function() library(RMark) and save it into any .Rdata file from
which you will do MARK analyses. The rprofile.site file is also a good
place to make generic modifications. For example, adding the command
options(chmhelp=TRUE) will mean that the help command will use the
compiled help tool for windows. Or you can use options(htmlhelp=TRUE)
to use the non-compiled html help. Either of these is better than using
the default which does not allow hyperlinks. If you set up either help
option you can enter “?mark” to see all the help categories for RMark.
If you chose to use htmlhelp, click on index to see the complete list.
The “rprofile.site” file or “.First” function is also a good place to
change options like the default editor etc. See help for “options” and
“Startup” from within R. If you use one of the above approaches, you'll need
to use detach("package:RMark") before you attempt to install an upgrade of the
package. After you upgrade, then you can exit R and restart or simply type
library(RMark) to attach it for that session. If you do not detach it, R will
complain that the package is in use when you try to install.
To download
the source for the RMark library
click here.
Only R developers will find the
source useful.