gt() doesn't show Euro-Sign € in PDF, showing EUR instead

When it comes to using tidyverse in non-American contexts it gets often a little bit tricky. The last time I encountered a problem was when I tried to show the Euro-sign (€) in a PDF created with quarto and the gt-package.

Using html as output format everything was fine, but when I tried to create a PDF the Euro-sign was replaced by EUR.

There’s already an open issue at github ([ https://github.com/rstudio/gt/issues/1345]). But it’s getting pushed further and further down on the list of expected release versions.

forcats::fct_lump_n() with weights "overall"

Sometimes I want to summarize some categories which don’t have much impact on my analysis. So the best way to do this is using some of the forcats::fct_lump*() functions. But I often struggle to find the way using the weights to order the categories. That’s because the main use case of fct_lump() is a vector of a factor containing several values and getting the most n and the rest combined as “other”.

JSON, NULL values and as_tibble

When working with data provided by common APIs you will almost always get in contact with JSON formatted data. Using R’s rjson::fromJSON will transform JSON to R’s lists. So far so good. Converting those lists to tibble using tibble::as_tibble will fail when the JSON (and therefor the list) contains NULL values. So you havve to replace them before building the tibble.

How to use nflfastR with Google BigQuery?

Lately I wanted to play around with nflfastR. That’s a great package giving you access to NFL’s play-by-play data since 1999. It let’s you download all the data and store it in several different databases.

Unfortunately I ran into trouble when I tried to import the data to Google’s BigQuery.