Hi,
>Could I edit their source code and regenerated a CummeRbund_v2 package
>instead?
If you want to do this kind of plot a lot, then I would suggest copying
the code for their MDSplot function and making your own copy, either with
the geom_text bit removed or with it's use parameterised.
In the meantime, I had a quick play and this may help.
# Create a data.frame to play with:
DF <- data.frame(x=1:10,y=1:10,l=letters[1:10],stringsAsFactors=FALSE)
# Create a simple ggplot object with text labelling:
zz<-ggplot(DF)+geom_point(aes(x=x,y=y))+geom_text(aes(x=x,y=y,label=l),nudg
e_x=0.2)
Then I took a look at zz:
> length(zz)
[1] 9
> names(zz)
[1] "data" "layers" "scales" "mapping" "theme"
"coordinates"
[7] "facet" "plot_env" "labels"
> zz$layers
[[1]]
mapping: x = x, y = y
geom_point: na.rm = FALSE
stat_identity: na.rm = FALSE
position_identity
[[2]]
mapping: x = x, y = y, label = l
geom_text: parse = FALSE, check_overlap = FALSE, na.rm = FALSE
stat_identity: na.rm = FALSE
position_nudge
So zz$layers[2] appears to define the geom_text call (in my case, I guess
it may differ depending the order of creating layers in MDSplot).
#Then I created a copy of zz
zz2<-zz
# and removed that layer
zz2$layers[2] <- NULL
And zz2 now has my plot without labelled points.
I hope this is of some use in fixing up this plot. As you pointed out a
personalised MDSplot would be the better long term solution (but I
wouldn't go so far as creating a whole new cummeRbund_v2 package for it -
maybe you could maybe suggest additional options to control the plotting
to the package authors).
Regards,
Ron.