Source: https://www.princeton.edu/~otorres/NiceOutputR.pdf