Lately I tried to visualize an hierarchy with Tableau Desktop. The problem was that the hierarchy had a variable depth because it was tree-based. Each row had an id and a parent_id. Normally hierarchies in Tableau are defined by pulling some fields together, such as product category, product group and product id.
Handling tree-based hierarchies seems to be a lot more complex. I found a plugin at https://github.com/tableau/extension-hierarchy-navigator-sandboxed but this only works online.
So I asked myself how I can handle this using R. I found the R-package
data.tree at https://github.com/gluc/data.tree. I want to describe how I use
this package to preprocess my data.
Sometimes you generate lots of ggplots of a similar kind, e.g. visualizations of different timeseries. Then you want to highlight some dates where something special had happened and you want to show that the value you are plotting changed at these dates.
So it would be nice if we can refactor these
into one single function.
You know it, I’m sure: You are developing a data transformation using lots of pipes. Then you need to remove one or more lines. You do this using comments.
So far so good. But if it’s the last line you want to remove a simple comment will produce an error because of the trailing pipe symbol at the end of the second to last line.
Here’s a solution:
Lately R version 4.1.0 was released on CRAN (see https://cran.r-project.org).
The MacOS version was one day late. But yesterday it was released, too. So I wanted to test the new version without being able to go back. “No problem”, I thought “I’m already using RSwitch”. RSwitch is a tiny Mac program which allows you to switch between installed R versions.
But unfornately RSwitch told me that R version 4.0.5 was incomplete after I’ve installed version 4.1.0.