Â
You are floating in R Space, alone but for your data
last update: 2021-07-28
Â
You are floating in R Space, alone but for your data
Â
Â
Data objects are storage containers
Â
x <- 1 # single numeric integer y <- c(4.43, 2.70) # vector of numeric decimal values z <- c("Bob", "Karen") # vector of character strings
Â
Â
Â
Can contain letters, numbers, some symbolic characters
Must begin with a letter
Must not contain spaces
No forbidden characters like ‘+’, ‘-’, ‘@’, and others
Should be human-readable, consistent, and not too long
Case sensitive
Â
A factor is data where the different values are categories
'Monday', 'Tuesday', 'Wednesday...'
"Staffordshire", "Lancashire"...
Â
Generally need to think about this when analysing data
class()
and converting variablesÂ
The class()
function can be use to see what R thinks your variable class is
Also, the Global Environment
Â
Vector
Matrix
Array
Â