-1

enter image description here

as you can see, in the raw data the categorical predictions(bowl, plate, tray...) are separated. But one of the question is observe the correlation between Categories&Diameter&Time.

and the sol makes the scatter plot matrix like this enter image description here

so my ultimate question is how can i put these plate, bowl,tray columns into one frame and make a scatter plot matrix like this??

1 Answers1

0

If your data frame or matrix with those columns has them in the first 5 columns then

mydata[,1:5]%*%cbind(1:5)

will turn your dummies back into a variable with values 1,2,3,4,5 representing the category membership.

You can add that new variable to your data frame and just plot the columns you want in your pairs plot / scatter plot matrix

Glen_b
  • 7,883
  • 2
  • 37
  • 48
  • i tried what u said, but the error occurred, saying "requires numeric/complex matrix/vector arguments" – user154797 May 10 '17 at 09:05
  • If you didn't include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example), forcing us to *guess* what was in your variables (you only gave their names!), then you must think we're *magic* and can read your mind. [My answer is based on what any sane person will do with dummy variables, which is to make them 0-1. Convert each one to 0-1 in the obvious way - with a Boolean expression - and it will work] – Glen_b May 10 '17 at 09:19