I am trying to plot a boxplot and density plot adjacent to each other using the par(mfrow=c(1,2))
argument and it does not work for:
With the following code:
par(mfrow=c(1,2))
boxplot(x)
densityplot(x)
The box plot appears in the left half of the plot device, but densityplot()
opens in a new device.
With the order reversed:
par(mfrow=c(1,2))
densityplot(x)
boxplot(x)
The box plot is overlayed on the former.
Here's the dput() of my data if needed:
> dput(x)
c(79, 56, 69, 61, 53, 73, 72, 86, 75, 68, 74.2, 80, 65.6, 60, 54)
Does densityplot()
not work with the par()
argument? Is there a work-around?