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

(v1.8.0.9002) as.rsi() cleanup, more informative warnings

This commit is contained in:
2022-03-02 15:38:55 +01:00
parent 18e8525d10
commit 3b2b2be5f8
35 changed files with 267 additions and 320 deletions

View File

@ -206,7 +206,7 @@ check_dataset_integrity <- function() {
" overwritten by your global environment and prevent", plural[2],
" the AMR package from working correctly: ",
vector_and(overwritten, quotes = "'"),
".\nPlease rename your object", plural[3], ".", call = FALSE)
".\nPlease rename your object", plural[3], ".")
}
}
# check if other packages did not overwrite our data sets
@ -492,7 +492,7 @@ message_ <- function(...,
warning_ <- function(...,
add_fn = list(),
immediate = FALSE,
call = TRUE) {
call = FALSE) {
warning(word_wrap(...,
add_fn = add_fn,
as_note = FALSE),
@ -559,7 +559,7 @@ stop_ifnot <- function(expr, ..., call = TRUE) {
return_after_integrity_check <- function(value, type, check_vector) {
if (!all(value[!is.na(value)] %in% check_vector)) {
warning_(paste0("invalid ", type, ", NA generated"), call = FALSE)
warning_(paste0("invalid ", type, ", NA generated"))
value[!value %in% check_vector] <- NA
}
value