I need to fill a cell with the sum of multiple other cells. For example (in a table called 'a'):
for(i on 1:nrows_data){
if(a[i,"Column 1"]=="yes"){
a[i,"Column 4"]=a[i,"Column 2"]+a[i,"Column 3"]
}
}
Where the values in the referenced cells are all numeric (I checked). If I do this I get this error:
Error in [<-.data.frame(tmp, i, "Alpha", value = numeric(0)) :
replacement has length zero
Any help would be greatly appreciated. My goal is to get the sum of the two numerical values contained in referenced cells displayed in the desired cell.