[R] Subseting a data.frame

S Ellison
Fri, 18 Oct 2013 12:58:34 -0000

> -----Original Message-----
> > mydat
> ? basel_asset_class defa_frequency
> 1 ? ? ? ? ? ? ? ? 2 ? ? ? ? ?0.150
> 2 ? ? ? ? ? ? ? ? 8 ? ? ? ? ?0.070
> 3 ? ? ? ? ? ? ? ? 8 ? ? ? ? ?0.030
> 4 ? ? ? ? ? ? ? ? 8 ? ? ? ? ?0.001
>
>
> I need to get the subset of this data.frame where no of records for the
> given basel_asset_class is > 2,

Maybe something like

subset(mydat, ave(1:nrow(mydat), base_asset_class, FUN=length)>2)

?

S Ellison


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}