Is there an R function to run the same filter command on all of my columns?

I have an excel database with around 250 objects (names of different people), and I would like to know if there´s a function to perform the same command on all of my objects, I have been using the function grep() with each individual name, but i would like to obtain the urls for each individual name without having to do it manually, is there an easier way of doing it?

`Alejandro Díaz Domínguez` [grep(".gob.mx", `Alejandro Díaz Domínguez`)] 

 
 [1] "http://www.csg.gob.mx                                        
 [2] "http://www.csg.gob.mx                                      
 [3] "https://sic.gob.mx 


Read more here: https://stackoverflow.com/questions/67928965/is-there-an-r-function-to-run-the-same-filter-command-on-all-of-my-columns

Content Attribution

This content was originally published by Marcela Marroquín at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: