Code is on the Website Outline Comparison of Excel and R R Coding Example RStudio Environment Getting Help Entering Data Calculating Basic Plots Save a Coding Script Code is on the Website http://bostondatacommunity.org/r-beginner/
Brief Review of Excel Active Spreadsheet Area Most Everything is Point-and-Click
RStudio Active Coding Area Some Point-and-Click Place to Enter Single Commands View Some Output
Computing Average in Excel Range of Data Mathematical Formula
How to Find Average in R? STEPS Open a New Script Write Code to Create a “Vector” (Column of Data) Run the Code Review Results
Open up a New Script Window
How to Create a “Range” in R? Use the c() function to combine values or text In R a column is called a Vector ? to get more information ?c
How to Get Help on a Function
Create the following Vector (i.e. Column of Data) x <- c(77, 60, 90) Why a “x” Why a “<-” and not an “=“ can be named most anything Both work. “<-” is traditional
RStudio Environment 1 2 4 3 Variable shows up in the environment panel Enter Code 2 Run 4 Or CTRL-Enter Code is Ran in the Console 3
Let’s Try Some Basic Statistical Functions mean(x) max(x)
R Built-In Packages
R Pre-Loaded Packages
Let’s Try Some Graphical Functions #charts plot(x) barplot(x) pie(x)
Plots Zoom or Export Page Back To Clear Console: CTRL-L
Save a Script Current File Directory: getwd() If Needed, Set New Working Directory Session > Set Working Directory > Choose Directory To save script / code: File > Save As The File will have a .R filetype