[R] How to plot dates
drj|m|emon @end|ng |rom gm@||@com
Tue Mar 16 22:54:58 CET 2021
This example may give you a start:
Note that I have corrected what I think is a mistake in reading in
your data. The first date has been converted into the field name by
prepending an "X" and then replacing the hyphen and semicolon
characters with periods to coerce it to a name. I changed that back
to what I think it was and this produces s basic plot with the dates
on the abscissa and some random numbers on the ordinate.
On Wed, Mar 17, 2021 at 6:26 AM Gregory Coats via R-help
<r-help using r-project.org> wrote:
> I need a plot that shows the date and time that each event started.
> This ggplot command was publicly given to me via this R Help Mailing LIst.
> But the result of issuing the ggplot command is an Error in FUN message.
> ggplot(myDat, aes(x=datetime, y = Y_Var)) + geom_point()
> Error in FUN(X[[i]], ...) : object 'Y_Var' not found
> Greg Coats
> > On Mar 16, 2021, at 2:18 PM, John Fox <jfox using mcmaster.ca> wrote:
> > There is no variable named Y_Var in your data set. I suspect that it's intended to be a generic specification in the recipe you were apparently given. In fact, there appears to be only one variable in myDat and that's datetime. What is it that you're trying to do?
> [[alternative HTML version deleted]]
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help