I have a large dataset of samples with descriptors of whether the sample is viable - it looks (kind of) like this, where \'desc\' is the description column and \'blank\' ind
Using your first initial approach with loops I figured out this:
for(i in 1:nrow(dat)){
if(dat[i, 1] =="blank"){
dat[i, 2:4] <- NA
}
else {
dat[i,length(dat)] <- dat[i, length(dat)]
}
}
I tested it with your data and worked. Hope this is useful for everyone dealing with loops in rows and columns with conditions.