Twitter | Search | |
We are R-Ladies Aug 29
🐫 Happy Wednesday! In the spirit of 's Lesser Known ⭐️s of the Tidyverse (πŸ“Ή ), today I am going to be sharing some of my favorite tricks!
Reply Retweet Like
We are R-Ladies
☝️ My first tip: use purrr::map_df() to read all .csv files in a πŸ“‚ and stick them in a single data frame: f <- list.files( "my_folder", pattern = "*.csv", full.names = TRUE) d <- purrr::map_df(f, readr::read_csv, .id = "id")
Reply Retweet Like More
We are R-Ladies Aug 29
Replying to @WeAreRLadies
✌️ My second tip: use broom::tidy() πŸ› to get a nice data frame of your model results: m <- lm(mpg ~ qsec + wt, data = mtcars) broom::tidy(m)
Reply Retweet Like
Henning Aug 29
Replying to @WeAreRLadies
Pipe it! :)
Reply Retweet Like
We are R-Ladies Aug 29
Replying to @WeAreRLadies
πŸ‘Œ My third tip: glue ✨ that broom output into some nice sentences for a manuscript: m <- lm(mpg ~ qsec + wt, data = mtcars) t <- broom::tidy(m) glue::glue_data(t, "The point estimate for the {term} term is {round(estimate, 3)} (p-value = {signif(p.value, 2)}).")
Reply Retweet Like
We are R-Ladies Aug 29
Replying to @henningsway
The pipe really does always make things look prettier πŸ˜πŸ’…
Reply Retweet Like
We are R-Ladies Aug 29
Replying to @WeAreRLadies
🀘🀘 My fourth tip: Have a collaborator that would prefer for your documents πŸ“ƒ to be in Word? You can render .Rmd files into Word documents: πŸ‘‰ update your yaml: output: word_document -or- πŸ‘‰rmarkdown::render( "my_document.Rmd", output_format = "word_document")
Reply Retweet Like
We are R-Ladies Aug 29
Replying to @WeAreRLadies
πŸ– My fifth tip: Hate emailing πŸ“§ Word documents back and forth? Send that doc you just knit from your .Rmd file to Google Drive! googledrive::drive_upload( β€œmy_document.docx”, type = β€œdocument”)
Reply Retweet Like
We are R-Ladies Aug 29
Replying to @yoniceedee
😎 Final (meta) tip: Create clean code images using 's carbonate πŸ“¦ ☝️ Copy code you'd like to share to your clipboard πŸ“‹ ✌️ Run this code to generate the image and view it in your browser x <- carbonate::carbon$new() x$browse() πŸ”—
Reply Retweet Like
We are R-Ladies Aug 29
Replying to @yoniceedee
πŸ—£ What are YOUR favorite tips and tricks?
Reply Retweet Like
Ruari Rhodes Aug 30
Replying to @WeAreRLadies
Very neat workflow. Are there googledrive-like packages for (e.g.) Onedrive?
Reply Retweet Like
Anna Decker-Wilson Aug 30
Replying to @WeAreRLadies
Ooh, this is good. What about for box?
Reply Retweet Like
We are R-Ladies Aug 30
Replying to @AnnaDWilson
It looks like there is a πŸ“¦ called boxr that can handle this: I've never used it, but it looks like box_write() may be the function you're looking for!
Reply Retweet Like
We are R-Ladies Aug 30
Replying to @RuariRhodes @_inundata
I'm not sure about onedrive. There are other πŸ“¦s for googledrive-like services like: πŸ—ƒ Dropbox: 's rdrop2 ⏹ Box: boxr
Reply Retweet Like