Related Articles

Related Articles

Find Location and Character Vector of an Object with partial name in R Language – apropos() and find() Function
  • Last Updated : 26 May, 2020

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 Articles
Page :