Praktikum 05a: Type coercion

Autor:in

___

Veröffentlichungsdatum

Samstag, 18. Oktober 2025

c(1, 1L, "C")

c(1, 1L, "C")
[1] "1" "1" "C"
1
[1] 1
1L
[1] 1
"C"
[1] "C"
#typeof(c(1, 1L, "C"))

c(1L / 0, "A")

c(1L / 0, "A")
[1] "Inf" "A"  
# typeof(1L)
# typeof(0)
# typeof(1L/0)
# typeof("A")
#typeof(c(1L / 0, "A"))

c(1:3, 5)

c(1:3, 5)
[1] 1 2 3 5
# typeof(1:3)
# typeof(5)
#typeof(c(1:3, 5))

c(3, "3+")

c(3, "3+")
[1] "3"  "3+"
# typeof(3)
# typeof("3+")
# typeof(c(3, "3+"))

c(NA, TRUE)

c(NA, TRUE)
[1]   NA TRUE
# typeof(NA)
# typeof(TRUE)
#typeof(c(NA, TRUE))