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 版)
76
3
如果你在没有 RStudio 的情况下运行 R,则可以使用以下解决方案更改 CRAN 镜像。此
解决方案假设你有一个
.Rprofile
,如 3.16 节中所述:
1. 调用 chooseCRANmirror 函数:
chooseCRANmirror()
R 将呈现 CRAN 镜像列表。
2. 从列表中选择一个 CRAN 镜像,然后按 OK
3. 要获取镜像的 URL,请查看 repos 选项的第一个元素:
options("repos")[[1]][1]
4. 将此行添加到
.Rprofile
文件中。如果你需要 RStudio CRAN 镜像,则可以执行以
下操作:
options(repos = c(CRAN = "http://cran.rstudio.com"))
或者你可以使用另一个 CRAN 镜像的 URL
3.12.3 讨论
在每次安装 R 包的过程中都会使用相同的 CRAN 镜像(即离你最近的镜像或 RStudio
提供的镜像),因为每次加载R 包时RStudio 都不会提示你;它只是使用“偏好”
Preferences)菜单中的设置。你可能希望更改该镜像以使用更接近你的计算机的其他镜
像。使用此解决方案更改你的镜像,以便每次启动 R RStudio 时,都可以使用所需要
的仓库。
repos 选项是默认镜像的名称。使用 chooseCRANmirror 函数选择镜像时会有一个
重要的副作用,即按照选择来设定 repos 选项。问题是 R 退出时,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

机器学习实战:基于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