--1-Intro to basics
#1-How it works
-In the editor there is already some sample code. Can you see which lines are actual R code and which are comments? comments: #
-Add a line of code that calculates the sum of 6 and 12
3+4
6+5#2-Arithmetic with R
-Type 2^5 in the editor to calculate 2 to the power 5
-Type 28 %% 6 to calculate 28 modulo 6
# An addition
5 + 5
# A subtraction
5 - 5
# A multiplication
3 * 5
# A division
(5 + 5)/2
# Exponentiation
2^5
# Modulo
28%%6#3-Variable assignment
#4-Variable assignment (2)
#5-Variable assignment (3)
#6-Apples and oranges
#7-Basic data types in R
#8-What's that data type?
Last updated