write_all_marxan_input_files_from_vectors | R Documentation |
Write all marxan input files except bound.dat and input.dat given vectors for individual elements.
write_all_marxan_input_files_from_vectors( PU_IDs, spp_IDs, spp_PU_amount_table, spf_values, target_values, cost_values, status_values )
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 |
spf_values |
A vector of species penalty factors |
target_values |
A vector of target values |
cost_values |
A vector of costs |
status_values |
A vector of status values |
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 spf_values = rep (10, num_spp) target_values = rep (1, num_spp) cost_values = rep (1000, num_PUs) status_values = rep (0, num_PUs) 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_from_vectors (PU_IDs, spp_IDs, spp_PU_amount_table, spf_values, target_values, cost_values, status_values) # Write each input file individually. write_marxan_pu.dat_input_file_from_vectors (PU_IDs, cost_values, status_values) write_marxan_spec.dat_input_file_from_vectors (spp_IDs, spf_values, target_values) 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.