I have a Date variable in my dataframe.
> str(gran$Date)
Date[1:1368], format: "2014-11-06" "2014-11-05" "2014-11-04" "2014-11-03" "2014-11-02" "2014-11-01" "2014-10-31" ...
When I print histogram as:
hist(gran$Date, "month")
It doesn't show per month. It just shows per Year as displayed below...
in addition to this: I have a logical variable like:
gran$neg_WS = gran$Act.Rep.WS < 0
I want to draw histogram where negative value occurs i.e.
plot(gran$Date[gran$neg_WS], "month")
I get the following error:
> plot(gran$Date[gran$neg_WS], "month")
Error in xy.coords(x, y, xlabel, ylabel, log) :
'x' and 'y' lengths differ
I don't believe it is correct as length is the same i.e. 1368 for both variables.
> length(gran$neg_WS)
[1] 1368
> length(gran$Date)
[1] 1368
Any Solutions?