Learn R Programming

m61r (version 0.0.3)

filter: filter a data.frame

Description

Filter rows of a data.frame with conditions.

Usage

filter_(df, subset = NULL)

Arguments

df

data.frame

subset

formula that describes the conditions

Value

The function returns an object of the same type as df. Properties:

  • Columns are not modified.

  • Only rows following the condtion determined by

  • subset appear.

  • Data frame attributes are preserved.

Examples

Run this code
# NOT RUN {
tmp <- filter_(CO2,~Plant=="Qn1")
head(tmp)

tmp <- filter_(CO2,~Type=="Quebec")
head(tmp)

# }

Run the code above in your browser using DataLab