getCols: getCols

View source: R/CodeAndRoll2.R

getColsR Documentation

getCols

Description

Returns a subset of columns based on their names and optionally removes columns with only NA or zero values. Reports the number of missing columns.

Usage

getCols(
  mat,
  colnamez,
  silent = FALSE,
  removeNAonly = FALSE,
  remove0only = FALSE
)

Arguments

mat

Input matrix.

colnamez

Vector of column names to search for in the matrix.

silent

Logical indicating whether to suppress printing of missing columns. Default: FALSE

removeNAonly

Logical indicating whether to remove columns with only NA values. Default: FALSE

remove0only

Logical indicating whether to remove columns with only zero values. Default: FALSE

Value

A matrix that is a subset of the input matrix.


vertesy/CodeAndRoll2 documentation built on Nov. 20, 2024, 5:23 a.m.