This is simply due to the partial match that occurs with some uses of $ .
Try the following:
> table(Pets$Ca) Fluffy Scratch 1 1
Using the notation [[ instead will give you more control.
> table(Pets[["Ca"]]) < table of extent 0 > > table(Pets[["Ca", exact = FALSE]]) Fluffy Scratch 1 1
You can use the options settings to give a warning when partial matches are used. Consider:
> options(warnPartialMatchDollar = TRUE) > table(Pets$Ca) Fluffy Scratch 1 1 Warning message: In Pets$Ca : partial match of 'Ca' to 'Cat' > table(Pets$Dog) Rover Spot 1 1 Warning message: In Pets$Dog : partial match of 'Dog' to 'Dog_as_very_long_name'
source share