I have two files ones with 522 project id that I want to extract from the first file.
the following code works for extracting but I don't want to repeat manually 522 times the data$projectID==datid[x, ] |
data1 = data[(data$projectID==datid[1, ] |data$projectID==datid[2, ]| ...| data$projectID==datid[522, ]), ]
How to repeat the instruction 522 times adding one each time.
Thanks!!
data = read.csv("~/Desktop/PACA SNA/PACA3.csv", header = TRUE, sep =";")
datid= read.csv("~/Desktop/PACA SNA/PACAID.csv", header = FALSE, sep =";")
data1 = data[(data$projectID==datid[1, ] | ...| data$projectID==datid[522, ]), ]