That’s my type (Complete)

In the following exercises, first guess what type the vector will be coerced to, then check your intuition with the typeof() function.

  1. c(1, 1L, "C")
c(1, 1L, "C")
[1] "1" "1" "C"
1
[1] 1
1L
[1] 1
"C"
[1] "C"

Guess: ___

typeof(c(1, 1L, "C"))
[1] "character"
  1. c(1L / 0, "A")
c(1L / 0, "A")
[1] "Inf" "A"  
typeof(1L)
[1] "integer"
typeof(0)
[1] "double"
typeof(1L/0)
[1] "double"
typeof("A")
[1] "character"

Guess: ___

typeof(c(1L / 0, "A"))
[1] "character"
  1. c(1:3, 5)
c(1:3, 5)
[1] 1 2 3 5
typeof(1:3)
[1] "integer"
typeof(5)
[1] "double"

Guess: ___

typeof(c(1:3, 5))
[1] "double"
  1. c(3, "3+")
c(3, "3+")
[1] "3"  "3+"
typeof(3)
[1] "double"
typeof("3+")
[1] "character"

Guess: ___

typeof(c(3, "3+"))
[1] "character"
  1. c(NA, TRUE)
c(NA, TRUE)
[1]   NA TRUE
typeof(NA)
[1] "logical"
typeof(TRUE)
[1] "logical"

Guess: ___

typeof(c(NA, TRUE))
[1] "logical"