Exercise
Some of R's most basic types to get started are:
Decimals values(有小数点的数字) like 4.5 are called numerics.
Natural numbers(自然数) like 4 are called integers(整数). Integers are also numerics.
Boolean values(布尔数学体系的值) (TRUE or FALSE) are called logical.
Text (or string) values are called characters.
Note how the quotation marks on the right indicate that "some text" is a character.
Instructions
Change the value of the:- my_numeric variable to 42.- my_character variable to "forty-two". Note that the quotation marks indicate that "forty-two" is a character.- my_logical variable to FALSE.
Note that R is case sensitive!
Solution.R
> # What is the answer to the universe?
> my_numeric <- 42
>
> # The quotation marks indicate that the variable is of type character注意加“”
> my_character <- "forty-two"
>
> # Change the value of my_logical
> my_logical <- FALSE