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

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:

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


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

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


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:/PROGRA~1/R/R-215~1.2/library/base"
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.