Statistics Rstudio help

Error in $<*tmp*, CustomWAR, value = numeric(0)) :
replacement has 0 rows, data has 130

I am trying to just use this line to create a new column in my data set DATAWAR with the 'customwar' computation for each line, for some reason giving me this erorr code.

This error suggests that the "replacement", i.e. what you want to insert into the new column, "has 0 rows", i.e. is empty. In other words, this code is failing:


I don't see anything obviously wrong with it, so you might have t try to run parts of it to find out where the problem comes from.

Try str(DATAWAR) to be sure you have all the column names spelled right.