基础数据类型

R 金融入门

Lore Dirick

Manager of Data Science Curriculum at Flatiron School

数值型(Numeric)

42.5
42.5
5
5
5L
5
R 金融入门

字符型(Character)

"Hello world"
"Hello world"
"forty"
"forty"
"5"
"5"
R 金融入门

逻辑型(Logical)

TRUE
TRUE
FALSE
FALSE
true
Error: object 'true' not found
NA
NA
R 金融入门

变量与数据类型

my_answer <- TRUE

my_answer
TRUE
food <- "carrots"

food
"carrots"
R 金融入门

class()

my_answer <- TRUE

class(my_answer)
"logical"
class(5)
"numeric"
class(5L)
"integer"
R 金融入门

Passons à la pratique !

R 金融入门

Preparing Video For Download...