Water can form high- (left) and low-density amorphous ices at liquid-nitrogen temperatures. Researchers want to determine whether water can also form two distinct liquid phases at low temperature. Credit: Osamu Mishima
“When a country owes more than 90 percent of its GDP, it slides into recession.”
Photo by Annie Spratt on Unsplash
Photo by Annie Spratt on Unsplash
Photo by Annie Spratt on Unsplash
What comment could go here?
Any fool can write code that a computer can understand. Good programmers write code that humans can understand. – Martin Fowler
data %>%
group_by(age_group,date) %>%
summarise(cases = n()) %>%
ggplot(aes(x=date,y=cases,color=age_group) +
geom_line()
data2 %>%
group_by(age_group,date) %>%
summarise(cases = n()) %>%
ggplot(aes(x=date,y=cases,color=age_group) +
geom_line()
grouped_data %>%
ggplot(aes(x=date,y=cases,color=age_group) +
geom_line()
#' Group row level data by age_group and date
#' and count number of cases in each strata
#'
#' @param data row level data
#'
#' @return tibble
group_case_data <- function(data){
data %>%
group_by(age_group,date) %>%
summarise(cases = n())
}
#' Plot cases in time by age group
#'
#' @param data aggregated data
#'
#' @return ggplot2 object
plot_case_data <- function(data){
data %>%
ggplot(aes(x=date,y=cases,color=age_group) +
geom_line()
}
data %>%
group_by(age_group,date) %>%
summarise(cases = n()) %>%
ggplot(aes(x=date,y=cases,color=age_group) +
geom_line()
data2 %>%
group_by(age_group,date) %>%
summarise(cases = n()) %>%
ggplot(aes(x=date,y=cases,color=age_group) +
geom_line()
grouped_data %>%
ggplot(aes(x=date,y=cases,color=age_group) +
geom_line()
A good rule of thumb is to assume that the information contained within the README will be the only documentation your users read. – Benjamin Lee, Ten simple rules for documenting scientific software
usethis::use_readme_rmd()
)# Project Name
#### -- Project Status: [Active, On-Hold, Completed]
## Project Intro/Objective
The purpose of this project is ________. (Describe the main goals of the project. Limit to a short paragraph, 3-6 Sentences)
### Methods Used
* Inferential Statistics
* Machine Learning
* Data Visualization
* Predictive Modeling
* etc.
### Technologies
* R
* Python
* D3
* etc.
## Project Description
(Provide more detailed overview of the project.
Talk a bit about your data sources and what questions and hypothesis you are exploring.
What specific data analysis/visualization and modelling work are you using to solve the problem?
What blockers and challenges are you facing?
Feel free to number or bullet point things here)
## Getting Started
1. Clone this repo (for help see this [tutorial](https://help.github.com/articles/cloning-a-repository/)).
2. Raw Data is being kept [here](Repo folder containing raw data) within this repo.
*If using offline data mention that and how they may obtain the data from the group)*
3. Data processing/transformation scripts are being kept [here](Repo folder containing data processing scripts/notebooks)
4. etc...
*If your project is well underway and setup is fairly complicated (ie. requires installation of many packages) create another "setup.md" file and link to it here*
5. Follow setup [instructions](Link to file)
## Featured Notebooks/Analysis/Deliverables
* [Notebook/Markdown/Slide Deck Title](link)
* [Notebook/Markdown/Slide DeckTitle](link)
* [Blog Post](link)
## Members
**Team Leads (Contacts) : [Full Name](https://github.com/[github handle])(@slackHandle)**
#### Other Members:
|Name | Slack Handle |
|---------|-----------------|
|[Full Name](https://github.com/[github handle])| @johnDoe |
|[Full Name](https://github.com/[github handle]) | @janeDoe |
## Contact
Use the following checklist
Code is much more often read than it is written
tidyverse
style guidelintr
tells you if your code conforms to the style guidestylr
package can automatically fix your code so it conforms to the style guide1_collect_data.R
2_transform_data.R
3_generate_model.R
4_write_report.rmd
# Define targets and dependencies
all: final_report.html
echo All files are now up to date
final_report.html: model_results.rds final_report.Rmd
Rscript -e "rmarkdown::render('final_report.Rmd')"
model_results.rds: model_fitting.R processed_data.rds
Rscript model_fitting.R
processed_data.rds: data_processing.R generated_data.csv
Rscript data_processing.R
generated_data.csv: data_generation.R
Rscript data_generation.R
# Clean up intermediate files
clean:
rm -f generated_data.csv processed_data.rds model_results.rds final_report.html
When sharing a project with other collaborators, you may want to ensure everyone is working with the same environment – otherwise, code in the project may unexpectedly fail to run because of changes in behavior between different versions of the packages in use. - Kevin Ushey, Posit Software, PBC
In R, the fundamental unit of shareable code is the package. A package bundles together code, data, documentation, and tests, and is easy to share with others. - Hadley Wickham
usethis
make this surprisingly easy to do