I'm trying to subset my data based on a condition but I'm getting the following error
m <- matrix(995:1005, ncol = 1) # create matrix
colnames(m) <- c("Total") # Assign col name
colnames(m)
a <- subset(m,Total>1000)
> colnames(m)
[1] "Total"
> a <- subset(m,Total>1000)
Error in subset.matrix(m, Total>1000) : object 'Total' not found
Am I overlooking something here? Thanks