Optim.prep: Prepare elements for optimization

Description Usage Arguments Value Examples

Description

This function prepares and compiles the necessary components to execute subsequent optimization functions, and must be run first. To run the example data, download the data from GitHub (url)

Usage

1
Optim.prep(Response, n.Pops, ASCII.dir, CS_Point.File, CS.exe, Neighbor.Connect, Constrained.Max, Initial.shape, Bootstrap, boot.iters, Sample_Proportion)

Arguments

Response

This must be a square distance matrix without row or column names

n.Pops

The number of populations in your study

ASCII.dir

The directory containing the continuous ASCII (.asc) files to be optimized. It is recommended that these files be stored their own directory.

CS_Point.File

The path to the Circuitscape formatted point file. See Circuitscape documentation for help.

CS.exe

The path to the CIRCUITSCAPE executable file (cs_run.exe). For example: '"C:/Program Files/Circuitscape/cs_run.exe"'

***NOTE: Double quotation used***

Neighbor.Connect

Select 4 or 8 to designate the connection scheme to use in CIRCUITSCAPE (Default = 8)

Constrained.Max

The fixed maximum resistance value to use during the initial constrained grid search (Default = 100)

Initial.shape

The initial shape parameters to test in constrained grid search (Default = c(seq(0.2,1,by=0.2),seq(1.25,10.75,by=0.75)))

Bootstrap

Logical,if TRUE, specify the number of bootstrap iterations for 'boot.iters'

boot.iters

Number of bootstrap iterations (Default = 10,000)

Sample_Proportion

Proportion of samples to be included in each bootstrap iteration (Default = 0.75)

Value

Results in an object with the necessary components to run other the other functions

Examples

1
2
3
4
# Example.dir <- "C:/Example/"

# Optim.input<-Optim.prep(Response=read.csv(paste0(Example.dir,"RESPONSE_mat.csv"),header=F),n.Pops=64,ASCII.dir=Example.dir,CS_Point.File=paste0(Example.dir,"samples64.txt"),CS.exe='"C:/Program Files/Circuitscape/4.0/Circuitscape/cs_run.exe"',Neighbor.Connect=8,Results.dir=paste0(Example.dir,"Results/"),Constrained.Max=100,Initial.shape=c(seq(0.1,1,0.4),seq(1.5,10,1.5)),Bootstrap=TRUE,boot.iters=10000,Sample_Proportion=0.75)
  

wpeterman/ResistanceOptimization documentation built on May 4, 2019, 9:48 a.m.