I have the results of radiosonde observations for more than 1000 stations in one file and list of stations (81) that actually interest me. I need to make a new data frame where the first file's rows would be included.
So, I have two datasets imported from .txt files to R. The first is a data frame 6694668x6 and the second one is 81x1, where second dataset's rows conicide with some of first dataset's 1st column values (values are looking like this: ACM00078861).
d = data.frame(matrix(ncol = 6, nrow = 0))
for(i in 1:81){
for (j in 1:6694668) {
if(stations[i,1] == ghgt_00z.mly[j,1]){
rbind(d,ghgt_00z.mly[j,] )
j + 1
} else {j+1}
}
}
I wanted to generate a new dataframe which would look like the "ghgt_00z.mly", but containing only the rows for the stations which are listed in "stations". Ofc, the code was running for couple of days and I have receaved only the warning message. Please, help me!