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
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.