Answers for "create list in r"

R
3

r create a list

# Basic syntax:
list(11, 23, 42) # List of numerics
list(TRUE, FALSE, TRUE) # List of booleans/logicals
list("aa", "bb", "cc") # List of strings

# Note, in R, list and vectors (aka atomic vectors) are both 
#	one-dimensional objects, but lists can contain mixed type data 
#	whereas vectors can only contain one type of data
# Note, to make a vector, use: c(11, 23, 42)
Posted by: Guest on October-10-2020
1

create list in r

list("a", 1L, 1.5, TRUE)
#NB: A list can be made up mixed data types: Character, integer, double, logical
Posted by: Guest on September-21-2021

Browse Popular Code Answers by Language