Hi community
Im want to select only the string that contain letter PI
. Im try with regular expression but I not expert in this topics.
And when get all PI
, is necessary put a space between PI and numbers, like this: PI 313836
PI 535336
DATA2<- data.frame(PI_NUM=c("TARS-324, TARS-324A, PI535336", "PI207372, HDR-0975", "PI313490, HDR-0975, HDR-0475",
"PI313836", "A-947, TARS-142, TARS-156, L-331, L-564, L-566, PI535210",
"PI494141, W6 21109", "TARS-319, PI494131, NI-1062", "NI-1036, PI494131,NI-1062",
"PI325754", "PI313784"))
DATA3 <- as.data.frame(grep(pattern = '\\PI.?([0-9])',
x = DATA2,
value = T));DATA3