Skip to contents

This function prepares the prior for further steps.

Usage

PrepPrior(prior, RemoveIndetSp = TRUE, RemoveNotGuyafor = TRUE)

Arguments

prior

data.frame of prior, formatted as as shown in the vignette.

RemoveIndetSp

Should the botanical names with non-determined species be removed from the prior? (Default is TRUE) (logical)

RemoveNotGuyafor

Should the botanical names that has never been observed in Guyafor be removed from the prior? (Default is TRUE) (logical)

Value

This function returns a data.frame (formatted as a data.table) ready to be used for the following steps.

Details

This function performs the following steps:

  • perform some checks on the file

  • add a column GenSp with the full botanical name

  • remove botanical names no fully determined or not in Guyafor (is option selected)

  • remove columns with no association

One reason for choosing the default setting for RemoveIndetSp and RemoveNotGuyafor is that these names would always lead to incorrect association when using the CompareSim function. However, one may decide to keep them, this would lead to

  • possible associations with a botanical name of the form Genus-Indet. with a BotaCodeCor="AssoByGenus" or "AssoByFam" (with RemoveIndetSp==TRUE).

  • possible associations with a botanical name that has never been observed in Guyafor (with RemoveNotGuyafor==TRUE). In these case, only the prior information would be used.