Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

r create a vector

# Basic syntax:
c(11, 23, 42) # Vector of numerics
c(TRUE, FALSE, TRUE) # Vector of booleans/logicals
c("aa", "bb", "cc") # Vector 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 list, use: list(11, 23, 42)
Source by adv-r.had.co.nz #
 
PREVIOUS NEXT
Tagged: #create #vector
ADD COMMENT
Topic
Name
3+2 =