textplot2: textplot2 - An x y plot of non-overlapping text

Description Usage Arguments Value Examples

Description

This function is an extension of the 'textplot' function from the 'wordcloud' package, with the extra functionality of specifiying the color of the points

Usage

1
2
textplot2(x, y, words, cex = 1, pch = 16, pointcolor = "#FFFFFF00",
  new = TRUE, show.lines = TRUE, ...)

Arguments

x

x coordinates

y

y coordinates

words

the text to plot

cex

font size

pch

pch parameter for the plotted points

pointcolor

a string specifying the color of the points (default #FFFFFF00)

new

should a new plot be created

show.lines

if true, then lines are plotted between x,y and the word, for those words not covering their x,y coordinates

...

Additional parameters to be passed to wordlayout and text.

Value

nothing

Examples

1
2
3
4
5
6
obj_names<-apply(expand.grid(LETTERS,LETTERS),1,paste,collapse='')
a<-setNames(runif(26*26),obj_names)
b<-setNames(rnorm(26*26),obj_names)
plot(a,b,pch=20,col='grey')
top<-names(sort(-a))[1:50]
textplot2(a[top],b[top],words=top,new=FALSE,pointcolor='black')

federicogiorgi/vulcan documentation built on May 27, 2019, 7:25 a.m.