I have a frequency table, counting the frequency of elements in a vector
a = table(c(0,1,1,1,0,2,2,4,1,2,3,2,1,2,3,1,1,1,2,3,4,1,1,0))
a
# 0 1 2 3 4
# 3 10 6 3 2
I know I can access the name by names(a). But when I tried to access the values of the SECOND row
a[1, "0"]
# Error in a[1, "0"] : incorrect number of dimensions
a[1, 1]
# Error in a[1, 1] : incorrect number of dimensions
The table you are using is a one dimensional array and you are using 2- dimensions to retrieve an element that's wwhy you are getting that error.
Use something like a[1]