@ is a S4 method to extract slot. S4 slots are, to my knowledge, implemented as attributes.
But any object in R can have attributes, yet accessing attributes is quite bit more awkward (attributes() or attr()) compared to classical subsetting with [, [[, or $.
With @ working by default on any class and being tab-complete-friendly in REPL, it would go quite big way to enhance the data space of R.
For instance, dplyr's group_by is not changing the object itself, but the grouped information is in attributes, which can then be used by summarize.
@is a S4 method to extract slot. S4 slots are, to my knowledge, implemented as attributes.But any object in R can have attributes, yet accessing attributes is quite bit more awkward (
attributes()orattr()) compared to classical subsetting with[,[[, or$.With
@working by default on any class and being tab-complete-friendly in REPL, it would go quite big way to enhance the data space of R.For instance,
dplyr'sgroup_byis not changing the object itself, but the grouped information is in attributes, which can then be used bysummarize.