sures
play

sures : Some of my not ideal R habits and how the Tidyverse - PowerPoint PPT Presentation

Con Confessi ssion ons s and Cou Counterm rmeasu sures : Some of my not ideal R habits and how the Tidyverse resolved them Rachael Workman PhD student, BCMB ** ** ** ** ** ** https://osf.io/69gub/ Th This year I Made data


  1. Con Confessi ssion ons s and Cou Counterm rmeasu sures : Some of my not ideal R habits and how the Tidyverse resolved them Rachael Workman PhD student, BCMB

  2. ** ** ** ** ** ** https://osf.io/69gub/

  3. Th This year I… Made data import harder than it had to be Excel with multiple sheets à Open, select sheet of interest à Save worksheet as CSV à Import using base R into dataframe VS OR

  4. Th This year I… Made data import harder than it had to be Benefits to tibbles over dataframes 1. Tibbles print nicely, they show the data type of each column, and if you subset one, it returns another tibble. vs

  5. Th This is year ar I… Did calculations in Excel and reimported my dataset Excel with multiple sheets à Open, select sheet of interest à Save worksheet as CSV à Import using base R into dataframe à Realized I needed to compute the sum of two columns à opened Excel file à calculated sum in Excel à resaved as CSV à reimported into R VS Column name of new column Two numerical columns to add together

  6. Th This year I … Saved too many intermediate objects • The pipe operator is your friend VS

  7. Th This is year ar I… Read in a bunch of similar datasets one at a time VS ……for 12 files, which I then concatenated…

  8. On that note - why care about reducing duplication? • “It’s easier to see the intent of your code, because your eyes are drawn to what’s different, not what stays the same. • It’s easier to respond to changes in requirements. As your needs change, you only need to make changes in one place, rather than remembering to change every place that you copied-and-pasted the code. • You’re likely to have fewer bugs because each line of code is used in more places.” ---R for Data Science, Grolemund and Wickham

  9. Th This is year ar I… Did a lot of plotting using default color schemes ggplot color options – why go past geom_bar() default? 1. Colorblind-friendly graphs 2. Demonstrate a point 3. Just stand out geom_freqpoly()

  10. Ma Make y you our o r own c col olorb orblind f fri riendly pa palette e for gg ggplot

  11. Mor More p palettes RColorBrewer

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend