I am using the ggparcoord() function of the GGally package in R to create a Parallel Coordinate Plot of the iris data (Present in R). I used the following code
ggparcoord(data=iris, columns=1:4 , groupColumn=5,alpha=I(0.3))+theme_light()+theme(legend.position="none")
.
Now I have calculated median of the four variables (Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) separately for the three species (setosa,versicolor,virginica) and using this information I have created a new data.
Here is the data (I have named the data as med)
|Sepal.Length| Sepal.Width |Petal.Length | Petal.Width | Species
-----------------------------------------------------------------
| 5 | 3.4 | 1.5 | 0.2 | 1
| 5.9 | 2.8 | 4.35 | 1.3 | 2
| 6.5 | 3 | 5.55 | 2 | 3
Here 1 denotes setosa, 2 denotes versicolor and 3 denotes virginica. Using this data I have again created a Parallel coordinate plot. The code is:
ggparcoord(data=med,columns=1:4, groupColumn=5)+theme_light()
.
I now wish to superimpose this plot over the previous plot. To do so I tried using
p<-ggparcoord(data=iris, columns=1:4 , groupColumn=5,alpha=I(0.3))
p+ggparcoord(data=med,columns=1:4, groupColumn=5)+theme_light()
.
But this gives me an error of the following type
"Error: Don't know how to add o to a plot".
Please help me resolve this problem.
Thank You in advance for taking out time to look at my question.
Souradeep