subsetting a matrix/array in R

[This article was first published on simon jackman's blog » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

From the R-devel svn log. Nice addition…

r50896 | falcon | 2010-01-05 12:05:31 -0800 (Tue, 05 Jan 2010) | 7 lines
Changed paths:
M /trunk/NEWS
M /trunk/src/include/Defn.h
M /trunk/src/library/base/man/Extract.Rd
M /trunk/src/main/subassign.c
M /trunk/src/main/subscript.c
M /trunk/src/main/subset.c
M /trunk/tests/Makefile.common
A /trunk/tests/array-subset.R

Allow n-dim arrays to be subsetted by an n-column character matrix

The character matrix is converted to the corresponding integer matrix
by matching against the dimnames of the array. NA values in any row
of the character matrix are propagated to the result. Unmatched
values result in a subscript out of bounds error. Empty string “” is
not allowed to match and therefore always results in an error.

I wonder about an option controlling the behavior of non-matches?

To leave a comment for the author, please follow the link and comment on their blog: simon jackman's blog » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)