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

firstLineOfDat

Filter matrix to keep only first of repeated lines


Description

This function aims to reduce the complexity of a matrix (or data.frame) in case column 'refCol' has multiple lines with same value. In this case, it reduces the input-data to 1st line of redundant entries and returns a matrix (or data.frame) without lines identified as redundant entries for 'refCol'). in sum, this functions works lile useng unique on a given column, and propagates the same treatment to all other columns.

Usage

firstLineOfDat(dat, refCol = 2, silent = FALSE, callFrom = NULL)

Arguments

dat

(matrix or data.frame) main input

refCol

(integer) column number of reference-column

silent

(logical) suppress messages

callFrom

(character) allosw easier tracking of message(s) produced

Value

matrix (same number of columns as input)

See Also

Examples

(mat1 <- matrix(c(1:6,rep(1:3,1:3)),ncol=2,dimnames=list(letters[1:6],LETTERS[1:2])))
firstLineOfDat(mat1)

wrMisc

Analyze Experimental High-Throughput (Omics) Data

v1.5.4
GPL-3
Authors
Wolfgang Raffelsberger [aut, cre]
Initial release

We don't support your browser anymore

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