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

95 views Asked by At

enter image description here

In this question, how to modify the default graph, named scalesGraph001 stored in R environment, to graph B? I tried many methods but failed to change the order and size of the 'flav' label.

I am totally not sure what command should I use. For instance, scale_color_manual, scale_fill_manual, or scale_y_discrete.

`

p <- scalesGraph001 +
scale_color_manual(name = "flav", breaks = c("c","r", "s", "v"),
labels = c("c", "s", "r", "v"), size = c(16,12,8,4))
print(p1)

The first 10 rows of dataset:

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")

`

0

There are 0 answers