I'm trying to draw a plot in ggplot (geom_point), and I am able to draw it, but I would like to manipulate the appearance of a specific symbol based on some variables.
I would like to rotate the symbol (pch = 22) by an angle defined by a data.frame. Pch = 22 looks like a rectangle. Additionally I would like to change the width of the rectagle, also according to the value defined in a dataframe.
Here is some sample data:
plotdata <- data.frame(x=c(4,6,7,10),
y=c(5,6,8,9), angle=c(pi/3, 2*pi/3, pi, pi/6),
widthparameter = c(2, 3, 5, 7))
Basically, I want the width to change in a way that is proportion to a the width parameter. So in this example data, the width will change in proportion to the range 2-7. For example, if the width could be 1mm for the value of "widthparameter" 2, and the width could be 3mm for the value of "widthparameter" 7. So "widthparameter" of 3 and 5 will be proportionally somewhere between 2mm and 3 mm.
I'm new to R so manipulating symbols like this in ggplot seems to me like an impossibly difficult task.
Please help,