Skip to content

Commit

Permalink
improve documentation to reference fpr_chk_dupes
Browse files Browse the repository at this point in the history
  • Loading branch information
NewGraphEnvironment committed Dec 16, 2024
1 parent b3498c5 commit 32ad625
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions R/fpr_tidy_assign_site_id.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#' Function to process site ID value from pscis_crossing_id and my_crossing_reference
#'
#' Intended for processing field data from digital form in which only one value should be provided.
#' It checks if the dataframe has both 'pscis_crossing_id' and 'my_crossing_reference' values, or none of them.
#' If any rows violate these rules, it returns an error that prints out a simplified dataframe with violating rows.
#' It checks to confirm the dataframe has one and only one of either a `pscis_crossing_id` or a `my_crossing_reference`.
#' It also uses [fpr_chk_dupes()] to issue a warning if there are duplicate values of `pscis_crossing_id`,
#' `my_crossing_reference` or `site_id`
#'
#' @param dat A dataframe to process. Default is NULL.
#' @return A processed dataframe.
Expand All @@ -21,7 +22,14 @@
#' date_time_start = Sys.time() + 0:3
#' )
#'
#' #' dat_warn_dupe <- tibble(
#' pscis_crossing_id = c(1, 3, NA, 4),
#' my_crossing_reference = c(NA, NA, 3, NA),
#' date_time_start = Sys.time() + 0:3
#' )
#'
#' fpr_tidy_assign_site_id(dat_pass)
#' fpr_tidy_assign_site_id(dat_warn_dupe)
#' }
fpr_tidy_assign_site_id <- function(dat = NULL) {

Expand Down
12 changes: 10 additions & 2 deletions man/fpr_tidy_assign_site_id.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 32ad625

Please sign in to comment.