Presentation is loading. Please wait.

Presentation is loading. Please wait.

Code is on the Website Outline Comparison of Excel and R

Similar presentations


Presentation on theme: "Code is on the Website Outline Comparison of Excel and R"— Presentation transcript:

1 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

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
Write Code to Create a “Vector” (Column of Data) Run the Code Review Results

6 Open up a New Script Window

7 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

8 How to Get Help on a Function

9 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

10 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

11 Let’s Try Some Basic Statistical Functions
mean(x) max(x)

12 R Built-In Packages

13 R Pre-Loaded Packages

14 Let’s Try Some Graphical Functions
#charts plot(x) barplot(x) pie(x)

15 Plots Zoom or Export Page Back To Clear Console: CTRL-L

16 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


Download ppt "Code is on the Website Outline Comparison of Excel and R"

Similar presentations


Ads by Google