Skip to content

Commit

Permalink
add function for converting confidence_in_curation to factor
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgamboa committed Sep 28, 2023
1 parent ce9d55c commit 31d38df
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export(calcParentScores)
export(chooseColVal)
export(classif2Table)
export(cleanNode)
export(conf2Fct)
export(fillNAs)
export(freq2Scores)
export(getAgreements)
Expand Down
16 changes: 16 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ scores2Freq <- function(x) {
)
}


#' Confidence in curation to factor
#'
#' \code{conf2Fct} converts a vector from the Confidence_in_curation
#' column in a bugphyzz dataset to a factor.
#'
#' @param x A character vector.
#'
#' @return A factor.
#'
#' @export
#'
conf2Fct <- function(x) {
factor(x, levels = c('low', 'medium', 'high'), ordered = TRUE)
}

## Function with valid ranks for taxa
.validRanks <- function() {
c('strain', 'species', 'genus', 'family', 'order', 'class', 'phylum',
Expand Down
18 changes: 18 additions & 0 deletions man/conf2Fct.Rd

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

0 comments on commit 31d38df

Please sign in to comment.