Skip to content

Commit

Permalink
Use a factor in position names
Browse files Browse the repository at this point in the history
Helps with sorting by row & column.
  • Loading branch information
llrs committed May 8, 2024
1 parent 665d64e commit 27fa2b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ position_name <- function(rows, columns) {
positions <- expand.grid(rows, columns, stringsAsFactors = FALSE)
colnames(positions)[1:2] <- c("row", "column")
positions <- positions[order(positions$row, positions$column), ]
positions$name <- paste0(positions$row, positions$column)
positions$name <- as.factor(paste0(positions$row, positions$column))
positions
}

Expand Down

0 comments on commit 27fa2b0

Please sign in to comment.