Using Featureplot command in 'caret' package for R

Greetings all,

The R package caret has a number of exploratory data analysis tools. Featureplot is one tool that produces a nxn grid of 2 D scatter plots for variable data analysis. The example in the vignette has a 4 x 4 grid which looks great on screen, and in RStudio. However I have 20 variables that I want to explore.

Q. What is the best way to do a 20x20 grid of 2 D plots such that the plots aren't tiny and too small to see? Is there a preferred way?

Suggestions?

That function is s simple wrapper around reshape and lattice.

A simple approximation would be:

library(tidyverse)

# Species is the outcome for classification
iris %>% 
  gather(predictor, value, -Species) %>% 
  ggplot() + 
  aes(x = Species, y = value) + 
  geom_boxplot() +
  facet_wrap(~ predictor, scales = "free_y")

# regression example:

mtcars %>% 
  gather(predictor, value, -mpg) %>% 
  ggplot() + 
  aes(x = value, y = mpg) + 
  geom_point() +
  facet_wrap(~ predictor, scales = "free_x")
1 Like

Hi Max,
Thank you. I will give this a try, hopefully soon, :wink: and let you how it goes.
Cheers

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.