Find Location and Character Vector of an Object with partial name in R Language – apropos() and find() Function

appros() function in R Language will give the character vector of name that contain the partial name.

Syntax:
apropos(“x”, ignore.case, simple.word)

Parameters:
x: partial-name of object
ignore.case: Case sensitive or not
simple.word: if TRUE the what is searched as a whole word

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to illustrate 
# appros function
  
# Apply apropos function in R
apropos("max", ignore.case = FALSE, simple.word = FALSE)                

chevron_right


Output:



"cummax"    "max"     "max.col"   "pmax"      "promax"    "varimax"   "which.max"

Here in the above code, the appros() function will return all the strings which have “max” in them.

find() Function

find() function returns the location where the object with specific name can be found.

Syntax:
find(“x”, ignore.case, simple.word)

Parameters:
x: partial-name of object
ignore.case: Case sensitive or not
simple.word: if TRUE the what is searched as a whole word

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to illustrate
# find function
  
# Apply find function in R
find("varimax", ignore.case = FALSE, simple.word = FALSE)                

chevron_right


Output:

# "package:stats

Here in the above code, we get the location of where “varimax” is stored. So find() function is used to find what we have specified to it.

My Personal Notes arrow_drop_up

Recommended Posts:


Check this out nerdboinet

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.