Download the R code used in this presentation at this Github repository https://github.com/ufrmeetup/heslar.
Check out Dr. Zhao’s presentation: http://www.r-gators.com/slides/zhao. This presentation was made using RMarkdown. The Markdown code is included below, however outputs from R (i.e. graphs) will only be displayed in the presentation. Download the RMarkdown file and an R script for generating data to test these scripts at the GitHub repository: https://github.com/ufrmeetup/zhao. Note the RMarkdown script relies on some private data, so it will not run on it’s own, but can be run using the simulated data.
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 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