[R] plotting with varying dot sizes

servet ahmet çizmeli sa.cizmeli at usherbrooke.ca
Fri Dec 11 15:44:32 CET 2009


I think I located the problem. the data frame associated with my spatial object
(Insitu_sp) contains some NAs. And in this case, the function plot does not
like NAs. It simply behaved strangely. The code below did the trick :

idx = is.na(Insitu[,"SPM"])
ptsize = 0.35*(sqrt(Insitu[!idx,"SPM"])+1)
plot(Insitu_sp[!idx,"SPM"],col="red",pch=19,cex=ptsize)

Does the symbols function supports spatial (sp) objects? I could not manage to
make it work with my sp data.



Quoting Greg Snow <Greg.Snow at imail.org>:

> The symbols function may work better than plot for this situation.




More information about the R-help mailing list