Plotting multiple graphs on the same page in R

0 votes
I would want to plot four histograms side by side for the first four columns of the "Iris" data-set. Is there a method in R do that?
Mar 27, 2018 in Data Analytics by kurt_cobain
• 9,260 points
56 views

1 answer to this question.

0 votes

If you want to plot 4 graphs onto the same pane, you can use the below command:

par(mfrow=c(2,2))

Now, you can plot the four histograms:

hist(iris$Sepal.Length)
hist(iris$Petal.Length)
hist(iris$Sepal.Width)
hist(iris$Petal.Width)
answered Mar 27, 2018 by Bharani
• 4,550 points

Related Questions In Data Analytics

0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,130 points
384 views
0 votes
1 answer

How can I print string and variable contents on the same line using R?

There are two options for doing so.  You ...READ MORE

answered May 9, 2018 in Data Analytics by zombie
• 3,690 points
30 views
0 votes
1 answer

Multiple plots onto a single page in R

Plotting multiple plots onto a single page ...READ MORE

answered Jul 17, 2018 in Data Analytics by darklord
• 6,170 points
40 views
0 votes
1 answer

Loop to automate the plotting process in R

Try something like this: library(tidyverse) data(iris) ## create a grid ...READ MORE

answered Dec 6, 2018 in Data Analytics by Maverick
• 10,040 points
36 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
71 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
151 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
113 views
+1 vote
2 answers

Custom Function to replace missing values in a vector with the mean of values

Try this. lapply(a,function(x){ifelse(is.na(x),mean(a,na.rm = TRUE) ...READ MORE

answered Aug 14 in Data Analytics by anonymous
85 views
0 votes
1 answer

Applying the same function to every row of a data.frame - R

You can use the 'appply()' function for ...READ MORE

answered May 22, 2018 in Data Analytics by Bharani
• 4,550 points
64 views
0 votes
1 answer

Changing the order of bars in a bar-plot - ggplot2 - R

You can use the scale_x_discrete() function with ...READ MORE

answered May 28, 2018 in Data Analytics by Bharani
• 4,550 points
3,080 views