Skip to content

Misleading Typo in §4.3.3 (“Missing and Out-of-Bounds Indices”) #1815

@greystat

Description

@greystat

In section 4.3.3 (“Missing and out-of-bounds indices”), the text says:

If the vector being indexed is named, then the names of OOB, missing, or `NULL` components will be `NA`.

But that description applies to single-bracket subsetting (x["…"]), not to double-bracket (x[[…]]). In fact:

> atmc <- c(
+   a = T,
+   b = F,
+   c = T,
+   d = F)
> atmc[["e"]]
Error in atmc[["e"]] : subscript out of bounds
> atmc["e"]
<NA> 
  NA 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions