Skip to content

Instantly share code, notes, and snippets.

@Paul-Yuchao-Dong
Paul-Yuchao-Dong / .Rprofile
Created August 11, 2020 08:53
.Rprofile config to show trace on error
options(error = function() {
calls <- sys.calls()
if (length(calls) >= 2L) {
sink(stderr())
on.exit(sink(NULL))
cat("Backtrace:\n")
calls <- rev(calls[-length(calls)])
for (i in seq_along(calls)) {
cat(i, ": ", deparse(calls[[i]], nlines = 1L), "\n", sep = "")
}
@Paul-Yuchao-Dong
Paul-Yuchao-Dong / sorted stacked bars.Rmd
Last active August 16, 2019 21:33
Practice reordering of stacked bar chart
---
title: "sorted stacked bars"
output: github_document
---
# Practice reordering of stacked bar chart
inspiration: https://github.com/larissakostiw/-TidyTuesday/blob/master/roman.md
```{r message=FALSE, warning=F}
library(tidyverse)