I have a dataset that looks like this
Date Location count
18-01-2023 A 45.457
18-01-2023 B undetermined
24-01-2023 C undetermined
24-01-2023 B undetermined
24-01-2023 C 20.33
27-01-2023 A undetermined
27-01-2023 D undetermined
27-01-2023 B 30.27
01-02-2023 C undetermined
01-02-2023 A undetermined
01-02-2023 D 29.22
01-02-2023 B undetermined
03-02-2023 A undetermined
03-02-2023 C 27.822
this is about getting some bacteria counts from different samples collected from a different locations.
I want to create a plot like this
which R script will work if I have multiple entries in one date.
I have tried this command
set.seed(1023)
sample_data <- round(exampledata)
# Load packages reshape2 and ggplot2
library("reshape2")
library("ggplot2")
# Convert sample_data from wide form to long form
data_final <- melt(all_data, id.vars = "Date")
head(data_final)
# Plot the final data
ggplot(data_final,
aes(x = date(),
y = value,
col = variable)) + geom_line()