STA130H1 Chapter Notes - Chapter 1-3: Data Type, Decimal Mark, Scatter Plot

111 views6 pages
30 Sep 2018
School
Department
Course
Professor
yifanyang and 40045 others unlocked
STA130H1 Full Course Notes
23
STA130H1 Full Course Notes
Verified Note
23 documents

Document Summary

R lets you save various types of data types as objects, also known as variables. The main data types used in r are, doubles, integer, character, logical, and factors. Functions are built in procedures used to do simple to complex tasks. Round(3. 1415, 2): this will round the number to two decimal places (3. 14). By default, the number of rounding digits are set to 0. Mean(1,3): this function calculates the average of any set of numbers. Factorial(4): this function calculates the factorial of the number provided. Sample(x = 1:4,y = 2, replace = true) # the x represents the range from which the random number will be generated. The y represents the number of randomly generated numbers. Setting replace to true makes sure that the same number can be generated again. It can be set to false if (cid:455)ou do(cid:374)(cid:859)t (cid:449)a(cid:374)t to ge(cid:374)erate the sa(cid:373)e ra(cid:374)do(cid:373) (cid:374)u(cid:373)(cid:271)er more than once.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents