On Wed, Aug 19, 2020 at 7:53 AM Ivan Calandra <calan...@rgzm.de> wrote:
| 
| I have the following vector:
|       mydata <- 
|       c("SSFA-ConfoMap_GuineaPigs_NMPfilled.csv", 
|       "SSFA-ConfoMap_Lithics_NMPfilled.csv", 
|       "SSFA-ConfoMap_Sheeps_NMPfilled.csv", 
|       "SSFA-Toothfrax_GuineaPigs.xlsx", 
|       "SSFA-Toothfrax_Lithics.xlsx", 
|       "SSFA-Toothfrax_Sheeps.xlsx")
| and I want to find the values that 
| include both "ConfoMap" and 
| "GuineaPigs".

Dear Ivan,

I also found this[1], so this line 
returns 1 like many of these other 
suggestions:

        grep("(.*ConfoMap)(.*GuineaPigs)", mydata)

Best,
Rasmus

[1] https://stackoverflow.com/questions/13187414/r-grep-is-there-an-and-operator

Attachment: signature.asc
Description: PGP signature

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to