Skip to content

Commit

Permalink
More linking in docs (#291)
Browse files Browse the repository at this point in the history
* More linking in docs

* a few more tweaks
  • Loading branch information
IndrajeetPatil authored Jul 29, 2024
1 parent 6940fbe commit 54700ba
Show file tree
Hide file tree
Showing 23 changed files with 55 additions and 62 deletions.
4 changes: 2 additions & 2 deletions R/add-expression-col.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#' @description
#'
#' Creates an expression from a data frame containing statistical details.
#' Ideally, this data frame would come from having run `tidy_model_parameters`
#' function on your model object.
#' Ideally, this data frame would come from having run `tidy_model_parameters()`
#' on your model object.
#'
#' This function is currently **not** stable and should not be used outside of
#' this package context.
Expand Down
2 changes: 1 addition & 1 deletion R/centrality-description.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' grouping variable in `x` by a set of indices (e.g., measures of centrality,
#' dispersion, range, skewness, kurtosis, etc.). It additionally returns an
#' expression containing a specified centrality measure. The function internally
#' relies on `datawizard::describe_distribution()` function.
#' relies on [`datawizard::describe_distribution()`] function.
#'
#' @description
#' Parametric, non-parametric, robust, and Bayesian measures of centrality.
Expand Down
10 changes: 6 additions & 4 deletions R/contingency-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
#' represents a single observation.
#' @param paired Logical indicating whether data came from a within-subjects or
#' repeated measures design study (Default: `FALSE`).
#' @param sampling.plan Character describing the sampling plan. Possible options
#' are `"indepMulti"` (independent multinomial; default), `"poisson"`,
#' `"jointMulti"` (joint multinomial), `"hypergeom"` (hypergeometric). For
#' more, see `?BayesFactor::contingencyTableBF()`.
#' @param sampling.plan Character describing the sampling plan. Possible options:
#' - `"indepMulti"` (independent multinomial; default)
#' - `"poisson"`
#' - `"jointMulti"` (joint multinomial)
#' - `"hypergeom"` (hypergeometric).
#' For more, see [`BayesFactor::contingencyTableBF()`].
#' @param fixed.margin For the independent multinomial sampling plan, which
#' margin is fixed (`"rows"` or `"cols"`). Defaults to `"rows"`.
#' @param prior.concentration Specifies the prior concentration parameter, set
Expand Down
6 changes: 3 additions & 3 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @title Movie information and user ratings from IMDB.com (wide format).
#' @name movies_wide
#' @details Modified dataset from `ggplot2movies` package.
#' @details Modified dataset from `{ggplot2movies}` package.
#'
#' The internet movie database, <https://imdb.com/>, is a website devoted
#' to collecting movie data supplied by studios and fans. It claims to be the
Expand Down Expand Up @@ -34,7 +34,7 @@

#' @title Movie information and user ratings from IMDB.com (long format).
#' @name movies_long
#' @details Modified dataset from `ggplot2movies` package.
#' @details Modified dataset from `{ggplot2movies}` package.
#'
#' The internet movie database, <https://imdb.com/>, is a website devoted
#' to collecting movie data supplied by studios and fans. It claims to be the
Expand Down Expand Up @@ -72,7 +72,7 @@
#' petal length and width, respectively, for 50 flowers from each of 3 species
#' of iris. The species are Iris setosa, versicolor, and virginica.
#'
#' This is a modified dataset from `datasets` package.
#' This is a modified dataset from `{datasets}` package.
#'
#' @format A data frame with 600 rows and 5 variables
#'
Expand Down
2 changes: 1 addition & 1 deletion R/helpers-easystats.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tidy_model_parameters <- function(model, ...) {


#' @name tidy_model_effectsize
#' @title Convert `effectsize` package output to `tidyverse` conventions
#' @title Convert `{effectsize}` package output to `{tidyverse}` conventions
#'
#' @param data A data frame returned by `{effectsize}` functions.
#' @param ... Currently ignored.
Expand Down
2 changes: 1 addition & 1 deletion R/long-to-wide-converter.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' internal identifier. So if your data is **not** sorted, the results *can*
#' be inaccurate when there are more than two levels in `x` and there are
#' `NA`s present. The data is expected to be sorted by user in
#' subject-1,subject-2, ..., pattern.
#' subject-1, subject-2, ..., pattern.
#' @param y The response (or outcome or dependent) variable from `data`.
#' @param subject.id Relevant in case of a repeated measures or within-subjects
#' design (`paired = TRUE`, i.e.), it specifies the subject or repeated
Expand Down
7 changes: 3 additions & 4 deletions R/meta-analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
#' @param data A data frame. It **must** contain columns named `estimate` (effect
#' sizes or outcomes) and `std.error` (corresponding standard errors). These
#' two columns will be used:
#' - as `yi` and `sei` arguments in `metafor::rma()` (for **parametric** test)
#' or `metaplus::metaplus()` (for **robust** test)
#' - as `y` and `SE` arguments in `metaBMA::meta_random()` (for **Bayesian**
#' test).
#' - as `yi` and `sei` arguments in [`metafor::rma()`] (for **parametric** test)
#' - as `yi` and `sei` arguments in [`metaplus::metaplus()`] (for **robust** test)
#' - as `y` and `SE` arguments in [`metaBMA::meta_random()`] (for **Bayesian** test)
#' @inheritParams one_sample_test
#' @inheritParams metaplus::metaplus
#' @inheritParams oneway_anova
Expand Down
4 changes: 2 additions & 2 deletions R/oneway-anova.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#' width to use in calculating Bayes factors and posterior estimates. In
#' addition to numeric arguments, several named values are also recognized:
#' `"medium"`, `"wide"`, and `"ultrawide"`, corresponding to *r* scale values
#' of 1/2, sqrt(2)/2, and 1, respectively. In case of an ANOVA, this value
#' corresponds to scale for fixed effects.
#' of `1/2`, `sqrt(2)/2`, and `1`, respectively. In case of an ANOVA, this
#' value corresponds to scale for fixed effects.
#' @inheritParams two_sample_test
#' @inheritParams add_expression_col
#' @param ... Additional arguments (currently ignored).
Expand Down
15 changes: 4 additions & 11 deletions R/tidy-model-expressions.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#'
#' @param ... Currently ignored.
#' @param data A tidy data frame from regression model object (see
#' `statsExpressions::tidy_model_parameters()`).
#' [`statsExpressions::tidy_model_parameters()`]).
#' @param statistic Which statistic is to be displayed (either `"t"` or `"f"`or
#' `"z"` or `"chi"`) in the expression.
#' @inheritParams oneway_anova
Expand All @@ -13,11 +13,6 @@
#' `p.value`) are missing, for these rows, a `NULL` is returned instead of an
#' expression with empty strings.
#'
#' @note
#'
#' This is an **experimental** function and may change in the future. Please do
#' not use it yet in your workflow.
#'
#' @autoglobal
#'
#' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true")
Expand Down Expand Up @@ -46,9 +41,8 @@ tidy_model_expressions <- function(
statistic <- substring(tolower(statistic), 1L, 1L)

# if any of the necessary numeric columns are missing, there shouldn't be an
# expression corresponding to that row
#
# convert the necessary columns to character type for expression
# expression corresponding to that row; convert the necessary columns to
# character type for expression
df_expr <- data %>%
filter(if_all(
.cols = matches("estimate|statistic|std.error|p.value"),
Expand Down Expand Up @@ -95,8 +89,7 @@ tidy_model_expressions <- function(
# nolint end

# Replace `NA` with `NULL` to show nothing instead of an empty string ("")
left_join(data, select(df_expr, term, expression), by = "term") %>%
.glue_to_expression()
left_join(data, select(df_expr, term, expression), by = "term") %>% .glue_to_expression()
}


Expand Down
4 changes: 2 additions & 2 deletions man/add_expression_col.Rd

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

2 changes: 1 addition & 1 deletion man/centrality_description.Rd

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

12 changes: 8 additions & 4 deletions man/contingency_table.Rd

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

4 changes: 2 additions & 2 deletions man/corr_test.Rd

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

2 changes: 1 addition & 1 deletion man/iris_long.Rd

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

2 changes: 1 addition & 1 deletion man/long_to_wide_converter.Rd

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

7 changes: 3 additions & 4 deletions man/meta_analysis.Rd

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

2 changes: 1 addition & 1 deletion man/movies_long.Rd

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

2 changes: 1 addition & 1 deletion man/movies_wide.Rd

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

4 changes: 2 additions & 2 deletions man/one_sample_test.Rd

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

6 changes: 3 additions & 3 deletions man/oneway_anova.Rd

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

6 changes: 3 additions & 3 deletions man/pairwise_comparisons.Rd

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

6 changes: 1 addition & 5 deletions man/tidy_model_expressions.Rd

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

6 changes: 3 additions & 3 deletions man/two_sample_test.Rd

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

0 comments on commit 54700ba

Please sign in to comment.