Skip to content

Instantly share code, notes, and snippets.

@andreagrioni
Created November 26, 2021 10:02
Show Gist options
  • Save andreagrioni/f68c933c53855190afcdd192fe38554e to your computer and use it in GitHub Desktop.
Save andreagrioni/f68c933c53855190afcdd192fe38554e to your computer and use it in GitHub Desktop.
Pivot to wider formant summary top table
# topTable summary from limma
table_iv %>%
# select target coeffients
dplyr::select(dplyr::all_of( c("Var1", targets_coef))) %>%
# pivot coefficient to long format
tidyr::pivot_longer(!Var1) %>%
# separate coefficients into new cols
tidyr::separate(name, into=c("ARMCD", "day")) %>%
# pivot wider along days/timepoint
tidyr::pivot_wider(names_from=day, values_from=value) %>%
# remove not significant proteins
dplyr::filter(Var1 != "NotSig")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment