Also, data is a built in function in R. See ?data for more details. You're trying to access it like a vector, yielding the error you see: Object of type 'closure' is not subsettable.
It may be an issue with loading your data into R. Using something like my.data may get around this issue. E.g. my.data <- read.csv("foobar.csv") or my.data <- data.frame(...)