searchpath()
R語言中的函數用於列出附加到R搜索路徑的包的完整路徑。
用法: searchpath()
參數:
這個函數沒有參數。
範例1:
# R program to get the full path
# of attached packages in R
# Calling searchpath() function
searchpath()
輸出:
[1] ".GlobalEnv" [2] "C:/Program Files/R/R-2.15.2/library/stats" [3] "C:/Program Files/R/R-2.15.2/library/graphics" [4] "C:/Program Files/R/R-2.15.2/library/grDevices" [5] "C:/Program Files/R/R-2.15.2/library/utils" [6] "C:/Program Files/R/R-2.15.2/library/datasets" [7] "C:/Program Files/R/R-2.15.2/library/methods" [8] "Autoloads" [9] "C:/PROGRA~1/R/R-215~1.2/library/base"
範例2:
# R program to get the full path
# of attached packages in R
# Attaching datasets to path
attach(BOD)
attach(airquality)
# Calling searchpath() function
searchpath()
輸出:
[1] ".GlobalEnv" [2] "BOD" [3] "airquality" [4] "C:/Program Files/R/R-2.15.2/library/stats" [5] "C:/Program Files/R/R-2.15.2/library/graphics" [6] "C:/Program Files/R/R-2.15.2/library/grDevices" [7] "C:/Program Files/R/R-2.15.2/library/utils" [8] "C:/Program Files/R/R-2.15.2/library/datasets" [9] "C:/Program Files/R/R-2.15.2/library/methods" [10] "Autoloads" [11] "C:/PROGRA~1/R/R-215~1.2/library/base"
相關用法
- R語言 search()用法及代碼示例
- R語言 colors()用法及代碼示例
- R語言 args()用法及代碼示例
- R語言 setdiff()用法及代碼示例
- R語言 levels()用法及代碼示例
- R語言 dim()用法及代碼示例
- R語言 arrayInd()用法及代碼示例
- R語言 ncol()用法及代碼示例
- R語言 nrow()用法及代碼示例
- R語言 max()用法及代碼示例
- R語言 min()用法及代碼示例
- R語言 sum()用法及代碼示例
- R語言 get()用法及代碼示例
- R語言 range()用法及代碼示例
- R語言 names()用法及代碼示例
- R語言 nlevels()用法及代碼示例
注:本文由純淨天空篩選整理自nidhi_biet大神的英文原創作品 Get the Full Path of all the Attached Packages in R Programming – searchpath() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。