Skip to content

Commit

Permalink
Improved error message when private names are used
Browse files Browse the repository at this point in the history
  • Loading branch information
ellessenne committed Feb 29, 2024
1 parent 1dc5c71 commit 3541163
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
if (!is.null(var)) {
if (any(var %in% private_names)) {
this <- which(var %in% private_names)
stop(paste0("'", var[this], "' is not an allowed name for '", label, "'"), call. = FALSE)
stop(paste0("'", var[this], "' is not an allowed name for '", label, "'; see help('simsum') for more details."), call. = FALSE)
}
}
}
11 changes: 10 additions & 1 deletion testing.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ s.nlp.true2 <- rsimsum::simsum(
autoplot(s.nlp.true2, stats = "bias", type = "nlp")

# #49
library(rsimsum)
library(dplyr)
devtools::load_all()
data("nlp", package = "rsimsum")
# estvarname:
rsimsum::simsum(
Expand All @@ -39,3 +39,12 @@ rsimsum::simsum(
data = rename(nlp, est = ss), estvarname = "b", true = 0, se = "se",
methodvar = "model", by = c("baseline", "est", "esigma")
)

# #48
devtools::load_all()
library(ggplot2)
s.nlp.true <- rsimsum::simsum(
data = nlp, estvarname = "b", true = "esigma", se = "se",
methodvar = "model", by = c("baseline", "ss", "esigma")
)
autoplot(s.nlp.true, stats = "bias", type = "nlp")

0 comments on commit 3541163

Please sign in to comment.