Skip to Content
精通数据科学算法
book

精通数据科学算法

by Posts & Telecom Press, David Natingga
May 2024
Intermediate to advanced
181 pages
3h 9m
Chinese
Packt Publishing
Content preview from 精通数据科学算法

附录B R参考

R是一种专注于统计计算的编程语言。因此,它在统计、数据分析和数据挖掘方面很有用处。R代码写在后缀为.r的文件中,可以用Rscript命令执行。

一个基于R语言的简单例子,仅打印一行文本。

[输入]

source_code/appendix_b_r/example00_hello_world.r
print('Hello World!')

[输出]

$ Rscript example00_hello_world.r
[1] "Hello World!"

注释不会被R执行。它以字符#开头,在行尾结束。

[输入]

source_code/appendix_b_r/example01_comments.r
print("This text is printed because the print statement is executed")
#这是一句注释,不会被执行
#print("Even commented statements are not executed.")
print("But the comment finished with the end of the line.")
print("So the 4th and 5th line of the code are executed again.")

[输出]

$ Rscript example01_comments.r [1] "This text will be printed because the print statemnt is executed" [1] "But the comment finished ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据科学原理

数据科学原理

Posts & Telecom Press, Sinan Ozdemir
PyTorch深度学习

PyTorch深度学习

Posts & Telecom Press, Vishnu Subramanian
程序员学数据结构

程序员学数据结构

Posts & Telecom Press, William Smith
可编程网络自动化

可编程网络自动化

Jason Edelman, Scott S. Lowe, Matt Oswalt

Publisher Resources

ISBN: 9781836204596