Title | STAT 385 Lab 01 - STAT 385 Lab 01 |
---|---|
Course | Statistics Programming Methods |
Institution | University of Illinois at Urbana-Champaign |
Pages | 5 |
File Size | 145 KB |
File Type | |
Total Downloads | 96 |
Total Views | 124 |
STAT 385 Lab 01...
STAT 385 Lab 01
4/19/20, 12)08 PM
STAT 385 Lab 01 Vector, Lists, Matrix, Array and Functions Ha Khanh Nguyen
What You Need For This Lab R and RStudio working on your personal computer. Read and understand the following lecture notes: Intro to R Programming: [html] [slides] Intro to R Programming (Cont.): [html] [slides] R Data Types & Data Structures: [html] [slides]
Exercise 1: Rolling Dice GOAL: an R function named roll_dice() that simulates rolling 6 dice and compute the average outcome of the dice. Input: no input Output: a number presenting the average of the 6 dice outcomes.
roll_dice() roll_dice
## [1] 3.666667
roll_dice() roll_dice
## [1] 2.833333
file:///Users/charmipatel/Desktop/STAT%20385/STAT%20385%20Lab%2001.webarchive
Page 1 of 5
STAT 385 Lab 01
4/19/20, 12)08 PM
When you finish writing your function, copy the following code segment and run it in your RStudio console:
average_dice...