Fix column references

Tento commit je obsažen v:
2024-09-17 21:54:31 -04:00
rodič 5d0d017a67
revize 4f9c2d3274

Zobrazit soubor

@@ -994,14 +994,14 @@ filter_data <- function(df, variables, nf = FALSE, missing = FALSE, adjust = FAL
if (rank) {
if (verbose) message("Calculating ranks for variable(s): ", paste(variables, collapse = ", "))
for (col in avg_zscore_cols) {
rank_col <- paste0("Rank_", col)
df[[rank_col]] <- rank(df[[col]], na.last = "keep")
}
for (variable in variables) {
avg_zscore_col <- paste0("Avg_Zscore_", variable)
rank_col <- paste0("Rank_", variable)
df[[rank_col]] <- rank(df[[avg_zscore_col]], na.last = "keep")
for (col in z_lm_cols) {
rank_lm_col <- paste0("Rank_lm_", col)
df[[rank_lm_col]] <- rank(df[[col]], na.last = "keep")
z_lm_col <- paste0("Z_lm_", variable)
rank_lm_col <- paste0("Rank_lm_", variable)
df[[rank_lm_col]] <- rank(df[[z_lm_col]], na.last = "keep")
}
}