Rebecca @rlbarter kicking off by showing how you can present R code from a jupyter notebook #Rstats 👍👍👍
Oooo nice shortcut select your code and then “command I” makes everything nicely aligned! #rstats
The tribble function is a handy way of making a df #rstats - not as handy as datapasta of course but still pretty handy
What is an anonymous function? It is just a function that doesn’t have a name defined. Like a function that you do on the fly. #rstats
the modify function will do the same as map but will simply return the same kind of thing as the input- that seems useful #rstats
Ooo good practice tips... read in the data as data_orig and then make another version called data, that way you always have the original in your environment #rstats
map_chr(df, class) is a nice alternative to str() or summary() to see the class of each variable #rstats
map_dbl(df, n_distinct) gets you how many unique values in each column- nice #Tatar’s
How did I not know about the pluck() function? E.g pluck(1) is the same as [[1]], but you can %>% it! #rstats
Dplyr bonus, distinct(v1 , v2) will give you all the distinct combinations of v1 and v2 #rstats
When using map2 with ggplot, you can glue a title to your plot with + ggtitle(glue::glue(.x, “ “, .y)) #rstats
One more hot tip ... the fancy %<>% will work like df <- df %>% ..... #rstats
• • •
Missing some Tweet in this thread? You can try to
force a refresh