I have a csv file "fruit.csv"
looking like that:
"Date","Fruit","Count"
2019-01-01,Apple,3
2019-01-01,Pear,5
2019-01-01,Banana,4
2019-02-01,Apple,4
2019-02-01,Pear,4
2019-02-01,Banana,6
...
I want to plot the data having the date in the x-axis and the number in the y-axis. Especially, i want the graph to only show the data of a certain fruit, e.g. only apples. This is what I have until now, plotting all fruits at once:
data <- read.csv("Path/to/fruit.csv")
data$Date <- as.Date(data$Date)
time_series <- xts(data$Count, order.by = data$Date)
dygraph(time_series)
What do I need to add, to specify the fruit I want to plot?