link to data Introduction to using for loops What Are Loops? “Looping”, “cycling”, “iterating” or just replicating instructions is an old practice that originated well before the invention of computers. It is nothing more than automating a multi-step process by organizing sequences of actions or ‘batch’ processes and by grouping the parts that need to be repeated. All modern programming languages provide special constructs that allow for the repetition of instructions or blocks of instructions.
link to R script
link to pdf Reading CSV datafiles into R We often store our data in comma seperated value (CSV) files, which can be read into R using the read.csv() function: # Download example .csv file download.file("https://ndownloader.figshare.com/files/2292169", "data/portal_data_joined.csv") # Save into variable surveys <- read.csv('data/portal_data_joined.csv') Note: this code requires having a data/ folder in your project Functions for characterizing dataframe We can run the name of the variable to view the dataframe, but often there will be too much information to display in the console
link to pdf Links Etherpad notes Data Carpentry R lesson Download R Download RStudio Why R? R doesn’t involve pointing and clicking Great for reproducibility Works for all sorts of data Creating awesome graphics Interdisplincary with a large community Free, open-source, and cross-platform RStudio RStudio is a free Integrated Development Environment (IDE) for working with R This provides a framework for: Writing code Navigating files Visualizing packages Creating projects Many other goodies (version control, making packages, Shiny apps) RStudio Projects Projects in RStudio create a folder for storing all of our files (data, scripts, images)
Download a pdf of Dr. Albuquerque’s presentation here.