I am working on generating a tornado plot in R. I am using ggplot2
package with code like the following:
dat <- structure(list(variable = structure(c(1L, 2L, 3L, 1L, 2L, 3L), .Label = c("# of nodes needed",
"# of nodes owned", "cost per node"), class = "factor"), Level = structure(c(2L,
2L, 2L, 1L, 1L, 1L), .Label = c("high", "low"), class = "factor"),
value = c(-275, -550, -50, 825, 275, 450)), .Names = c("variable",
"Level", "value"), row.names = c(NA, -6L), class = "data.frame")
ggplot(dat, aes(fill=Level,variable,value )) +
geom_bar(position = 'identity',stat = 'identity') + coord_flip()
I am curious as to how to change x-axis origin. Right now, the origin is automatically set to zero, and I want to be able to change it to a variable specified numeric value.