Skip to content

Commit 186183a

Browse files
authored
Update Heatmap_tutorial.md
Small edits to improve versatility
1 parent 035cb3e commit 186183a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Heatmap_tutorial.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ my_data_reordered <- my_data %>%
153153
mutate(col = reorder(col, -n)) %>% # this reorders the columns
154154
select(-n) %>%
155155
inner_join(my_data_peak_values_reordered, by = "row") %>%
156-
mutate(row = reorder(row, n)) # this reorders the rows
156+
mutate(peaked_at = reorder(peaked_at, n)) %>%
157+
mutate(order_rows = as.numeric(peaked_at)) %>%
158+
mutate(row = reorder(row, order_rows)) # this reorders the rows by the "peaked_at" column.
157159
158160
159161
head(my_data_reordered)

0 commit comments

Comments
 (0)