Search code examples
rsubsetterminology

How do you say `[` and `[[`?


[ and [[ come up a lot when using R. Suppose that I'm having a conversation about these two functions, what do I actually call these "indexing operators"? I know how to name them as punctuation, but is there anything within R or its documentation that gives them a more specific name? I know that they're subsetting functions that are documented under ?Extract, but I've never seen anyone call them anything like "extract and double extract".


Solution

  • In the R Language Definition they are referred to as "single and double brackets":

    Indexing of arrays and vectors is performed using the single and double brackets, [] and [[]]

    In An Introduction to R you find several instances of "square bracket" and "double square bracket".

    This agrees with the general terminology (see e.g. wikipedia on square brackets and double brackets, and their Unicode).