R/reset_id.R

# #' @export
# reset_id <- function(type,
#                      silent = limonaid::opts$get("silent")) {
#   if (!(type %in% c("question", "group", "answer"))) {
#     stop("As 'type', you passed ", vecTxtQ(type), ", which ",
#          "is an illegal value.");
#   }
#   idCounterName <- paste0(type, "_idCounter");
#   oldIdCounter <- limonaid::opts$get(idCounterName);
#   newIdCounter <- 1;
#   do.call(limonaid::opts$set,
#           stats::setNames(list(newIdCounter),
#                           nm = idCounterName));
#   if (!silent) {
#     cat0("\nOld ", type, " id counter was at ", oldIdCounter,
#          "; reset it to 1.\n");
#   }
#   return(invisible(newIdCounter));
# }

Try the limonaid package in your browser

Any scripts or data that you put into this service are public.

limonaid documentation built on June 14, 2022, 1:06 a.m.