- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
The R Book Data Input精选
3
Data Input
You can get numbers into R through the keyboard, from the Clipboard or from an external file. For a single
variable of up to 10 numbers or so, it is probably quickest to type the numbers at the command line, using
the concatenate function c like this:
y - c (6,7,3,4,8,5,6,2)
For intermediate sized variables, you might want to enter data from the keyboard using the scan function.
For larger data sets, and certainly for sets with several variables, you should make a dataframe externally (e.g.
in a spreadsheet) and read it into R using read.table (p. 139).
3.1 Data input from the keyboard
The scan function is useful if you want to type (or paste) a few numbers into a vector called x from the
keyboard:
x -scan()
1:
At the 1: prompt type your first number, then press the Enter key. When the 2: prompt appears, type in your
second number and press Enter, and so on. When you have put in all the numbers you need (suppose there
are eight of them) then simply press the Enter key at the 9: prompt.
1: 6
2: 7
3: 3
4: 4
5: 8
6: 5
7: 6
8: 2
9:
Read 8 items
The R Book, Second Edition. Michael J. Crawley.
© 2013 John Wiley Sons, Ltd. Published 2013 by John Wiley Sons, Ltd.
138 THE R BOOK
You can also use scan to paste in columns of numbers from the Clipboard. In the spreadsheet, highlight
the column of numbers you want, then type Ctrl + C (the accelerator keys for Copy). Now go back into
R. At the 1: prompt just type Ctrl + V (the accelerator keys for Paste) and the numbers will be scanned
into the named variable (x in this example). You can then paste in another set of numbers, or press Return to
complete data entry. If you try to re
您可能关注的文档
- Structural Analysis of Land Use Changes in the Lower Yangtze River Basin Using a Two-way Layout Model精选.pdf
- succession and failure精选.pdf
- surviving the boss from hell精选.pdf
- Sulfated polymannuroguluronate (SPMG), a novel anti-acquired immune deficiency syndrome精选.pdf
- Swaps Caps Floors and Swaptions精选.pdf
- Symmetric Hilbert Spaces and Related Topics01-front-matter精选.pdf
- SVC阀基电子及晶闸管高电位控制系统的研究精选.pdf
- SVG技术在城市轨道交通领域的应用研究精选.pdf
- SYD - K2 SmartObjects - Fundamentals.LABS精选.pdf
- SVC监控系统的研究及其应用精选.pdf
- 59.2022【文旅小镇】云阳天文小镇概规方案-195页.pdf
- 01.2025【康养小镇】重庆黎香湖度假大区养老景观设计-173页.pdf
- 36.2023【康养小镇】青海西宁夏都颐养健康小镇概念规划方案_94页.pdf
- 38.2023【康养小镇】成都龙泉山山地运动康养文旅综合规划方案-188页.pdf
- 80.2022【酒旅小镇】四川邛崃十方堂文旅小镇规划方案_85页.pdf
- 37.2023【康养小镇】江苏常州市孟河生态康旅小镇总体策划-125页.pptx
- 42.2023【产业小镇】赣州汽车运动小镇概念规划方案-72页.pptx
- 75.2022【康养小镇】益阳非遗清溪河文旅小镇规划方案-144页.pptx
- 48.2022【影音小镇】青岛西海岸新区影视文化产业规划-122页.pdf
- 29.2023【体育小镇】建业足球小镇长安古寨景观设计_127页.pdf
文档评论(0)