SPACECAP {secr} | R Documentation

## Exchange data with SPACECAP package

### Description

Data in a single-session secr `capthist` object may be written directly to the ‘csv’ format used by SPACECAP, a package for Bayesian spatially explicit capture–recapture (Singh et al. 2010). Data in csv format may also be read to construct a `capthist` object for analysis in secr.

### Usage

    write.SPACECAP(object, mask = NULL, buffer = 100, ndec = 2,
        filestem = "")
    read.SPACECAP(AC, TD, detector = "proximity", session = "1")

### Arguments

`object` | `capthist` object with the captures and trap locations to export
`mask` | `mask` object to use for state-space file
`buffer` | width of buffer in metres to use when creating a mask if none is specified
`ndec` | number of digits after decimal point for coordinates of mask on output
`filestem` | character value used to form names of output files
`AC` | character value giving name of ‘animal capture’ .csv file
`TD` | character value giving name of ‘trap deployment’ .csv file
`detector` | detector type (‘proximity’ or ‘count’)
`session` | character value to use as session name

### Details

If successful, `write.SPACECAP` creates three output files with names ending in ‘AC.csv’,‘TD.csv’ and ‘SS.csv’. These are respectively the ‘Animal Capture’, ‘Trap Deployment’ and ‘State-Space’ files required by SPACECAP.

### Value

`write.SPACECAP` is used for its side effect of writing the required csv files. `read.SPACECAP` returns a `capthist` object.

### Note

State-space csv files may be imported with `read.mask`.

### References

Gopalaswamy, A.M., Royle, J.A., Hines, J.E., Singh, P., Jathanna, D., Kumar, N.S. and Karanth, K.U. (2012) Program SPACECAP: software for estimating animal density using spatially explicit capture–recapture models. Methods in Ecology and Evolution 3, 1067–1072.

Singh, P., Gopalaswamy, A. M., Royle, A. J., Kumar, N. S. and Karanth, K. U. (2010) SPACECAP: A program to estimate animal abundance and density using Bayesian spatially explicit capture-recapture models. Version 1.0. Wildlife Conservation Society - India Program, Centre for Wildlife Studies, Bangalore, India.

### See Also

`capthist`, `mask`, `read.mask`

### Examples

    ## Not run:

    ## coerce data to proximity detector type for export
    demo <- reduce(captdata, output = "proximity")
    write.SPACECAP (demo, filestem = "demo")

    ## now read back the data just exported...
    temp <- read.SPACECAP ("demoAC.csv", "demoTD.csv")
    temp <- reduce(temp, output = "multi")
    summary (temp)
    summary (captdata)

    ## should match exactly
    identical(summary(temp), summary(captdata))

    ## End(Not run)

[Package secr version 3.2.1 Index]