Published on Feb 22,2017
355 Views
Email Post

The R Console can be used for Basic Calculation such as Addition, Division, Multiplication, Subtraction and Division. Once the calculation is done, we can also assign values. The letter ‘c’ is a command in r  tells the program that the user is entering a number. While making a plot function, we use “?plot” which will give the x coordinate and y coordinate and the “type” will tell whether it would be a point or a line. Once we define ‘type’= 1 , it joins all the points in the graph and so on. Here we can create a y axis with a limit of 1-10.  Let us look into the statement:

x<= (2,5,7,4,6,5,6,3,2,1,6,7,8,9)
Plot(x)
?plot
Plot(x,type=”1”)
Plot(y,type=”b”)
y<=c(1:10)
Plot(y,type=”1”)

Here it gives the numbers 1-10. It only plots y. Similarly once we plot x, the graph changes according to the values in x.

If the user wants to plot x with y, we can add the code :

plot(x,y,type=”1”)

It will merge the values of x and y and present the graph.

Got a question for us?? Mention them in the comments section and we will get back to you.

Related Posts:

R Tutorial for Data Analytics and Data Science Jobs

Introduction to Business Analytics with R

Importance of Sentiment Analysis