Skip to content
Prev 70591 / 398525 Next

"text"-function: adding text in an x,y-plot

Helmut Kudrnovsky wrote:

            
I think points should be a matrix rather than a list or data.frame, 
hence the code above won't work. Instead:


  plot(points[,"PC1"], points[,"PC2"], type="n")
Hmm, what is pca ???


  lab <- rownames(points)
  text(points[,"PC1"], points[,"PC2"], labels=lab)

works for me.
Quite probably you lab was a *factor* ...
We cannot say what you did wrong when constructing your plot, but we 
know that your descibtion above is wrong, because it does not even work 
to generate the empty plot the way ...

Please read the posting guide and rethink at least one time whether the 
code you are giving us is reproducible. Your code was not.

Uwe Ligges