Is it forcats?
Hi,
Today, a handful of useful resources and a picture for attention:
Here is a cheat sheet for good practices in R.
I wanted to draw your attention to reprex, which is a package for creating reproducible examples. If you ever needed help and wanted to ask for it online —be it in places like Stack Overflow or GitHub — rather than just taking a screenshot of the code in question, do it this way.
If you have to play with factors a lot, forcats 🐈🐈🐈🐈 may come in handy — it allows you to combine factors, change their values, or order them (relevel). The latter is useful for visualisation purposes and when you want to highlight specific dependencies. For example, you may want to know how much gene expression in smokers changes in relation to people who don’t smoke. If you call your smokers “group A” and non-smokers “group B,” chances are that R will use alphabetical order and display the data accordingly. In this case, you can manually change the order of your groups (factors) so that “group B” comes before “group A”.
I use tidyr and dplyr a lot and I am sure you have used them too, but it’s always good to refresh some of their functionalities.
Ciao,
Agnes
PS: Here is the survey in which you can tell me what R topic you find particularly confusing and why you want to learn it so that we can shape this space together!