permute_scan_data: Permutation of Nearest Neighbours in Red Colobus scan data:...

Description Usage Arguments Details

View source: R/process-redcolobus-data.R

Description

It does so by choosing a random line from the scan data, and then checks if Individual (1) and NN (1) are both adult and have the sex according to arguments 'ind_sex_permutation' and 'nn_sex_permutation'.

Usage

1
2
3
4
5
6
7
8
permute_scan_data(
  ind_nn_single_timeperiod,
  presence_df,
  ind_sex_permutation = c("Male", "Female"),
  nn_sex_permutation = c("Male", "Female"),
  flips_per_permutation,
  show_i = FALSE
)

Arguments

ind_nn_single_timeperiod

based on ind_nn_df created with 'prep_red_colobus_ind_nn_data()'

presence_df

Dataframe created with 'get_presence_rc'

ind_sex_permutation

default 'c("Male", "Female")'

nn_sex_permutation

default 'c("Male", "Female")'

flips_per_permutation

Number of iterations ('NN flips') per permutation

show_i

Show progress

Details

Then, a second (random) row is chosen, and the same checks are done for Individual (2) and NN (2). Furthermore, it is controlled that NN1 was present at date of second row, and NN2 present at date of first row.

If these conditions are met, the two NNs are flipped.

This procedure is repeated 'flips_per_permutation' times.


urskalbitzer/daginR documentation built on Jan. 21, 2020, 1:26 a.m.