I would like to matplotselect only selected rows from data frames. In both datasets you can find the "YES" or "NO" column. I would like matplotonly the rows (of course, the columns with values) that have YESin the last column. Let me show you the data first, and later I will give a few more explanations of what I expect to achieve.
> dput(c)
structure(list(Fr1 = c(0.2, 0, 0, 0, 0, 0), Fr2 = c(0.7, 0, 0,
0, 0, 0), Fr3 = c(1, 0.35, 0, 0, 0, 0), Fr4 = c(0.1, 1, 0, 0,
0.5, 0), Fr5 = c(0, 0.4, 0, 0, 1, 0), Fr6 = c(0, 0, 0, 0, 0.3,
0), Fr7 = c(0, 0, 0, 0.7, 0, 0), Fr8 = c(0, 0, 0, 1, 0, 0), Fr9 = c(0,
0, 0, 1, 0, 0), Fr10 = c(0, 0, 0, 0.65, 0, 0.7), Fr11 = c(0,
0, 0, 0.2, 0, 1), w = structure(c(2L, 2L, 1L, 1L, 1L, 1L), .Label = c("NO",
"YES"), class = "factor")), .Names = c("Fr1", "Fr2", "Fr3", "Fr4",
"Fr5", "Fr6", "Fr7", "Fr8", "Fr9", "Fr10", "Fr11", "w"), row.names = c("Mazda RX4",
"Mazda RX4 Wag", "Datsun 710", "Hornet 4 Drive", "Hornet Sportabout",
"Valiant"), class = "data.frame")
> dput(d)
structure(list(Fr1 = c(1, 0, 0, 0, 0, 0), Fr2 = c(0.7, 0, 0,
0, 0, 0), Fr3 = c(0.2, 0, 0, 0, 0, 0), Fr4 = c(0.1, 0, 0, 0,
0.5, 0), Fr5 = c(0, 0.1, 0, 0, 1, 0), Fr6 = c(0, 0, 0, 0, 0.3,
0), Fr7 = c(0, 0.8, 0, 0.7, 0, 0), Fr8 = c(0, 1, 0, 1, 0, 0),
Fr9 = c(0, 0.3, 0, 1, 0, 0), Fr10 = c(0, 0, 0, 0.65, 0, 0.7
), Fr11 = c(0, 0, 0, 0.2, 0, 1), w = structure(c(2L, 2L,
1L, 1L, 1L, 1L), .Label = c("NO", "YES"), class = "factor")), .Names = c("Fr1",
"Fr2", "Fr3", "Fr4", "Fr5", "Fr6", "Fr7", "Fr8", "Fr9", "Fr10",
"Fr11", "w"), row.names = c("Mazda RX4", "Mazda RX4 Wag", "Datsun 710",
"Hornet 4 Drive", "Hornet Sportabout", "Valiant"), class = "data.frame")
What these tables look like:
Fr1 Fr2 Fr3 Fr4 Fr5 Fr6 Fr7 Fr8 Fr9 Fr10 Fr11 w
Mazda RX4 0.2 0.7 1.00 0.1 0.0 0.0 0.0 0 0 0.00 0.0 YES
Mazda RX4 Wag 0.0 0.0 0.35 1.0 0.4 0.0 0.0 0 0 0.00 0.0 YES
Datsun 710 0.0 0.0 0.00 0.0 0.0 0.0 0.0 0 0 0.00 0.0 NO
Hornet 4 Drive 0.0 0.0 0.00 0.0 0.0 0.0 0.7 1 1 0.65 0.2 NO
Hornet Sportabout 0.0 0.0 0.00 0.5 1.0 0.3 0.0 0 0 0.00 0.0 NO
Valiant 0.0 0.0 0.00 0.0 0.0 0.0 0.0 0 0 0.70 1.0 NO
Fr1 Fr2 Fr3 Fr4 Fr5 Fr6 Fr7 Fr8 Fr9 Fr10 Fr11 w
Mazda RX4 1 0.7 0.2 0.1 0.0 0.0 0.0 0 0.0 0.00 0.0 YES
Mazda RX4 Wag 0 0.0 0.0 0.0 0.1 0.0 0.8 1 0.3 0.00 0.0 YES
Datsun 710 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 0.00 0.0 NO
Hornet 4 Drive 0 0.0 0.0 0.0 0.0 0.0 0.7 1 1.0 0.65 0.2 NO
Hornet Sportabout 0 0.0 0.0 0.5 1.0 0.3 0.0 0 0.0 0.00 0.0 NO
Valiant 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 0.70 1.0 NO
, matplot . - pdf matplot SAME GRAPH . 2 , , .
, :
