Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library("ggplot2)
- library("plotly")
- test_data <- data.frame(A = c(1,5,7,4,2),
- B = c(3,3,6,8,4),
- C = c(6,2,9,4,5))
- my_dates <- as.Date(c("2010-01-01", "2010-02-01",
- "2010-03-01", "2010- 4-01",
- "2010-05-01"))
- xts_data <- xts(test_data, order.by = my_dates)
- p <- autoplot(xts_data, facets = NULL) +
- guides(color = guide_legend(override.aes = list(size = 2))) +
- geom_line(size = 1)
- print(ggplotly(p))
- new_df <- data.frame(P = c(70, 70, 70),
- Category = c("A", "B", "C"),
- Value = c(5, 15, 10))
- p <- ggplot(data = new_df, aes(
- x = Category, y = Value)) +
- geom_bar(position = position_dodge(), stat = "identity")
- print(p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement