A suggestion for selecting a plot

Hello!!!

I'm looking for making a plot using Rstudio. Plot. Unfortunately, I'm R "newbie" so I'm not familiar with it. I wrote this one in r studio plot(y,x,main="The Sine Function", ylab=x,type="l", col="blue") which is very close from what I'm querying for. In the link that I provide, I want to add instead of the dots the Ids(Data_frames in my data) of each point.

An example of my data file is :
ID POINT Mark
Data_frame1 14 0
Data_frame2 8 0
Data_frame3 19 0
Data_frame4 2 0
Data_frame5 27 0
Data_frame6 31 0

thank you in advance!!!!

A reproducible example, called a reprex -- FAQ: What's a reproducible example (`reprex`) and how do I create one? -- would help here.

So, I'll have to use an example from a standard data set.

plot(cars) # default is points
lines(cars, type = "l") # overlay line

Created on 2020-01-29 by the reprex package (v0.3.0)

Take a look at the ggplot2 package. Easier to use, more expressive.

thank you very very much for the super prompt response! so in your example ```
lines(cars, type = "l")

Right. lines will layer over the existing points plot. Again, this is much more intuitive with ggplot2.

If this answers your question, please see FAQ: How do I mark a solution? for the benefit of those to follow. ("Penny a point, ain't no one keeping score")

Perfect!!! I will try it and I will mark your response afterward if you dont mind, to avoid starting a new topic. Once again thank you very much.

1 Like

I used the ggplot... which super easy. I had to see 2 -3 examples and thats all! I obtained what I want.
Thank you very much for your help

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.