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,350 points
1,429 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,660 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,250 points
3,828 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,790 points
1,879 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 Sahiti
• 6,370 points
604 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 7, 2018 in Data Analytics by Maverick
• 10,840 points
1,671 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,660 points
1,185 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,660 points
5,892 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

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

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
1,116 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, 2019 in Data Analytics by anonymous
1,940 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,660 points
1,696 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,660 points
9,724 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP