Yes. But place your “test” after the comma if you want the column…
> A <- matrix(sample(1:12,12,T),ncol=4)
> rownames(A) <- letters[1:3]
> colnames(A) <- letters[11:14]
> A[,"l"]
a b c
6 10 1
see also help(Extract)
More Related Contents:
- How to subset matrix to one column, maintain matrix data type, maintain row/column names?
- How to subset a matrix with different column positions for each row? [duplicate]
- How to remove rows of a matrix by row name, rather than numerical index?
- R subset based on range of dates [closed]
- Select rows from a data frame based on values in a vector
- Split a large dataframe into a list of data frames based on common value in column
- Opposite of %in%: exclude rows with values specified in a vector
- How to replace NA with mean by group / subset?
- Subset data frame based on multiple conditions [duplicate]
- How to divide each row of a matrix by elements of a vector in R
- Subscript out of bounds – general definition and solution?
- How can I create a correlation matrix in R?
- Remove groups with less than three unique observations
- Apply a function to every row of a matrix or a data frame
- Rotate a Matrix in R by 90 degrees clockwise
- dplyr – filter by group size
- R – How to get row & column subscripts of matched elements from a distance matrix
- Create dataframe from a matrix
- R gotcha: logical-and operator for combining conditions is & not &&
- Finding row index containing maximum value using R
- Function to split a matrix into sub-matrices in R
- Loop in R: how to save the outputs?
- Last Observation Carried Forward In a data frame? [duplicate]
- Find K nearest neighbors, starting from a distance matrix
- R: How to filter/subset a sequence of dates
- Calculate Euclidean distance matrix using a big.matrix object
- Undefined columns selected when subsetting data frame
- fast large matrix multiplication in R
- How to get all possible subsets of a character vector in R?
- Filtering rows in R unexpectedly removes NAs when using subset or dplyr::filter