Check out example codes for "two plots side by side r". It will help you in understanding the concepts better.

Code Example 1

par(mfrow=c(1,2))    # set the plotting area into a 1*2 array
barplot(max.temp, main="Barplot")
pie(max.temp, main="Piechart", radius=1)
par(mfrow=c(1,1))

Learn ReactJs, React Native from akashmittal.com