Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 28, 2024
1 parent 41dc962 commit 86f3d81
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
21 changes: 9 additions & 12 deletions R/correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,9 @@
#' `stats` package are supported.
#' }
#'
#' @examplesIf requireNamespace("poorman", quietly = TRUE) && requireNamespace("psych", quietly = TRUE)
#'
#' @examplesIf all(insight::check_if_installed(c("psych", "datawizard"), quietly = TRUE)) && getRversion() >= "4.1.0"
#' library(correlation)
#' library(poorman)
#' data(iris)
#'
#' results <- correlation(iris)
#'
Expand All @@ -192,22 +191,20 @@
#' summary(results, redundant = TRUE)
#'
#' # pipe-friendly usage with grouped dataframes from {dplyr} package
#' iris %>%
#' iris |>
#' correlation(select = "Petal.Width", select2 = "Sepal.Length")
#'
#' # Grouped dataframe
#' # grouped correlations
#' iris %>%
#' group_by(Species) %>%
#' iris |>
#' datawizard::data_group(Species) |>
#' correlation()
#'
#' # selecting specific variables for correlation
#' mtcars %>%
#' group_by(am) %>%
#' correlation(
#' select = c("cyl", "wt"),
#' select2 = c("hp")
#' )
#' data(mtcars)
#' mtcars |>
#' datawizard::data_group(am) |>
#' correlation(select = c("cyl", "wt"), select2 = "hp")
#'
#' # supplying custom variable names
#' correlation(anscombe, select = c("x1", "x2"), rename = c("var1", "var2"))
Expand Down
21 changes: 9 additions & 12 deletions man/correlation.Rd

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

1 change: 0 additions & 1 deletion tests/testthat/test-display_print_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
test_that("display and print method works - markdown", {
skip_on_cran()
skip_if_not_or_load_if_installed("gt")
skip_if_not_or_load_if_installed("poorman")
expect_snapshot(display(summary(correlation(iris))))
expect_snapshot(print(summary(correlation(iris))))
})
Expand Down

0 comments on commit 86f3d81

Please sign in to comment.