I am relatively new to R and am trying to learn through some basic courses and trying to solve some problems that I face.
I searched through the forum and google and found what I thought were solutions to my problem but could not get any to work. I have tried the zoo and igraph libraries as well as a few others.
I have a data frame with four columns and about 2k rows. Each column is filled with factors and contain a family, a class, a subclass, and an outcome (binary converted to factor). Hierarchically, they go from broadest category to most detailed. I am trying to create a hierarchy of each "family" showing it's descendants and the counts at each level for the whole data frame. Say family A has 30 rows throughout the data frame. The top box would have "A" with the count of "30". Beneath family "A" we may have 20 in class "A" and 10 in class "B", etc.
Can anyone provide guidance as to what package(s) I can use to accomplish this? From there I can likely find some tutorials. It seems as though it should be a straightforward problem but it escapes me.
Thanks!
Bill
* EDIT *
user1362215 ... as I mentioned "I searched through the forum and google and found what ..." I looked at that package and it was one of the ones I thought was what I needed. Those CRAN docs are difficult for me to understand at times. I have seen that it is the "definitive" source but I tend to find other resources more understandable for me at my level. I have programmed in php, python, and several other languages but R is, for some reason, the most difficult for me to get my head around.
MrFlick ... thanks for the link ... here are 10 rows from a sample data frame ...
> test
family class subclass outcome
1 A A B 0
2 A A B 1
3 A B A 0
4 B C C 0
5 B B B 1
6 B A B 0
7 C D C 1
8 C C C 1
9 A A A 1
10 B D A 0
...
...
...
And here is the link to what I am trying to accomplish (image only has three levels, however, the dataframe has four) ...
In the image diagram, the family column will be the first horizontal level, class the second, subclass the third (omitted from diagram), and outcome the last. I hope this makes it more clear. Thanks to all!