I can't find a solution by checking previous questions so I thought I'd throw this here.
I have an excel file with columns titled 'Date' and 'Tensiometer'. Might be important to note that the dates are saved as d/mm/yyyy
.
I'm trying to use ggplot
to make a graph with dates on the x axis and the tensiometer reading on the y axis. When I make it, the values for the dates are 1) really large whole numbers (43275, 43300, etc.) and 2) not on every tick of the x axis. The values are in chronological order, it's just not displaying the right numbers.
Here's the code that I have so far
library(openxlsx)
library(ggplot2)
read.xlsx(file.choose("file that I'm using"))
df <-read.xlsx(file.choose("file that I'm using"))
ggplot(data = df) + geom_point(mapping = aes(x = Date, y = Tensiometer))
Here's an example of what the data looks like:
structure(list(Plot = c(1046, 1013, 1082, 1095, 1163, 1046),
Treatment = c(5, 3, 2, 4, 1, 5), Date = c(43258, 43258, 43258,
43258, 43258, 43264), Time = c(0.425694444444444, 0.425694444444444,
0.425694444444444, 0.425694444444444, 0.425694444444444,
0.394444444444444), Tensiometer = c(19, 13, 20, 12, 20, 34
)), row.names = c(NA, 6L), class = "data.frame")
I'm currently only interested in plotting 'Date' and 'Tensiometer', though. Any help would be greatly appreciated. Thanks!!