Skip to content

R Frequently Asked Questions

Statistical Computing and Graphics in R

Menu
  • Learn R
    • R Basics
      • R FAQS about Package
      • R GUI
      • Using R packages
      • Missing Values
    • R Graphics
    • Data Structure
      • Data Frame
      • Matrices
      • List
    • R Programming
    • Statistical Models
  • R Quiz
    • MCQs R Programming
    • R Basic Quiz 7
    • MCQs R Debugging 6
    • MCQs R Vectors 5
    • R History & Basics 4
    • R Language Test 3
    • R Language MCQs 2
    • R Language MCQs 1
  • MCQs
    • MCQs Statistics
      • MCQs Basic Statistics
      • MCQs Probability
      • MCQs Graph & Charts
      • MCQs Sampling
      • MCQs Inference
      • MCQs Correlation & Regression
      • MCQs Time Series
      • MCQs Index Numbers
      • MCQs Quality Control 1
    • MCQS Computer
    • MCQs Mathematics Part-I
  • About ME
  • Contact Us
  • Glossary

Tag: R plot

Introduction to R plot() function

No Comments
| plot Function, R Graphics

Question: Can we draw graphics in R language?
Answer: Yes. R language produces high-quality statistical graphs. There are many useful and sophisticated kinds of graphs available in R.

Question: Where graphics are displayed in R?
Answer: In R, all graphs are produced in a window named Graphic Windows which can be resized.

Question: What is the use of plot function in R?
Answer: In R, plot() is a generic function that can be used to make a variety of point and line graphs. plot() function can also be used to define a coordinate space.

Question: What are the arguments of the plot() function?
Answer: There are many arguments used in the plot() function. Some of these arguments are x, y, type, xlab, ylab, etc. To see the full list of arguments of the plot() write the command in R console;

> args(plot.default)

Question: Do all arguments are necessary to be used in R?
Answer: No. The first two arguments x and y provide the horizontal and vertical coordinates of points or lines to be plotted and also define a data-coordinate system for the graph. At least argument x is required.

Question: What is the use of the argument type in the plot() function?
Answer: The argument type determines the type of the graph to be drawn. There are several types of graph that can be drawn. The default type of graph type=’p’, plots points at the coordinates specified by x and y argument. Specifying type=’l’ produces a line graph, and type=’n’ sets up the plotting region to accommodate the data set but plots nothing.

Question: Is there other types of graph are?
Answer: Yes. Setting type=’b’, draw graphs having both points and lines. Setting type=’h’ draws histogram like vertical lines and setting type=’s’ and type=’S’ draws stair-step-like lines starting horizontally and vertically respectively.

[amazon_link asins=’331924275X,0521762936,1498779832,1449316956′ template=’ProductCarousel’ store=’rfaqs-20′ marketplace=’US’ link_id=’37a244ef-8286-11e8-ace0-8d7a701c4bf4′]

Question: What is the use of xlim and ylim in plot() function?
Answer: The argument xlim and ylim may be used to define the limits of the horizontal and vertical axes. Usually, these arguments are unnecessary, because R language reasonably picks limits from x and y.

Question: What are the purpose of xlab and xlab argument in the plot() function?
Answer: xlab and ylab argument tack character-string arguments to label the horizontal and vertical axes.

Question: Provide few examples of plot() function?
Answer: Suppose you have data set on variable x and y, such as

> x <- rnorm(100, m=10, sd=10)
> y <- rnorm(100)
> plot(x, y)
> plot(x, y, xlab=’X  (Mean=10, SD=10)’,   ylab=’Y (Mean=1, SD=1)’ , type=’l’)
> plot(x, y, xlab=’X  (Mean=10, SD=10)’,   ylab=’Y (Mean=1, SD=1)’ , type=’o’)
> plot(x, y, xlab=’X  (Mean=10, SD=10)’,   ylab=’Y (Mean=1, SD=1)’ , pch=10)

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Skype
  • Tumblr
  • Pinterest
  • Print
  • WhatsApp
  • Telegram
  • Reddit
  • Pocket

Like this:

Like Loading...

Read More »

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 265 other subscribers

Search Form

Facebook

Facebook

Categories

  • Advance R Programming (3)
  • Data Analysis (12)
    • Comparisons Tests (2)
    • Statistical Models (10)
  • Data Structure (9)
    • Data Frame (2)
    • Factors in R (1)
    • List (2)
    • Matrices (2)
    • Vectors in R (1)
  • Importing/ Exporting Data (4)
    • R Data Library (4)
  • R Control Structure (3)
    • For loop in R (1)
    • Switch Statement (1)
  • R FAQS (18)
    • Missing Values (2)
    • R Basics (12)
    • R FAQS about Package (3)
    • R Programming (2)
  • R Graphics (4)
    • Exploring Data in R (1)
    • plot Function (2)
  • R Language Basics (4)
  • R Language Quiz (8)
  • Using R packages (2)
https://www.youtube.com/watch?v=MZpiMyAfnYQ&list=PLB01qg3XnNiMbKkvP2wYzzHkv6ZekaKZx

Posts: itfeature.com: Basic Statistics and Data Analysis

MCQs Chi-Square Association 2

The relationship/ Dependency (also called Association) between the attributes is called relationship/association and the measure of degrees of relationship between the attributes is called the coefficient of association. The Chi-Square Statistic is used to…

Short Questions Sampling and Sampling Distributions 1

The post is about some important Short Questions about sampling and sampling distribution. Q1: Define Sample and Sampling. Answer: Sample: A small portion of the population representing the qualities of the population being sampled…

MCQs IBM SPSS-1

Online MCQs about IBM SPSS with answers.

MCQs Correlation and Regression 6

This Quiz contains MCQs about Correlation and Regression Analysis, Multiple Regression Analysis, Coefficient of Determination (Explained Variation), Unexplained Variation, Model Selection Criteria, Model Assumptions, Interpretation of results, Intercept, Slope, Partial Correlation, Significance tests, OLS Assumptions,…

Short Questions: Normal and Standard Normal Distribution

The following post is about Short Questions related to Normal and Standard Normal Distribution. Q1: What is a standard normal variable? Ans: The variable $Z=\frac{X-\mu}{\sigma}$ which measures the deviations of variable $X$ from the…

Posts: gmstat.com: GM Statistics

MCQs Number System – 4

MCQs Economics – 3

MCQs Economics – 2

Try MCQs Economics Test 1

MCQs Economics – 1

MCQs Econometrics Quiz 5

This quiz is about Econometrics, which covers the topics of Regression analysis, correlation, dummy variable, multicollinearity, heteroscedasticity, autocorrelation, and many other topics. Let’s start with MCQs Econometrics test An application of different statistical methods applied to the economic data used…

R Frequently Asked Questions 2023 . Powered by WordPress

%d bloggers like this:
    pixel