I have a column with a name datein my data frame and in another column with a name values. I want to calculate values ββagainst days of the week.
I know that we can get the days of the week from the date using the function weekdays(). But I'm not sure how to plot the chart with values(y axis) in relation to the days of the week (x axis)
Date Values
12-03-2006 0.5
14-03-2006 0.6
18-03-2006 0.9
23-03-2006 1.1
02-04-2006 2.1
I tried this
plot(weekdays(df$Date),df$values)
I got this error:
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
Can someone help me fix this error?
source
share