[R] Pl help with code and graph

Jim Lemon drjimlemon at gmail.com
Mon May 9 00:29:51 CEST 2016


Hi Prasad,
You are probably looking for linear modelling of some sort. The first
thing to do is to read the data into R (if you haven't already done
so). You will almost invariably have a _data frame_ in which the
columns will contain values for at least year and profit.

Then plot the profits of A B and C against years. You can do that
using a function like "matplot" (graphics).

Finally, add linear regression lines by getting the result of the "lm"
(stats) function and add them to your plot using "lines" (graphics).
Look at it. Are the letters close to the corresponding lines for each
company or are they scattered all over the plot? If you are lucky,
they will be the former. If not, you will probably have learned enough
about R to inquire what you can do next.

Jim

On Sun, May 8, 2016 at 10:24 PM, Prasad Kale
<prasad.prasad.kale at gmail.com> wrote:
> Hi,
>
> I am very new to R-studio data modelling so can anyone help me with a
> detail code which provides a graph which will provides information in which
> year my company i.e. A will reaches 1 lacs crs. milestone and by that time
> where my competitors i.e. B and C will stands.
>
> I am attaching a excel in which I have given Year on Year profits as well
> as % growth over last year..
>
> Thanks in Advance.
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list