Skip to Content
R 錦囊妙計
book

R 錦囊妙計

by Paul Teetor
January 2014
Beginner to intermediate
488 pages
8h 1m
Chinese
GoTop Information, Inc.
Content preview from R 錦囊妙計
3.5 顯示搜尋路徑
|
61
3.5 顯示搜尋路徑
問題點
您想查看目前已載入 R 的套件列表。
解決方案
使用不含引數的
search
函數:
> search()
討論說明
搜尋路徑
search path
是指目前已載入電腦記憶體,而且可供使用的 R 套件列表。雖
然許多套件已安裝於您的電腦,實際上卻只有幾個套件被載入 R 解譯器中。您可能想知
道,目前哪些套件已被載入。
輸入未包含引數的
search
函數,輸出結果將會回傳所有已載入的 R 套件列表:
> search()
[1] ".GlobalEnv" "package:stats" "package:graphics"
[4] "package:grDevices" "package:utils" "package:datasets"
[7] "package:methods" "Autoloads" "package:base"
然而,即使輸入相同函數,您的電腦可能回傳不同結果,這取決於您所安裝 R
軟體的版本差異。
search
函數的回傳值是字串向量。根據上列輸出結果,第
一個字串為
".GlobalEnv"
,是指您的工作空間。其他大多數字串內容是以類似
"package:packagename"
的形式呈現,表示名為
packagename
的套件目前已載入 R 軟體
中。在此例中,可得知已載入的 R 套件包括:
stats
graphics
grDevices
utils
等。
此外,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

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

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

J.D. Long, Paul Teetor
優雅的SciPy|Python科學研究的美學

優雅的SciPy|Python科學研究的美學

Juan Nunez-Iglesias, Stéfan van der Walt, Harriet Dashnow
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9789862769829