My Personal Blog

Home

TIL

Adding flake8 and pylint settings to vscode

Feb. 9, 2024 | Categories: dev TIL

I am experimenting with using the `black` formatter in conjunction with `flake8` and `pylint` in vscode. One common issue I have encountered is that they disagree on line lengths. Based on these recommendations for [black](https://github.com/psf/black/blob/a4014668898f6eb80a9197fc185cac9233f0e68a/docs/compatible_configs.md#configuration-1) and [pylint](https://github.com/psf/black/blob/a401466889…

Making a nice stacked barchart in ggplot

Jan. 24, 2024 | Categories: TIL

The following R code demonstrates how to make a nice stacked barchart using `forcats` and `ggplot`. - `fct_lump()` lumps the least common values in an 'Other' category. - `fct_infreq()` reorders the factor level by the number of observations descending. - `fct_rev()` flips that order, which makes the the factors with the largest observations appear on the bottom of the plot. ```r libra…