'Is there any function to split data in R, depending on a certain value?

I want to create a new table with these conditions: all the data that in transition=13-14 was size_age=j.

enter image description here



Solution 1:[1]

You can use dplyr::filter, with conditions to get your desired subset

dplyr::filter(df, transition =="13-14", size_age=="j")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 langtang