lundi 29 janvier 2018

Loop with no output

d is a data.frame (71obs of 3 variables); database is a data.frame (33016 of 6 variables) d[,3] is a column with NA which should be filled by matching with database character (database[,6]) they are no troubles, but d[,3] get not filled and I know that they are some matches. Could anybody help?

for (i in nrow(d)){
for (j in nrow(database)){
if(round(d[i,1],2) %in% database[j,1]){
d[i,3]<-paste(database[j,6])}}}

Aucun commentaire:

Enregistrer un commentaire