class: center, middle, inverse, title-slide .title[ # R from start to finish ] .date[ ### 2021/05/18 ] --- class: center, middle, inverse # Keeping your analyses organised --- background-image: url(https://imgs.xkcd.com/comics/documents.png) background-size: contain ??? Image from Xkcd = https://xkcd.com/1459/ --- # Keeping your analyses organised You ran an experiment. You downloaded the data. You wrote an Rmarkdown document to process the data and run your analysis. You wrote your report based on that output. Where do you put all of this? --- # RStudio Projects On RStudio.cloud, each project you create is in fact a completely separate instance of R For working on your own projects (e.g. your dissertation) I recommend that you download and install [RStudio Desktop](https://www.rstudio.com/products/rstudio/download/) Once that's up and running, you can get to grips with [RStudio projects](https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects) Projects provide a neat way to organise your work into neat, individually tailored sets of directories. --- background-image: url(images/noneproject.png) background-size: contain --- background-image: url(images/projectdropdown.png) background-size: contain --- background-image: url(images/createnew.png) background-size: contain --- background-image: url(images/createdemo.png) background-size: contain --- background-image: url(images/createnew.png) background-size: contain --- # Keeping your analyses organised Make a new RStudio project for each separate "project" - one for your thesis, one for your assessment, and so on. Follow sensible structure: Keep your data in a folder called data. Keep your scripts in a folder called scripts. [Give your files sensible names!](https://speakerdeck.com/jennybc/how-to-name-files) For more general workflow advice, check out What They Forgot to Teach You About R at [https://rstats.wtf/](https://rstats.wtf/) --- class: center, middle, inverse # Watch the workflow demos! --- # Watch the workflow demos! On Panopto you'll find a couple of videos for this week that demonstrate some aspects of this process. 1) A demo of processing the raw data from the Fear of Crime study 2) A demo of processing the raw data from a study of mental rotation. These videos are *largely improvised*, far from exhaustive, and may occasionally be confusing when I become confused! --- class: center, middle, inverse # Some other things you can do with R --- background-size: contain # Create slides All of the R based lectures are created using RMarkdown and the [`xaringan`](https://slides.yihui.org/xaringan/) package. <img src="https://github.com/rstudio/hex-stickers/blob/master/PNG/xaringan.png?raw=true" width="300" style="display: block; margin: auto;" /> --- # Create websites and blogs The course website was created using the `distill` package. <img src="https://raw.githubusercontent.com/rstudio/distill/master/man/figures/logo.png" width="300" style="display: block; margin: auto;" /> [craddm.github.io/resmethods/](https://craddm.github.io/resmethods/) https://m-clark.github.io/distill-workshop/ --- # Create websites and blogs My own website and blog, [www.mattcraddock.com](https://www.mattcraddock.com), was created using `blogdown` <img src="https://raw.githubusercontent.com/rstudio/hex-stickers/master/PNG/blogdown.png" width="300" style="display: block; margin: auto;" /> https://alison.rbind.io/post/new-year-new-blogdown/ --- # Create interactive web apps R, through the `shiny` package <img src="https://raw.githubusercontent.com/rstudio/hex-stickers/master/thumbs/shiny.png" width="300" style="display: block; margin: auto;" /> [ERP demo app](https://craddm.shinyapps.io/ERPDemo) --- # Create memes ```r library(memer) meme_get("IsThisAPigeon") %>% meme_text_pigeon("Is this a research method?", "Me", "Memes") ``` <img src="8-R-from-start-to-finish_files/figure-html/unnamed-chunk-5-1.png" width="311" style="display: block; margin: auto;" /> --- class: center, middle, inverse # The R community -- [psyTeachR](https://psyteachr.github.io/) - the University of Glasgow -- [useR](https://user2021.r-project.org/program/overview/) -- [#rstats](https://twitter.com/hashtag/rstats?lang=en) -- [R-Ladies Global](https://rladies.org/) --- class: center, middle, inverse <img src="8-R-from-start-to-finish_files/figure-html/unnamed-chunk-6-1.png" width="300" />