How to change the order and size of the labels in R?


Based on the default, how to get graph B?
I tried a lot of times, but I failed. The most recent try is:
'''p1 <- scalesGraph001 +
scale_shape_manual(name = 'flav', breaks = c('c', 'r', 's', 'v'), values = c(1,1,1,1), labels = c('c', 'r', 's', 'v'))
print(p1)
'''

What data are you using?


It contains extremely much data so I did not post it... Would you mind telling me how to change the order and size of the labels? Highly appreciate it and thanks so much!

The first 20 rows of data looks like:
'''

structure(list(flav = c("c", "v", "c", "c", "v", "v", "c", "v", "c", "c"), top = c("c", "s", "n", "s", "c", "c", "n", "n", "c", "c"), syr = c(TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE), weight = c(13.1, 14.4, 11.4, 8.7, 6.2, 12.6, 5.1, 12.8, 10.9, 6.5), cal = c(1293.1, 1460.5, 1202.2, 844.4, 552.9, 1259.4, 520.6, 1308.1, 1084.5, 649.8)), row.names = c(NA, 10L ), class = "data.frame")

'''

Is there a reason why in B the order of the flavors on the x-axis is different than in the legend? And would you want to keep them having the different orders shown in B?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.