Statistics Rstudio help

DATAWAR$CustomWAR = DATAWAR$WAR +.1*((DATAWAR$G- DATAWAR$AVGgames)/DATAWAR$STDGames)
Error in $<-.data.frame(*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:

DATAWAR$WAR +.1*((DATAWAR$G- DATAWAR$AVGgames)/DATAWAR$STDGames)

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.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.