Download presentation
Presentation is loading. Please wait.
Published bySilvia O’Neal’ Modified over 8 years ago
1
Outline Comparison of Excel and R R Coding Example – RStudio Environment – Getting Help – Enter Data – Calculate Mean – Basic Plots – Save a Coding Script
2
Brief Review of Excel Active Spreadsheet Area Most Everything is Point-and-Click
3
RStudio Active Coding Area Some Point-and-Click Place to Enter Single Commands View Some Output
4
Computing Average in Excel Range of Data Mathematical Formula
5
How to Find Average in R? STEPS Open a New Script Create a “Range” Vector in R Terminology Code is on the Website http://bostondatacommunity.org/r-beginner/
6
Open up a New Script Window
7
Use the c() function to combine values or text In R a column is called a Vector ? to get more information ?c How to Create a “Range” in R?
8
How to Get Help on a Function ?c
9
Create the following Vector (i.e. Column of Data) x <- c(77, 60, 90) Why a “<-” and not an “=“ Both work. “<-” is traditional Why a “x” can be named most anything
10
RStudio Environment Run Or CTRL-Enter Variable shows up as being the environment Command is Ran in the Console Enter Code 1 2 3 4
11
Let’s Try Some Basic Statistical Functions mean(x) max(x)
12
R Built-In Packages
13
Let’s Try Some Graphical Functions #charts plot(x) barplot(x) pie(x)
14
Plots To Clear Console: CTRL-L Zoom or Export Page Back
15
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.