1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 07:41:57 +02:00

(v2.1.1.9279) fix documentation, add foreign S3 exports to functions

This commit is contained in:
2025-05-16 16:55:29 +02:00
parent 139f79d372
commit 38cebc1541
24 changed files with 292 additions and 239 deletions

12
R/mo.R
View File

@ -620,7 +620,8 @@ mo_cleaning_regex <- function() {
# UNDOCUMENTED METHODS ----------------------------------------------------
# will be exported using s3_register() in R/zzz.R
# this prevents the requirement for putting the dependency in Imports:
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(pillar::pillar_shaft, mo)
pillar_shaft.mo <- function(x, ...) {
add_MO_lookup_to_AMR_env()
out <- trimws(format(x))
@ -690,12 +691,14 @@ pillar_shaft.mo <- function(x, ...) {
)
}
# will be exported using s3_register() in R/zzz.R
# this prevents the requirement for putting the dependency in Imports:
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(pillar::type_sum, mo)
type_sum.mo <- function(x, ...) {
"mo"
}
# will be exported using s3_register() in R/zzz.R
# this prevents the requirement for putting the dependency in Imports:
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(cleaner::freq, mo)
freq.mo <- function(x, ...) {
x_noNA <- as.mo(x[!is.na(x)]) # as.mo() to get the newest mo codes
grams <- mo_gramstain(x_noNA, language = NULL)
@ -736,7 +739,8 @@ freq.mo <- function(x, ...) {
)
}
# will be exported using s3_register() in R/zzz.R
# this prevents the requirement for putting the dependency in Imports:
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(skimr::get_skimmers, mo)
get_skimmers.mo <- function(column) {
skimr::sfl(
skim_type = "mo",