2014年10月21日星期二

R plot, tricky input of cex

In R plot,

For example:

plot(...... pch=20, cex=0.5)

Here, the 'cex' controls the size of the symbol. But if this value is passed in from another variable or from command line, it has to be converted to integer or numeric value (the numeric value is better).

For example:

my.cex.size = as.numeric(args[1])
plot(...... pch=20, cex=my.cex.size)

没有评论:

发表评论