Thursday, April 4, 2013

plotting multiple scatter plots arranged in facets (trallis type) in Excel using RExcel with (with KMggplot2 plugins)

See the related posts on RExcel (for basic, Excel 2003 and Excel 2007) for basic information.

In previous post we created mutiple histograms arrange in row and column (facets, trallis type plots), we can do the same for the scatter plot using RExcel with (with KMggplot2 plugins). Basic step in data loading etc are same. We will use the same cabbage dataset  to deomstrate how we can do this.

 Data is loaded and active, we need to check histograms under KMggplot2 menu. Now we have choice for X variable, Y variable, stratum variable, Facet variable in row or column direction. We can add smoothing curves or opt out by clicking none.


See the nicely arranged publication ready graphs:


plotting multiple histograms arranged in facets (trallis type) in Excel using RExcel with (with KMggplot2 plugins)

See the related posts on RExcel (for basic, Excel 2003 and Excel 2007) for basic information.

We discussed how we can use RExcel in previous posts and we used RExcel we generate voilin box plot and plots. Following the similar steps we can generate mutiple histograms, arranged compact in trallis type fashion.

(1) First load R and then R commander to see R menu in Excel (see previous posts)

(2) Following example uses dataset cabages from the R dataset library. Load the data.

(3) KMggplot2 (unlike other menus is not activated as such), you need to go to tools and then click Load Pug-ins and then select RcmdrPlugin.KMggplot2. It will promt you to restart Rcmcdr click OK. Now you can see a menu with KMggplot2 in your RExcel menus.

(3) Now click  Histogram under KMggplot2 menu. You can see the histogram  box where we have specify different parameters inclusing variable to be plotted, which variable is in rows or columns in facets etc.


See now you have histograms nice looking !

You can density curve over the histograms, also you can also include heatmap within the histogram (cool !) - just click Desnity estimation and or heatmap under options . We are using different variable to pick in the following example.