Hello,
I made a list, it look like the one below.
Besides I have a textfile read with read.table.
#the list looks like this:
print(koppeling.id)
"LPI" "LQI" "LRI" "LSI"
#the data looks like this:
print(Lateral.dat)
1 FLBR id LPI sc 0 47150 flbr
2 FLBR id STI sc 0 26940 flbr
3 FLBR id LQI sc 0 88920 flbr
4 FLBR id CSO_63A sc 0 lt 0 28220
I would like to get all the row numbers from the text file which have a string as found in the list. I have tried to make a loop but I get the error as below.
> for (i in koppeling.id) {
+ which(grepl(i, Lateral.dat$V1))}
Warning message:
In grepl(i, Lateral.dat$V1) :
argument 'pattern' has length > 1 and only the first element will be used
>
Hopefuly anyone knows how to fix this problem?