Learn R Programming

canprot (version 0.1.2)

remove_entries: Remove Data Entries

Description

Remove rows of a data table matching a condition, and print an informative message.

Usage

remove_entries(dat, irm, dataset, description)

Arguments

dat

data frame

irm

logical, which rows to remove

dataset

character, name of dataset used in message

description

character, description used in message

Details

This function is used by the pdat_ functions to “clean up” particular datasets. Examples of the description in pdat_CRC are missing, conflicting, and duplicated. This function is made accessible to the user who may wish to write their own pdat_ functions.

Examples

Run this code
# NOT RUN {
datadir <- paste0(system.file("extdata", package="canprot"), "/expression/CRC/")
dataset <- "STK+15"
# an excerpt from pdat_CRC() for dataset="STK+15"
dat <- read.csv(paste0(datadir, "STK+15.csv"), as.is=TRUE)
dat <- remove_entries(dat, is.na(dat$uniprot), dataset, "missing")
# the above prints "STK+15: dropping 3 missing proteins"
# }

Run the code above in your browser using DataLab