2017-08-17 14:09:02

project_analysis.R# Import data # Clean data # Visualize data # Analyze data # Report findings
# Import data
my_data <- read.csv("path/2/data_file.csv")
# Clean data
my_data$gender <- tolower(my_data$gender) # make lower case
...
# Import data
source("R/Import_data.R") # source() runs scripts, loads functions
# Clean data
source("R/Clean_data.R")
# Visualize data
source("R/Visualize_data.R")
...
code, bulleted or numbered lists, web links, etc.title: "R Notebook" to something else, like title: "Rick's R Notebook"Untitled) with an .Rmd extension.*.Rmd code.*.nb.html file in a browser.# Big idea ## Smaller idea in service of bigger - Supporting point - Another suppporting point 1. an enumerated **bold** point 1. an enumerated *italicized* point - a [link](http://psu-psychology.github.io/r-bootcamp) to this bootcamp - an image:  - an equation: $e = mc^2$
rmarkdown::render("talks/bootcamp-survey.Rmd")rmarkdown::render('talks/bootcamp-survey.Rmd', output_format = "pdf_document")rmarkdown::render('talks/bootcamp-survey.Rmd', output_format = "word_document")rmarkdown::render('talks/bootcamp-survey.Rmd', output_format = "ioslides_presentation")rmarkdown::render('talks/bootcamp-survey.Rmd', output_format = c("pdf_document", "word_document", "github_document", "ioslides_presentation")
papaja
Make_site.RFile/New Project.../File/Open Project...# Get_bootcamp_googlesheet.R # # Script to authenticate to Google, extract R bootcamp survey data library(googlesheets) library(tidyverse) survey_url <- "https://docs.google.com/spreadsheets/d/1Ay56u6g4jyEEdlmV2NHxTLBlcjI2gHavta-Ik0kGrpg/edit?usp=sharing" bootcamp_by_url <- survey_url %>% extract_key_from_url() %>% gs_key() bootcamp_sheets <- gs_ws_ls(bootcamp_by_url)
boot_data <- bootcamp_by_url %>%
gs_read(bootcamp_sheets[1])
names(boot_data) <- c("Timestamp",
"R_exp",
"GoT",
"Age_yrs",
"Sleep_hrs",
"Fav_date",
"Tidy_data")
write_csv(boot_data, path = "data/survey.csv")
# Update_survey.R
#
# Updates Googlesheet survey data and generates new R Markdown report
#
source("R/Get_bootcamp_googlesheet.R")
rmarkdown::render("talks/bootcamp-survey.Rmd",
output_format = c("github_document",
"pdf_document",
"word_document",
"ioslides_presentation"))
_site.yml: site configuration parametersindex.Rmd: home page for site*.Rmd files: other pagesrmarkdown::render_site()Gilmore, Rick O, and Karen E Adolph. 2017. “Video Can Make Behavioural Science More Reproducible.” Nature Human Behavior 1 (12~jun). doi:10.1038/s41562-017-0128.
Munafò, Marcus R, Brian A Nosek, Dorothy V M Bishop, Katherine S Button, Christopher D Chambers, Nathalie Percie du Sert, Uri Simonsohn, Eric-Jan Wagenmakers, Jennifer J Ware, and John P A Ioannidis. 2017. “A Manifesto for Reproducible Science.” Nature Human Behaviour 1 (10~jan): 0021. doi:10.1038/s41562-016-0021.