install_github("mbertalan/iPsychCNV")
library(iPsychCNV)
# CNV.Res and roi are loaded from the package.
PlotAllCNVs(df=CNV.Res, Name="Test.png", roi=roi)
Error: Don't know how to add o to a plot
To solve the problem you need to remove the dataframe from ggplot.
Passing the dataframe in ggplot seems to create a layer. Then it can not add to the plot (in the package). However, it works if the plot is geom_point (I tested it).
b <- ggplot(tmp2, aes(Start, Indx))
b <- b + geom_segment(aes(x = Start, y = Indx, xend = Stop, yend = Indx, colour=as.factor(Class)))
Error: Don't know how to add o to a plot
If you add the dataframe in geom_segment it works:
b <- ggplot() + geom_segment(data=tmp2, aes(x = Start, y = Indx, xend = Stop, yend = Indx, colour=as.factor(Class)))
For some reason, inside the package, it can not overwrite the layer. Then gives you the error:
Error: Don't know how to add o to a plot