0
votes

I am creating a graph looking at a concentration vs. date. My data is imported as day/month/year but when I graph the data, it is just using the year on the x axis. It is a pretty small data set and I would like each point to have a corresponding date.

Here is a little example of the data: Result Date 24.8 25-Jul-18 22.8 08-Aug-18 24.8 22-Aug-18 26.3 06-Sep-18 27.6 18-Sep-18 29.9 03-Oct-18 29.5 04-Apr-19 25.9 15-Apr-19 28.3 02-May-19 28.3 15-May-19 27 31-May-19 26.3 12-Jun-19 25.5 26-Jun-19 24.9 10-Jul-19 25.4 06-Jul-16 24.7 20-Jul-16

ggplot(pipeline) + aes(pipeline$Date, pipeline$Result) +
  geom_point() + 
  geom_line() +
  xlab("Year") + 
  ylab("Alkalinity mg/L")

I currently have a graph reflecting years but would like it broken down into the actual date.

1

1 Answers

0
votes

I am assuming the Date column in pipeline is not character. Hence simply turning Date column to character, should help with this.

#Code
pipeline$Date <- as.character(pipeline$Date)
ggplot(pipeline) + aes(pipeline$Date, pipeline$Result) +
geom_point() + 
geom_line() +
xlab("Year") + 
ylab("Alkalinity mg/L")