Skip to content

Commit

Permalink
also sort attributes!
Browse files Browse the repository at this point in the history
  • Loading branch information
DominiqueMakowski committed Dec 26, 2024
1 parent f3dd4cc commit b48e6bb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/cor_sort.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ cor_sort.easycormatrix <- function(x, distance = "correlation", hclust_method =
attributes(reordered)
)

# Reorder attributes (p-values) etc.
for(id in c("p", "CI", "CI_low", "CI_high", "BF", "Method", "n_Obs", "df_error", "t")) {

Check warning on line 80 in R/cor_sort.R

View workflow job for this annotation

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

file=R/cor_sort.R,line=80,col=6,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.

Check warning on line 80 in R/cor_sort.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/cor_sort.R,line=80,col=6,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.
if(id %in% names(attributes(reordered))) {

Check warning on line 81 in R/cor_sort.R

View workflow job for this annotation

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

file=R/cor_sort.R,line=81,col=7,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.

Check warning on line 81 in R/cor_sort.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/cor_sort.R,line=81,col=7,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.
attributes(reordered)[[id]] <- attributes(reordered)[[id]][order(x$Parameter), names(reordered)]
}
}

# make sure Parameter columns are character
reordered$Parameter <- as.character(reordered$Parameter)

Expand Down

0 comments on commit b48e6bb

Please sign in to comment.