First of all that's my data:
structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 3.9,
6.4, 7.4, 8.1, 9, 9.4, 7.8, 12.8, 14.8, 16.2, 18, 18.8), .Dim = c(6L,
22L), .Dimnames = list(c("Merc", "Peug", "Fera", "Fiat", "Opel",
"Volv"), c("10", "33.95", "58.66",
"84.42", "110.21", "134.16", "164.69", "199.1", "234.35", "257.19",
"361.84", "432.74", "506.34", "581.46", "651.71", "732.59", "817.56",
"896.24", "971.77", "1038.91", "Reduction", "Price")))
To explain easier what I would like to achieve I will show the matrix:
> head(data)
10 33.95 58.66 84.42 110.21 134.16 164.69 199.1 234.35 257.19 361.84 432.74 506.34 581.46 651.71 732.59 817.56 896.24 971.77 1038.91 Reduction Price
Merc 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 3.9 7.8
Peug 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 6.4 12.8
Fera 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 7.4 14.8
Fiat 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 8.1 16.2
Opel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9.0 18.0
Volv 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 9.4 18.8
As you see all of the rows have just two types of numbers (0 and 1). Sometimes it can be more than 1 in each row. On the xaxis
I would like to put the numbers from Reduction
column and for yaxis
the column names should be used. Both axis should be scaled from 0 to 1200.
Now the tricky part. I would like to put on the graph the values from the rows where you can find number 1. If there is more than one 1 in each row, there should be more than one dot on the graph.