A table
is very much like a list or a data frame, in that it has values and names (attributes) that are accessible through vector subsetting.
> mydata <- c(rep(1, 20), rep(2, 200), rep(9, 14), rep(10, 2))
> tab <- table(mydata)
> tab
## mydata
## 1 2 9 10
## 20 200 14 2
> names(tab)
## [1] "1" "2" "9" "10"
> c(val = names(tab)[tab == max(tab)], freq = max(tab))
## val freq
## "2" "200"
The following are equivalent
> tab[ names(tab)[tab == max(tab)] ]
## 2
## 200
> tab["2"]
## 2
## 200
Other useful things to know about an object is described in its attributes
> attributes(tab)
$dim
[1] 4
$dimnames
$dimnames$mydata
[1] "1" "2" "9" "10"
$class
[1] "table"