Skip to content
Related Articles

Related Articles

Get the Full Path of all the Attached Packages in R Programming – searchpath() Function

Improve Article
Save Article
Like Article
  • Last Updated : 04 Apr, 2022

searchpath() function in R Language is used to list the full path of the packages attached to the R search path. 
 

Syntax: searchpath()
Parameters: 
This function takes no parameters. 
 

Example 1: 
 

Python3




# R program to get the full path
# of attached packages in R
 
# Calling searchpath() function
searchpath()


Output: 
 

[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:/PROGRAM~1/R/R-215~1.2/library/base"

Example 2: 
 

Python3




# R program to get the full path
# of attached packages in R
 
# Attaching datasets to path
attach(BOD)
attach(airquality)
 
# Calling searchpath() function
searchpath()


Output: 
 

[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:/PROGRAM~1/R/R-215~1.2/library/base"

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!