YouTip LogoYouTip

R Func Subset

# R subset() Function - Data Filtering [![Image 3: R Language Examples](https://example.com/images/up.gif) R Language Examples](https://example.com/r/r-examples.html) R subset() function is used to filter data from a data frame based on conditions. The syntax of subset() is more concise and intuitive than using [] brackets for filtering. The syntax of subset() function is as follows: subset(x, subset, select) **Parameter Description:** * **x** Data frame. * **subset** Row filtering condition (logical expression). * **select** Column filtering, can specify which columns to keep. ## Example # Create data frame df<-
← R Func SumR Func Str β†’