Skip to Content
R在数据科学中的应用,第2版
book

R在数据科学中的应用,第2版

by Hadley Wickham, Mine Cetinkaya-Rundel, Garrett Grolemund
May 2025
Intermediate to advanced
578 pages
8h 9m
Chinese
O'Reilly Media, Inc.
Content preview from R在数据科学中的应用,第2版

第 V 部分 计划

在本书的这一部分,你将提高编程技能。编程是所有数据科学工作都需要的一项横向技能:你必须使用计算机来进行数据科学工作;你不能靠头脑或纸笔来进行数据科学工作。

Our model of the data science process with program (import, tidy, transform, visualize, model, and communicate, i.e. everything) highlighted in blue.
图 V-1. 编程是水,所有其他组件都在其中畅游。

编程产生代码,而代码是一种交流工具。显然,代码告诉计算机你想要它做什么。但它也向其他人传达意义。将代码视为一种交流工具非常重要,因为你所做的每个项目从根本上说都是协作性的。即使你不与其他人一起工作,你也一定会与未来的你一起工作!写出清晰的代码非常重要,这样其他人(比如未来的你)才能理解你为什么要以这种方式进行分析。这意味着,要提高编程能力,也要提高沟通能力。随着时间的推移,您希望自己的代码不仅更容易编写,也更容易被他人阅读。

在接下来的三章中,你将学习到提高编程技能的技巧:

  • 复制和粘贴是一种强大的工具,但应避免重复使用两次以上。在代码中重复是危险的,因为这很容易导致错误和不一致。相反,在第 25 章中,你将学习如何编写函数,通过函数,你可以提取重复的代码,以便于重复使用。

  • 函数可以提取重复的代码,但您经常需要对不同的输入重复相同的操作。你需要一些迭代工具,让你重复做类似的事情。这些工具包括 for 循环和函数式编程,你将在第 26 章了解到它们。

  • 当你阅读更多其他人编写的代码时,你会看到更多不使用 tidyverse 的代码。在第 27 章中,你将学习到一些最重要的 R 基本函数。

这些章节的目标是向你传授数据科学所需的最基本的编程知识。一旦你掌握了这里的内容,我们强烈建议你继续提高编程技能。我们已经编写了两本书,也许对你会有帮助。Garrett Grolemund 所著的《Hands on Programming with R》(O'Reilly 出版社)介绍了 R 这种编程语言,如果 R 是你的第一门编程语言,这本书是你入门的好帮手。Hadley Wickham 所著的《Advanced R》(CRC Press)深入探讨了 R 编程语言的细节;如果你已有编程经验,这本书将是一个很好的开始,而当你将这些章节中的思想内化之后,这本书将是你下一步的好帮手。

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

R深度学习权威指南

R深度学习权威指南

Posts & Telecom Press, Joshua F. Wiley
AI工程

AI工程

Chip Huyen
Raku学习手册

Raku学习手册

brian d foy

Publisher Resources

ISBN: 9798341657304