Answers for "r lists vs vectors"

R
1

r lists vs vectors

# Short answer:
# Vectors (aka Atomic vectors) and lists are both one-dimensional objects
# but vectors can only contain one type of data, whereas lists can 
# contain mixed type data. 

# Note, if you combine mixed types in a vector, they will be coerced to 
#	the most flexible type of the types you used. In order of increasing
#	flexibility, the types are: logical -> integer -> double -> character
# Note, to determine whether you're dealing with a vector or a list use
#	typeof(vector_or_list) -- typeof(a_list) will return "list"
Posted by: Guest on October-10-2020

Browse Popular Code Answers by Language