summarize_and_plot_graph_and_distribution_structure_information: Compute final PU and species counts and plot degree and...

summarize_and_plot_graph_and_distribution_structure_informationR Documentation

Compute final PU and species counts and plot degree and abundance distributions.

Description

Compute final PU and species counts and plot degree and abundance distributions.

Usage

summarize_and_plot_graph_and_distribution_structure_information(
  PU_spp_pair_indices,
  cor_or_app_label,
  all_correct_node_IDs,
  plot_output_dir,
  spp_col_name,
  PU_col_name,
  presences_col_name
)

Arguments

PU_spp_pair_indices

2 column data frame of PU IDs vs species IDs, where each row identifies a the ID of a given species that occurs on the given planning unit

cor_or_app_label

character string for labelling as Correct or Apparent

all_correct_node_IDs

numeric vector containing all planning unit IDs that appear in the correct problem, not to be confused with the set of planning IDs that appear in the correct solution

plot_output_dir

character string giving pat to directory where plot should be written

spp_col_name

character string giving species column name in data frames

PU_col_name

character string giving planning unit column name in data frames

presences_col_name

character string giving column name for species counts (presences) in data frames

Details

Count the number of species on each PU. If a PU has no species on it, it won't necessarily be in the PU_spp_pair_indices table, so this routine adds the PU back into the table with a zero count.

This means that even though PU_spp_pair_indices could be either a correct or an apparent set of PU-spp pairs, all_correct_node_IDs HAS

Value

final_link_counts_for_each_node, i.e., species count for each node, i.e., 2 column data frame of PU_IDs vs. number of species on corresponding PU

Examples

## Not run: 
tot_num_nodes = 6
PU_spp_pair_indices = data.frame (PU_ID=1:tot_num_nodes, spp_ID=c(1,1,2,2))
all_correct_node_IDs = 1:tot_num_nodes
final_link_counts =
    clean_up_final_link_counts_for_each_node (PU_spp_pair_indices,
                                              all_correct_node_IDs,
                                              "PU_ID",
                                              "freq")
         
## End(Not run)


langfob/bdpg documentation built on Dec. 8, 2022, 5:33 a.m.