The doctor prescribes a small modification of the Roman data frame.
library(ggplot2)
my.cars <- data.frame(
Toyota = runif(50),
Mazda = runif(50),
Renault = runif(50),
Car = paste("Car", 1:50, ".txt", sep = "")
)
my.cars.melted <- melt(my.cars, id.vars = "Car")
He then suggests that it look like the car variable is categorical, so your first choice would be velvet.
p_bar <- ggplot(my.cars.melted, aes(Car, value, fill = variable)) +
geom_bar(position = "dodge")
p_bar
, 95 . , -.
p_dot <- ggplot(my.cars.melted, aes(Car, value, col = variable)) +
geom_point() +
opts(axis.text.x = theme_text(angle = 90))
p_dot
, ( )
my.cars.melted$Car <- with(my.cars.melted, reorder(Car, value))
( p_dot, .)
, , ,
p_lines <- ggplot(my.cars.melted, aes(as.numeric(Car), value, col = variable)) +
geom_line()
p_lines