Regular Expressions

I use the “traditional” command line tool, grep, for much of my regexp work in R.

formulas <- readLines("full_models.txt")
fragstats <- grep("IJI|SIDI|IJI_water|LPI|SIDI", formulas, perl=TRUE, value=TRUE)

Leave a Reply

Your email address will not be published. Required fields are marked *