I ^ have a dataset that looks something like this:
typestudy dloop cytb coi other microsat SNP
methods no no no no yes no
methods yes no no no no yes
methods no no no no yes no
methods no no no no yes no
wildcrime no no no yes no no
taxonomy no no no no yes no
methods yes no no no no no
methods no no no no yes no
taxonomy no no no no yes no
wildcrime yes no no no no no
methods yes no no no no no
taxonomy no no no no yes yes
taxonomy no no no no yes no
Except it has 10 columns of yes/no corresponding to further genetic elements and there are over 200 rows.
In Excel the graphical summary option give me a great stacked bar plot but I need to be able to recreate it in R to meet university standards for my report
> summary(dframe1$type.of.study)
methods development other
49 5
population genetic structure taxonomy
91 86
wildlife crime
6
> barplot(as.matrix(dframe1))
There were 11 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In apply(height, 2L, cumsum) : NAs introduced by coercion
2: In apply(height, 2L, cumsum) : NAs introduced by coercion
3: In apply(height, 2L, cumsum) : NAs introduced by coercion
4: In apply(height, 2L, cumsum) : NAs introduced by coercion
5: In apply(height, 2L, cumsum) : NAs introduced by coercion
6: In apply(height, 2L, cumsum) : NAs introduced by coercion
7: In apply(height, 2L, cumsum) : NAs introduced by coercion
8: In apply(height, 2L, cumsum) : NAs introduced by coercion
9: In apply(height, 2L, cumsum) : NAs introduced by coercion
10: In apply(height, 2L, cumsum) : NAs introduced by coercion
11: In apply(height, 2L, cumsum) : NAs introduced by coercion
which gives me this
and I've also managed to produce this but can't find the script I used for it
My aim is something similar to this:
it's pretty pathetic but it's taken me almost a week of troubleshooting based on online resources and other questions on here to get to this point. I can't figure out how to count the types of study so they're tallied up to make the height of the bar plots corresponding to different genetic markers. I know this is far too vague for stackoverflow's standards but I'm desperate so I'm leaving this up in case anyone has any suggestions
^ (I'm going to be as concise as I can but as you'll see my fluency in R is atrocious, I wouldn't ask for help but I've spent DAYS grappling with this data and I'm petrified I'll never find a solution and there's nobody to ask for help on my research placement)