I have created this plot, but i want to combine Time
and Date
together in the x-axis. (note that in my dataset, Time
and Date
are in separate columns):
Code:
library(shiny)
library(shinydashboard)
library(ggplot2)
library(scales)
shinyServer(function(input,output){
output$Histogram <- renderPlot({
Energy <- read.csv("Energy.csv")
Energy$Date <- as.POSIXct(Energy$Date)
ggplot(data=Energy, mapping=aes(x=Date, Time, y=kWh)) +
scale_x_datetime(date_breaks= "1 month") +
geom_point(aes(color=Time)) +
theme(axis.text.x = element_text(angle = 25, vjust = 1.0, hjust = 1.0))
})
What can i do to make 'Time' and 'Date' in the x-axis together?