You have no object called avg1 in your workspace. Please go back and explore the reason why. Check the input and output of every command, and also learn ways how to look inside the contents of your objects via, for example, head() and tail(), and learn about index sub-setting of data-frames and -matrices, and also tibbles.
A hint: 'avg1' seems to just be a column name in your bat_02 object
sum(object[object$avg1>0.2,]$avg1)once you save the object