I have a data frame that looks like:
uri month
1 /product/product2 Jun
2 /product/product3 Jun
3 /product/product3 Jun
4 /feeds/press Jun
5 /product/product3 Jun
6 /product/product3 Jun
I want to create another data frame that looks like
uri Jan Feb Mar etc.
/product/product2 1938 5785 4842
/feeds/press 523894 34829 398423
These numbers are all examples (not the real totals)
I was able to create something like this using:
#Reorder Months in Calendar Year for /demo URI
demo_month = as.matrix(
as.matrix(summary(uri_month[uri_month$uri == "/demo", "month" ]))
[c(5,4,8,1,9,7,6,2,12,11,10,3),])
such that demo_month looks like
[,1]
Jan 12845
Feb 11716
Mar 11627
Apr 11005
May 12362
Jun 12360
Jul 12688
Aug 11526
Sep 11105
Oct 2544
Nov 17056
Dec 14137
Essentially, I would want to repeat the code I used for the /demo uri for each level. I know I can do it manually and just replace "/demo", then combine it, but I have 130 different types of URI. I'm a beginner in R, and would prefer to not use any packages. I believe I would need to use tapply() somehow.
Thanks!