Learn R Programming

compstatr (version 0.2.1)

cs_filter_count: Remove Negative Counts

Description

Removes the row that contains -1 in a specified column, indicating that the charge described in that observation has either been deemed unfounded or has been up-coded. For example, a victim of an aggravated assault dies, and the charge is changed to homicide.

Usage

cs_filter_count(.data, var)

Arguments

.data

A tibble or data frame

var

the name of the column

Value

A subset object with rows containing -1 removed

Examples

Run this code
# NOT RUN {
# load example data
testData <- january2018

# subset data to remove negative counts
testData <- cs_filter_count(testData, var = count)

# }

Run the code above in your browser using DataLab