[R] & and |

Rasmus Liland jr@| @end|ng |rom po@teo@no
Thu Aug 20 00:32:59 CEST 2020


On Wed, Aug 19, 2020 at 7:53 AM Ivan Calandra <calandra using 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20200820/41072300/attachment.sig>


More information about the R-help mailing list