Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect roxygen import tags in a single location #304

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,3 @@ export(theme_modern)
export(theme_radar)
export(theme_radar_dark)
import(ggplot2)
importFrom(ggplot2,.data)
2 changes: 1 addition & 1 deletion R/geom_violindot.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) +
#' geom_violindot() +
#' theme_modern()
#' @import ggplot2
#'
#' @export
geom_violindot <- function(mapping = NULL,
data = NULL,
Expand Down
4 changes: 2 additions & 2 deletions R/geom_violinhalf.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' geom_violinhalf(flip = c(1, 3)) +
#' theme_modern() +
#' scale_fill_material_d()
#' @import ggplot2
#'
#' @export
geom_violinhalf <- function(mapping = NULL,
data = NULL,
Expand Down Expand Up @@ -68,7 +68,7 @@ geom_violinhalf <- function(mapping = NULL,
#' @rdname ggplot2-ggproto
#' @format NULL
#' @usage NULL
#' @import ggplot2
#'
#' @keywords internal
GeomViolinHalf <- ggproto("GeomViolinHalf", Geom,
extra_params = c("na.rm", "flip"),
Expand Down
2 changes: 1 addition & 1 deletion R/plot.bayesfactor_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
#' @return A ggplot2-object.
#'
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_bayesfactor_parameters <- function(x,
size_point = 2,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.binned_residuals.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_binned_residuals <- function(x,
size_line = 0.7,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.check_collinearity.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' result <- check_collinearity(m)
#' result
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_check_collinearity <- function(x,
data = NULL,
Expand Down Expand Up @@ -119,7 +119,7 @@
color = NA,
alpha = 0.15
) +
{

Check warning on line 122 in R/plot.check_collinearity.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_collinearity.R,line=122,col=5,[brace_linter] Opening curly braces should never go on their own line and should always be followed by a new line.

Check warning on line 122 in R/plot.check_collinearity.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.check_collinearity.R,line=122,col=5,[brace_linter] Opening curly braces should never go on their own line and should always be followed by a new line.
if (!is.null(ci_data)) {
list(
ggplot2::geom_linerange(
Expand Down
2 changes: 1 addition & 1 deletion R/plot.check_homogeneity.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' result <- check_homogeneity(model)
#' result
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_check_homogeneity <- function(x, data = NULL, ...) {
if (is.null(data)) {
Expand Down
2 changes: 1 addition & 1 deletion R/plot.check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#'
#' @return A ggplot2-object.
#'
#' @seealso See also the vignette about [`check_model()`](https://easystats.github.io/performance/articles/check_model.html).

Check warning on line 12 in R/plot.check_model.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_model.R,line=12,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 125 characters.

Check warning on line 12 in R/plot.check_model.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.check_model.R,line=12,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 125 characters.
#'
#' @examplesIf require("performance") && require("patchwork")
#' model <- lm(qsec ~ drat + wt, data = mtcars)
#' plot(check_model(model))
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_check_model <- function(x,

Check warning on line 19 in R/plot.check_model.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_model.R,line=19,col=1,[cyclocomp_linter] Functions should have cyclomatic complexity of less than 40, this has 78.
style = theme_lucid,
colors = NULL,
type = c("density", "discrete_dots", "discrete_interval", "discrete_both"),
Expand All @@ -40,7 +40,7 @@
overdisp_type <- attr(x, "overdisp_type")
plot_type <- attr(x, "type")

if (missing(type) && !is.null(plot_type) && plot_type %in% c("density", "discrete_dots", "discrete_interval", "discrete_both")) {

Check warning on line 43 in R/plot.check_model.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_model.R,line=43,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 131 characters.

Check warning on line 43 in R/plot.check_model.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.check_model.R,line=43,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 131 characters.
type <- plot_type
} else {
type <- match.arg(type)
Expand Down
2 changes: 1 addition & 1 deletion R/plot.compare_performance.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
dataplot$values[dataplot$values > 1] <- 1

attr(dataplot, "info") <- list(
"xlab" = "",

Check warning on line 43 in R/plot.compare_performance.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.compare_performance.R,line=43,col=5,[keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names).
"ylab" = "",

Check warning on line 44 in R/plot.compare_performance.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.compare_performance.R,line=44,col=5,[keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names).
"title" = "Comparison of Model Indices",

Check warning on line 45 in R/plot.compare_performance.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.compare_performance.R,line=45,col=5,[keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names).
"legend_color" = "Models"

Check warning on line 46 in R/plot.compare_performance.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.compare_performance.R,line=46,col=5,[keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names).
)

class(dataplot) <- c("data_plot", "see_compare_performance", "data.frame")
Expand Down Expand Up @@ -72,7 +72,7 @@
#' result <- compare_performance(lm1, lm2, lm3)
#' result
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_compare_performance <- function(x, size_line = 1, ...) {
# We may think of plotting the "performance scores" as bar plots,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.estimate_contrasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
dataplot <- .data_contrasts_and_means(x, means, x_name = x_name, y_name = y_name)

attr(dataplot, "info") <- list(
"xlab" = x_name,

Check warning on line 19 in R/plot.estimate_contrasts.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.estimate_contrasts.R,line=19,col=5,[keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names).
"ylab" = y_name,

Check warning on line 20 in R/plot.estimate_contrasts.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.estimate_contrasts.R,line=20,col=5,[keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names).
"title" = paste0("Estimated ", y_name, "s and Contrasts")

Check warning on line 21 in R/plot.estimate_contrasts.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.estimate_contrasts.R,line=21,col=5,[keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names).
)

class(dataplot) <- c("data_plot", "see_estimate_contrasts", class(dataplot))
Expand Down Expand Up @@ -76,7 +76,7 @@
#' means <- estimate_means(model)
#' plot(contrasts, means)
#' }
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_estimate_contrasts <- function(x, data = NULL, ...) {
if (!inherits(x, "data_plot")) {
Expand Down
4 changes: 2 additions & 2 deletions R/plot.estimate_density.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ data_plot.estimate_density <- function(x,
#' m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
#' result <- estimate_density(m)
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_estimate_density <- function(x,
stack = TRUE,
Expand Down Expand Up @@ -244,7 +244,7 @@ plot.see_estimate_density <- function(x,
data_plot.estimate_density_df <- data_plot.estimate_density


#' @importFrom ggplot2 .data
#'
#' @export
plot.see_estimate_density_df <- function(x,
stack = TRUE,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.hdi.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ data_plot.bayestestR_eti <- data_plot.hdi
#' result <- hdi(m)
#' result
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_hdi <- function(x,
data = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.n_factors.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ data_plot.n_clusters <- data_plot.n_factors
#' result <- n_factors(mtcars, type = "PCA")
#' result
#' plot(result, type = "line")
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_n_factors <- function(x,
data = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.p_direction.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ data_plot.p_direction <- function(x, data = NULL, show_intercept = FALSE, ...) {
#' m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
#' result <- p_direction(m)
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_p_direction <- function(x,
data = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ data_plot.p_significance <- function(x,
#' m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
#' result <- p_significance(m)
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_p_significance <- function(x,
data = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.parameters_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ data_plot.parameters_efa <- data_plot.parameters_pca
#' result <- principal_components(mtcars[, 1:7], n = "all", threshold = 0.2)
#' result
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_parameters_pca <- function(x,
type = c("bar", "line"),
Expand Down
2 changes: 1 addition & 1 deletion R/plot.parameters_sem.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ data_plot.parameters_sem <- function(x,
#' @param threshold_coefficient Numeric, threshold at which value coefficients will be displayed.
#' @param threshold_p Numeric, threshold at which value p-values will be displayed.
#' @param ci Logical, whether confidence intervals should be added to the plot.
#' @importFrom ggplot2 .data
#'
#' @rdname plot.see_parameters_model
#' @export
plot.see_parameters_sem <- function(x,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.point_estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ data_plot.map_estimate <- data_plot.point_estimate
#' result <- point_estimate(m, centrality = "median")
#' result
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_point_estimate <- function(x,
data = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.rope.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ data_plot.rope <- function(x, data = NULL, show_intercept = FALSE, ...) {
#' result <- rope(m)
#' result
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_rope <- function(x,
data = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.si.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' result <- si(m)
#' result
#' plot(result)
#' @importFrom ggplot2 .data
#'
#' @export
plot.see_si <- function(x,
si_color = "#0171D3",
Expand Down
7 changes: 7 additions & 0 deletions R/see-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
#' @keywords internal
"_PACKAGE"

## see namespace: start
##
#' @import ggplot2
#'
## see namespace: end
NULL

# Suppress R CMD check note
# Namespace in Imports field not imported from: PKG
# All declared Imports should be used.
Expand Down
1 change: 1 addition & 0 deletions man/geom_violindot.Rd

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

1 change: 1 addition & 0 deletions man/geom_violinhalf.Rd

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

1 change: 1 addition & 0 deletions man/plot.see_check_collinearity.Rd

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

1 change: 1 addition & 0 deletions man/plot.see_compare_performance.Rd

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

1 change: 1 addition & 0 deletions man/plot.see_parameters_pca.Rd

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

Loading