R Data Structures | Scalar, Vector, Matrices, List, Data frame | RStudio ep4

preview_player
Показать описание
##Data structures

#Scalar
b =12
c = "Amina"

#vector

student_score = c(23, 34, 45, 67) #c is combine or concantanation

score = c(30:80)

#Matrices

my_matrix = matrix(1:10, nrow = 5, ncol = 2)
my_array = array(1:9, dim = c(3,3))

#list
my_list = list(name="Jonson", age=30, gender="m", is_student=TRUE)

#data frame

name=c("Josh", "Assoumpta", "Fidelis", "Jane"),
age=c(23, 16, 67, 23),
gender=c("m", "f", "m", "f"),
is_student=c(TRUE, TRUE, FALSE, TRUE)
)
Рекомендации по теме