Skip to content
Prev 378860 / 398502 Next

Q re: logical indexing with is.na

logical indexing requires the logical index to be of the same length as the vector being indexed. If it is not, then the index
is wrapped to be of sufficient length. The result on line 3 is
y[c(TRUE, TRUE, FALSE, TRUE)] where the last TRUE was
originally the first component of !is.na(y[1:3])


Grant Izmirlian, Ph.D.
Mathematical Statistician
izmirlig at mail.nih.gov

Delivery Address:
9609 Medical Center Dr, RM 5E130
Rockville MD 20850

Postal Address:
BG 9609 RM 5E130 MSC 9789
9609 Medical Center Dr
Bethesda, MD 20892-9789

 ofc:  240-276-7025
 cell: 240-888-7367
  fax: 240-276-7845
Message-ID: <BL0PR0901MB24024A2A40546368532E9600E5480@BL0PR0901MB2402.namprd09.prod.outlook.com>
In-Reply-To: <CA+_2Pn3BYiJZsKmu4-TXrXuWr0xecdp4g2=b=Mxtb3RPe1BBjA@mail.gmail.com>