Guest <- c("Jennifer", "David", "Jack", "Joanna", "Victoria")
Age <- c(19, 20, 21, 25, 23)
Friend_of <-c (1, 2, 1, 2, 2)
Wedding <- data.frame(Guest, Age, Friend_of)
Wedding
## Guest Age Friend_of
## 1 Jennifer 19 1
## 2 David 20 2
## 3 Jack 21 1
## 4 Joanna 25 2
## 5 Victoria 23 2
typeof(Age)
## [1] "double"
typeof(Friend_of)
## [1] "double"
Wedding$Friend_of = c("Groom","Bride", "Groom", "Bride", "Bride")
Friend_of
## [1] 1 2 1 2 2
View(Wedding)
typeof(Friend_of)
## [1] "double"
The results I received in both # 3 and # 5 was “double”. It means the variable has a double value meaning, the 1’s and 2’s and the characters bride and groom.
str(Wedding)
## 'data.frame': 5 obs. of 3 variables:
## $ Guest : chr "Jennifer" "David" "Jack" "Joanna" ...
## $ Age : num 19 20 21 25 23
## $ Friend_of: chr "Groom" "Bride" "Groom" "Bride" ...
This data table has 5 rows and 3 columns. There are 3 variables: Guest (charater), Age, (Numeric), Friend_of(character)