I’ve made some researches on how to display graph using R, but I really don’t find any answer to my problem.
I have this matrix representing cars and a vector representing the relation between groups and the different points (individuals) of this matrix. Let’s say:
cars # 2d dimension matrix
categories # vector of correspondance between cars and group
The value at index [i] of the “categories” vector represent the category number (of the i em car in the matrix).
What i do want to do, is display a graph (dotchart) which display all these cars sorted by colors corresponding to their actual category.
Let’s say we have 5 categories and these 5 colors :
colors <- c("white","gray","yellow","orange","red")
Is there any one who can help me out ?
Thanks!
I assume that your cars variable has two columns (say, an X and a Y), and that you want to plot their relationship.
In that case, this is simple if you use the plot function:
For example, you could generate and plot some random data like this: