Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

subscript2d

Uniform Rectangular Data Subscripting Function


Description

subscript2d is for subscripting matrices and data frames.

Usage

subscript2d(x,i,j)
subscript2dMatrix(x,i,j)
subscript2dDataFrame(x,i,j)

Arguments

x

a matrix or data frame

i

first (row) subscript.

j

second (column) subscript.

Value

subscript2d(x,i,j) is like x[i,j,drop=F], except that it allows x[,1] (for example) for atomic vectors as well, and it always returns an object of the same class as x (that is, it does not support a drop argument).

See Also

Examples

x <- 1:10
subscript2d(x,3,1)
subscript2d(data.frame(x),3,1)
subscript2d(matrix(x),3,1)

splus2R

Supplemental S-PLUS Functionality in R

v1.3-3
GPL-2
Authors
William Constantine [aut], Tim Hesterberg [aut], Knut Wittkowski [ctb], Tingting Song [ctb], Bill Dunlap [ctb], Stephen Kaluzny [ctb, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.