I'm relatively new to R and I can't for the life of me figure out how to make my barplot big enough so that it actually shows my legend below...
Here's what I have so far:
r_plot <- read.table(text = "'Soziale Medien' 'Wissenschaftlicher Text'
50 48
44 37
5 11
1 2", header=TRUE)
barplot(as.matrix(r_plot), beside=TRUE, col=rainbow(4))
legend("bottom", legend=c("asd", "bc", "cd", "ef"), fill=rainbow(4), inset=c(0,-0.5), horiz=TRUE)
Which creates the following barplot (notice how the legend disappears below my bars!):
I sincerely don't get how to fix this.