I am using the following code:
agg_sales_pcat <- aggregate(store_sales ~ product_category,data = agg_sales,mean)
to aggregate store sales product category wise.But there are 45 different product categories and I want only the top 10 records from agg_sales_pcat.
So is there a way to do this in aggregate or do i have to use separate line of code for this??