[R] Plotting in R

John Kane jrkr|de@u @end|ng |rom gm@||@com
Sat Jul 6 17:47:19 CEST 2019


Please do not post in html.

You could use ggplot to do this. But you need to do a bit of work yourself.

On Sat, 6 Jul 2019 at 10:51, <ruipbarradas using sapo.pt> wrote:
>
> Hello,
>
> Please don't post inHTML, the data is unreadable.
>
> As for the question, it is very basic. try any of
>
>
> plot(rate ~ year, data = df)    # df is your dataframe
> plot(df$year, df$rate)
>
>
> Then read ?plot and ?par to see how to customize the graph, by
> changing the plot type, how to add colors, etc.
>
> Hope this helps,
>
> Rui Barradas
>
>
>
> Citando Steven Yen <styen using ntu.edu.tw>:
>
> > I have a data frame containing two variables: year and rate (shown below).
> > Which function can I use to plot rate (y-axis) against year (x-axis)?
> > There will be more columns of rate later on.
> > Thank you.
> >
> > year rate 1 1993 0.608 2 1994 0.622 3 1996 0.623 4 1998 0.647 5 2000
> > 0.646 6 2002 0.625 7 2004 0.628 8 2006 0.685 9 2008 0.679 10 2010 0.595
> > 11 2012 0.567 12 2014 0.599 13 2016 0.642 14 2018 0.685
> >
> >
> > --
> > styen using ntu.edu.tw (S.T. Yen)
> >
> >
> >
> > ---
> > This email has been checked for viruses by Avast antivirus software.
> > https://www.avast.com/antivirus
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 
John Kane
Kingston ON Canada



More information about the R-help mailing list