class: center, middle, inverse, title-slide # A day in the life with R ### Rhian Davies (
@trianglegirl
) ### 2019-05-01 --- layout: true <div class = "rladies-header"> <span class="social"><table><tr><td><img src="images/twitter.gif"/></td><td> @trianglegirl</td></tr></table></span> </div> --- # About me .pull-left[  ] .pull-right[  ] --- background-image: url("https://media.giphy.com/media/eSakWipdNIaas/giphy.gif") background-position: 50% 50% class: center, inverse --- class: middle ```r library("beepr") Sys.sleep(180) beep() ``` --- background-image: url("https://media.giphy.com/media/pMDNVVNOKp3Ta/giphy.gif") background-position: 50% 50% class: center, inverse --- class: middle ```r library("BRRR") Sys.sleep(180) skrrrahh(18) ``` --- background-image: url("images/compiling.png") background-position: 50% 50% background-size: 70% class: center, inverse --- class: middle ```r library("RXKCD") getXKCD(which = "current") ``` --- # Twitter ```r library("rtweet") tweets <- as_tibble(search_tweets(q = "#GameOfThrones")) ``` ``` ## Searching for tweets... ``` ``` ## Finished collecting tweets! ``` .center[] --- background-image: url("https://media.giphy.com/media/o0vwzuFwCGAFO/giphy.gif") background-position: 50% 50% background-size: 50% class: center, inverse --- # Actually doing some work now... ## Reports 📝 ## Packages 📦 ## Shiny apps ✨ ## Handouts 📓 --- # Python 🐍 -- ```r library("reticulate") source_python("python-script.py") python_hello() ``` ``` ## [1] "Hello from Python" ``` -- # SPSS 📉 ```r library("haven") read_sav("nasty-spss-data-file-ugh.sav") ``` -- # PASTA 🍝 ```r library("datapasta") ``` --- background-image: url("images/tribble_paste.gif") background-position: 50% 50% background-size: 100% class: center, inverse --- background-image: url("https://media.giphy.com/media/4dSecMvy8Sdz2/giphy.gif") background-position: 50% 50% background-size: 100% class: center, inverse --- # Strava 🏃 ```r library("rStrava") strava_token <- httr::config(token = strava_oauth(app_name, app_client_id, app_secret)) my_acts <- get_activity_list(strava_token) act_data <- compile_activities(my_acts) ``` ```r total_dist = act_data %>% filter(start_date_local > ymd("2019-01-01")) %>% mutate(week = week(start_date_local)) %>% filter(type == "Run" | type == "Ride") %>% group_by(week, type) %>% summarise(total_dist = sum(distance)) ``` --- # Strava 🏃 ```r total_dist %>% ggplot(aes(x = week, y = total_dist, fill = type)) + geom_col() + xlab ("Week of 2019") + ylab ("Distance (km)") + facet_grid(cols = vars(type)) ``` <!-- --> --- # Leaflet
--- # Writing slides  --- # Writing slides ```md library("xaringan") --- title: "A day in the life with R" subtitle: "" author: "Rhian Davies ([\\@trianglegirl](https://twitter.com/trianglegirl))" --- # About me  * I love R * I play the triangle * I love pasta ``` --- # Write a blog post ```markdown library("blogdown") blogdown::new_post(title = "Making a blog post in R") --- title: Making a website in R author: '' date: '2019-05-01' slug: making-a-website-in-r categories: [] tags: [] --- # You'll never believe this one cool trick about R Witty, interesting content. ![images/funnypicture.png]() ``` ## [trianglegirl.rbind.io/](http://trianglegirl.rbind.io/post/tidy-tuesday/) --- # Write a C.V ```r library("pagedown") ```  --- background-image: url("https://media.giphy.com/media/eSQKNSmg07dHq/giphy.gif") background-position: 50% 50% background-size: 100% class: center, inverse --- # Bookdown 📖 ```c # Pasta ## Lentil Ragu * 1 onion, finely chopped * 2 carrots, finely chopped * celery finely chopped * 2 garlic cloves, crushed * 250g bag dried red lentils * 400g cans chopped tomatoes * 1 tbsp tomato purée * 1 tsp each dried oregano and thyme * 1 bay leaf * 500ml vegetable stock * 250g spaghetti Heat the oil in a large saucepan and add the onions, carrots, celery and garlic. Cook gently for 15-20 mins until everything is softened. Stir in the lentils, chopped tomatoes, tomato purée, herbs and stock. Bring to a simmer, then cook for 40-50 mins until the lentils are tender and saucy – splash in water if you need. Season. Serve with spaghetti or linguine and cheese. ``` --- background-image: url("images/recipes.png") background-position: 50% 50% background-size: 80% class: center # https://trianglegirl.github.io/recipes/ --- background-image: url("images/netflixR.png") background-position: 50% 50% background-size: 90% class: center, inverse # NetflixR --- class: center, middle, inverse  <a href="https://trianglegirl.rbind.io"><i class="fa fa-link fa-fw"></i> trianglegirl.rbind.io</a><br> <a href="http://twitter.com/trianglegirl"><i class="fa fa-twitter fa-fw"></i> @trianglegirl</a><br> <a href="http://github.com/trianglegirl"><i class="fa fa-github fa-fw"></i> @trianglegirl</a><br>