ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing reproducible research A. Michelle Lawing Ecosystem Science and Management Texas A&M University College Sta,on, TX 77843 [email protected]
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
reproducible research A. Michelle Lawing
Ecosystem Science and Management Texas A&M University
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Announcements
• May 5th is redefined day (go to your Friday classes), so no presenta,ons
• Final Project (2 op,ons) – 10% of final grade – Turn in a video of your final project (around three minutes, these will be posted on my webpage)
(e.g., h[p://www.kindealabs.com/) – Turn in a manuscript for cri,cal review and feedback.
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Schedule for today
• My presenta,on – on reproducible research
• Presenta,on on end to end reproducibility • Demonstra,on on end to end reproducibility
• ?BREAK • ?Tutorial on end to end reproducibility
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
reproducible research
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Cornerstones of the scien,fic method
• Reproducibility Does not make the science right or wrong
• Rigor To evaluate reproducibility
• Transparency To evaluate reproducibility
• Independent verifica,on Allows science to move forward
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Geeng help
• Post online ques,ons
• Email code to another R user
• Need to be able to get reproducible errors
• This allows someone else to copy and paste your code without changing anything
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Four items for Code Share
• R environment
• Required packages
• Data
• Code
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
R environment
• sessionInfo() #summarizes your R environment
• makes it easy to detect out of date packages
• usually I make a folder for each “project” and open the R script from within that folder – automa,cally takes me to the correct environment
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Packages
• Should be loaded at the top of the script
• Easy to see which ones are needed
• I usually include and comment out the install.packages() command to make it easy for installing packages.
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Data
• You can use r code to recreate data to output
• dput() outputs an ASCII text representa,on of your data
• save() writes an external representa,on of an R object
• write(), write.table(), write.csv
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Code
• write code that is easy to read by others • use spaces • make variable names concise, but informa,ve • use comments • remove everything that is not related • the shorter your code, the easier it is to understand
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Check for yourself
• Start up a fresh R session • Paste in your script
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing
Post it
• h[ps://gist.github.com/
• Gist is a simple way to share snippets and pastes with others. All gists are Git repositories, so they are automa,cally versioned, forkable and usable from Git.
ESSM 689 Quan,ta,ve Methods in Ecology, Evolu,on and Biogeography
Ecosystem Science and Management | Texas A&M University (c) 2015, A. Michelle Lawing