write_all_marxan_input_files | R Documentation |
Write all marxan input files except bound.dat and input.dat using constant values for individual elements.
write_all_marxan_input_files( PU_IDs, spp_IDs, spp_PU_amount_table, targets = rep(1, length(spp_IDs)), costs = rep(1, length(PU_IDs)), spf_const = 1, status_const = 0 )
PU_IDs |
A vector of planning unit IDs |
spp_IDs |
A vector of species IDs |
spp_PU_amount_table |
A data frame of species IDs vs planning unit IDs |
targets |
A vector of target representation levels for all species |
costs |
A vector of costs for all PUs |
spf_const |
A constant species penalty factor to be applied to all species |
status_const |
A constant status to be applied to all species |
The spp_PU_amount_table is expected to have 3 columns called (in left to
right order) "species",
"pu", and "amount". Marxan requires this table to be sorted in increasing
order on the planning unit column. I don't think the order within planning
unit matters on the
other columns. See source code for the test function
gen_random_spp_PU_amount_table
for an example of creating
this table.
nothing.
## Not run: num_PUs = 100 num_spp = 3 PU_IDs = 1:num_PUs spp_IDs = 1:num_spp spp_PU_amount_table = gen_random_spp_PU_amount_table (num_PUs, num_spp) # Write all input files at once. write_all_marxan_input_files (PU_IDs, spp_IDs, spp_PU_amount_table) # Write each input file individually. write_marxan_pu.dat_input_file (PU_IDs) write_marxan_spec.dat_input_file (spp_IDs) write_marxan_puvspr.dat_input_file (spp_PU_amount_table) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.