LOFTER for ipad —— 让兴趣,更有趣

点击下载 关闭
5 Discover Basic Data Types
子苔 2019-03-14

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




推荐文章
评论(0)
联系我们|招贤纳士|移动客户端|风格模板|官方博客|侵权投诉 Reporting Infringements|未成年人有害信息举报 0571-89852053|涉企举报专区
网易公司版权所有 ©1997-2024  浙公网安备 33010802010186号 浙ICP备16011220号-11 增值电信业务经营许可证:浙B2-20160599
网络文化经营许可证: 浙网文[2022]1208-054号 自营经营者信息 工业和信息化部备案管理系统网站 12318全国文化市场举报网站
网信算备330108093980202220015号 网信算备330108093980204230011号
分享到
转载我的主页