Skip to Content
R 语言经典实例(原书第 2 版)
book

R 语言经典实例(原书第 2 版)

by J.D. Long, Paul Teetor
June 2020
Beginner to intermediate
522 pages
9h 6m
Chinese
China Machine Press
Content preview from R 语言经典实例(原书第 2 版)
68
3
误消息并停止。(另外需要注意的是:搜索路径也包含环境,而不仅仅是包,并且当 R
包中的对象已经初始化时,搜索算法会有所不同;有关详细信息,请参阅“ R Language
Definition”(
https://cran.r-project.org/doc/manuals/R-lang.pdf
。)
由于工作空间(.GlobalEnv)是搜索列表中的第一项,因此 R 会首先在工作空间中寻
找函数,然后再搜索其他 R 包。如果工作空间和其他 R 包中都包含某个同名的函数,则
工作空间会“遮盖”后者中的函数,这意味着 R 会在找到工作空间中的函数后停止搜索,
因此永远无法找到其他 R 包中的那个函数。如果你想要重新加载 R 包中的函数,这将是
一个好消息;但如果你仍想要使用该 R 包的函数时,这一特性将成为你的障碍。如果你
发现自己遇到了障碍,因为你(或加载的某个包)覆盖了现有加载包中的函数(或其他
对象),你可以使用
environment:: name
的形式从加载的 R 包环境中调用对象。例
如,如果要调用 dplyr 包中的 count 函数,可以使用 dplyr::count 进行调用。即
使你没有加载包,使用完整显式名称来调用函数也是有效的,因此如果安装了 dplyr
但未加载,则仍然可以调用 dplyr::count
一种越来越常见的情况是,在在线示例中显示完整的
packagename
::
function
。虽然这消除了函数来自何处的模糊性,但它使得示例代码非常
冗长。
请注意, ...
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

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

Aurélien Géron
大规模数据分析和建模:基于 Spark 与 R

大规模数据分析和建模:基于 Spark 与 R

Javier Luraschi, Kevin Kuo, Edgar Ruiz
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111656814