[Rd] Autocompletion for the new S3 generic @ method?

Karolis K k@ro||@@koncev|c|u@ @end|ng |rom gm@||@com
Fri Mar 31 20:11:27 CEST 2023


Hello,

In the current R-devel @ is S3 generic, so we can do things like - for example - use it to extract matrix rows by name:

    .S3method("@", "mm", function(object, name) object[name,])
    m <- structure(matrix(rnorm(20), ncol=2), dimnames=list(paste0("row", 1:10), paste("col", 1:2)), class="mm")

    m using row1

However, seems like currently it does not support autocompletion.

Wouldn’t it make sense to add a method like .EtaNames() which would provide tab autocompletions for x@<tab> in the same way current .DollarNames() does for x$<tab>?

Regards,
Karolis K.


More information about the R-devel mailing list