Skip to content
Prev 367707 / 398500 Next

Extract student ID that match certain criteria

Hi Bert,

Thank you so much for your help.  However I don't really sure what is the
use of y values.  Can we do without it?

x <- as.character(FKASA$STUDENT_ID)
y <- c(1,786)
My.Data <- data.frame (x,y)

My.Data[grep("^AA14", My.Data$x), ]

I got the following data:

          x   y
1   AA14068   1
7   AA14090   1
11  AA14099   1
14  AA14012 786
15  AA14039   1
22  AA14251 786

On Mon, Mar 13, 2017 at 11:51 AM, Bert Gunter <bgunter.4567 at gmail.com>
wrote: