From 186183a6523f262bed33df0a5d3605744a7f9b45 Mon Sep 17 00:00:00 2001 From: "C. Li" <47674556+cxli233@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:03:38 -0500 Subject: [PATCH] Update Heatmap_tutorial.md Small edits to improve versatility --- Heatmap_tutorial.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Heatmap_tutorial.md b/Heatmap_tutorial.md index b1882a2..ba73a35 100644 --- a/Heatmap_tutorial.md +++ b/Heatmap_tutorial.md @@ -153,7 +153,9 @@ my_data_reordered <- my_data %>% mutate(col = reorder(col, -n)) %>% # this reorders the columns select(-n) %>% inner_join(my_data_peak_values_reordered, by = "row") %>% - mutate(row = reorder(row, n)) # this reorders the rows + mutate(peaked_at = reorder(peaked_at, n)) %>% + mutate(order_rows = as.numeric(peaked_at)) %>% + mutate(row = reorder(row, order_rows)) # this reorders the rows by the "peaked_at" column. head(my_data_reordered)