This is my first time using RStudio, and I've tried to find the the answer to my solution along with tinkering around with the code but I haven't been able to figure it out. I've even looked here and found other users with the same issue How to display all x labels in R barplot? and Rotating x axis labels in R for barplot but I wasn't able to get the answered solutions to work for my code. I've also asked two people more familiar with R, but after looking over my code and trying for themselves they were also unable to figure it out as well.
Everything would just result in error messages (I don't have the error messages showing in my console since when someone was trying to figure it out they cleared the global environment).
I have already generated 15 bars for my barplot, and the barplot itself is generated with the labels for the ylab, the title for my xlab, and the main, and I even have it colored, but I can't name each individual column bar.
The names for all the labels are listed in the source, but it's only showing every third bar or so. I need all bars labeled.
setwd("C:/Users/Person/Desktop/Rfolder")
library(readxl)
data <- read_excel("filename.xlsx")
View(topic)
barplot(data$'per hundred',
main ="Title",
xlab = "Words",
ylab = "variable stats",
col = c("gray"))
axis(1, at =c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
srt = 45,
labels=c("Apple","Butter","Banana","Bacon","Candy","Carrot","Spam","Ube","Ice cream","Italian ice","Jackfruit","Kale","Tofu","Udon","All types"))
(data$'per hundred main ="Title",...
perhaps should bebarplot( data$'per hundred', main ="Title",...
. I'm not voting to close as typo, since you have apparently got a plot occurring somewhere, but since there is no minimal reproducible example it might get closed eventually. Why no make a small example (perhaps withdput(head(data))
and remove the junk about reading data from your disk. – IRTFM