[R] Simple question about symbols()

David Winsemius dwinsemius at comcast.net
Wed Apr 20 16:18:38 CEST 2011


On Apr 20, 2011, at 8:45 AM, murilofm wrote:

> The link to the csv file is
>
> http://www.filedropper.com/data_5
>
> I use the "d" variable to create the radius:
>
> radius <- sqrt( inv$d/ pi )
>
> and i tried
>
> symbols(inv$a, inv$b, circles=radius, inches=0.35, fg="white",
>   bg="red", xlab="aa", ylab="bb",
>   col=c("blue","red")[inv$c+1])

You should follow the Posting Guide's advice and offer the full code  
you used to read in that data. It's _not_ comma separated, and for  
some reason even using read.csv2 to properly read a semi-colon  
separated file, I also needed to to convert the first two variables  
from factor to numeric  ... please also read the FAQ item on this topic.

Once that was done this "works", since col is _not_ the proper  
argument for coloring with that function:

?symbols

plot.new()
  symbols(inv$a, inv$b, circles=radius, inches=0.35,
          bg=c("blue","red")[inv$c+1])

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list