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

data_rename(): "Error: Following variable(s) were not found" in version '0.13.0.17' #572

Merged
merged 12 commits into from
Dec 13, 2024
Prev Previous commit
Next Next commit
fix
strengejacke committed Dec 13, 2024
commit 06155c792b429a81e269ec106a62e5cbad8e956d
3 changes: 2 additions & 1 deletion R/data_rotate.R
Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@
#' names.
#' @param verbose Toggle warnings.
#'
#' @inherit data_rename seealso
#'
#' @return A (rotated) data frame.
#'
#' @examples
@@ -36,7 +38,6 @@
#' data_rotate(x, colnames = TRUE)
#' data_rotate(x, colnames = "c")
#'
#' @inherit data_rename seealso
#' @export
data_rotate <- function(data, rownames = NULL, colnames = FALSE, verbose = TRUE) {
# copy attributes
3 changes: 2 additions & 1 deletion R/data_to_long.R
Original file line number Diff line number Diff line change
@@ -33,6 +33,8 @@
#' with `tidyr::pivot_longer()`. If both `select` and `cols` are provided, `cols`
#' is used.
#'
#' @inherit data_rename seealso
#'
#' @details
#' Reshaping data into long format usually means that the input data frame is
#' in _wide_ format, where multiple measurements taken on the same subject are
@@ -124,7 +126,6 @@
#' values_to = "count"
#' )
#' head(even_longer_data)
#' @inherit data_rename
#' @export
data_to_long <- function(data,
select = "all",

Unchanged files with check annotations Beta

#'
#' @return A data frame comparable to `data`, with adjusted variables.
#'
#' @examplesIf require("bayestestR", quietly = TRUE) && require("rstanarm", quietly = TRUE) && require("gamm4", quietly = TRUE)

Check warning on line 33 in R/adjust.R

GitHub Actions / lint / lint

file=R/adjust.R,line=33,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 127 characters.
#' adjusted_all <- adjust(attitude)
#' head(adjusted_all)
#' adjusted_one <- adjust(attitude, effect = "complaints", select = "rating")
match = "and",
return_indices = FALSE,
remove_na = TRUE,
drop_na,

Check warning on line 109 in R/data_match.R

GitHub Actions / lint / lint

file=R/data_match.R,line=109,col=24,[function_argument_linter] Arguments without defaults should come before arguments with defaults. Consider setting the default to NULL and using is.null() instead of using missing()
...) {
if (!is.data.frame(to)) {
to <- as.data.frame(to)
}
if (all(c("CI_low", "CI_high") %in% names(x))) {
x$CI_low <- insight::format_ci(x$CI_low, x$CI_high, ci = NULL, digits = digits, width = ci_width, brackets = ci_brackets)

Check warning on line 18 in R/format.R

GitHub Actions / lint / lint

file=R/format.R,line=18,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 125 characters.
x$CI_high <- NULL
ci_lvl <- attributes(x)$ci
centrality_ci <- attributes(x)$first_centrality
}
if (verbose) {
insight::format_warning(paste0("Variable `", name, "` contains only one unique value and will not be normalized."))

Check warning on line 58 in R/ranktransform.R

GitHub Actions / lint / lint

file=R/ranktransform.R,line=58,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 121 characters.
}
return(x)
}
if (verbose) {
insight::format_warning(paste0("Variable `", name, "` contains only two different values. Consider converting it to a factor."))

Check warning on line 74 in R/ranktransform.R

GitHub Actions / lint / lint

file=R/ranktransform.R,line=74,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 134 characters.
}
}
}
if (method == "cor") {
smooth <- stats::cor(utils::head(x, length(x) - lag), utils::tail(x, length(x) - lag))

Check warning on line 42 in R/smoothness.R

GitHub Actions / lint / lint

file=R/smoothness.R,line=42,col=5,[object_overwrite_linter] 'smooth' is an exported object from package 'stats'. Avoid re-using such symbols.
} else {
smooth <- stats::sd(diff(x, lag = lag)) / abs(mean(diff(x, lag = lag)))

Check warning on line 44 in R/smoothness.R

GitHub Actions / lint / lint

file=R/smoothness.R,line=44,col=5,[object_overwrite_linter] 'smooth' is an exported object from package 'stats'. Avoid re-using such symbols.
}
if (!is.null(iterations)) {
if (!requireNamespace("boot", quietly = TRUE)) {

Check warning on line 48 in R/smoothness.R

GitHub Actions / lint / lint

file=R/smoothness.R,line=48,col=9,[if_not_else_linter] Prefer `if (A) x else y` to the less-readable `if (!A) y else x` in a simple if/else statement.
insight::format_warning("Package 'boot' needed for bootstrapping SEs.")
} else {
results <- boot::boot(
lag = lag
)
out_se <- stats::sd(results$t, na.rm = TRUE)
smooth <- data.frame(Smoothness = smooth, SE = out_se)

Check warning on line 59 in R/smoothness.R

GitHub Actions / lint / lint

file=R/smoothness.R,line=59,col=7,[object_overwrite_linter] 'smooth' is an exported object from package 'stats'. Avoid re-using such symbols.
}
}
weights = TRUE,
verbose = TRUE,
include_response = TRUE,
update_expr,

Check warning on line 107 in R/standardize.models.R

GitHub Actions / lint / lint

file=R/standardize.models.R,line=107,col=33,[function_argument_linter] Arguments without defaults should come before arguments with defaults.
...) {
m_info <- .get_model_info(x, ...)
data <- insight::get_data(x, source = "mf", verbose = FALSE)