Hi,
I'm still a beginner in the DA field and I have two quick fundamental questions:
- why vectors were made so that they can have only one type of data unlike lists and tuples in Python?
- why indexing in R starts with 1 unlike python?
Thanks,
Hi,
I'm still a beginner in the DA field and I have two quick fundamental questions:
Thanks,
Hello,
In regards to your questions:
vec = c(1, "A", T)
sapply(vec, class)
#> 1 A TRUE
#> "character" "character" "character"
lst =list(1, "A", T)
sapply(lst, class)
#> [1] "numeric" "character" "logical"
Created on 2022-04-03 by the reprex package (v2.0.1)
Hope this helps,
PJ
indeed it does thanks for your help @pieterjanvc
![]()