8 messages
Open this post in threaded view
|

 I'm new to R and i'm having some trouble with a bubble chart. Basically I have 3 series (a,b,c), but the third one is a binnary variable (assumes only 0 or 1 to the entire data). How can I use these binnary information to make 2 different colours in a bubble chart?. I.e., I'm using this code: symbols(inv\$a, inv\$b, circles=radius, inches=0.35, fg="white", bg="red", xlab="aa", ylab="bb", add=TRUE) and i want the bg color to be red if c=1 and blue if c=0. thanks, Murilo
Open this post in threaded view
|

## Re: Simple question about symbols()

 murilofm gmail.com> writes: > > I'm new to R and i'm having some trouble with a bubble chart. > Basically I have 3 series (a,b,c), but the third one is a binnary variable > (assumes only 0 or 1 to the entire data). > How can I use these binnary information to make 2 different colours in a > bubble chart?. I.e., I'm using this code: >   Probably: symbols(inv\$a, inv\$b, circles=radius, inches=0.35, fg="white",    bg="red", xlab="aa", ylab="bb", add=TRUE,    col=c("blue","red")[inv\$c+1]) ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Simple question about symbols()

 Thanks for the answer; I see that col=c("blue","red")[inv\$c+1] creates a vector of "red" and "blue" associated with the binnary c. But still I got everything red.
Open this post in threaded view
|

## Re: Simple question about symbols()

 On Apr 19, 2011, at 10:51 PM, murilofm wrote: > Thanks for the answer; I see that col=c("blue","red")[inv\$c+1]   > creates a > vector of "red" and "blue" associated with the binnary c. > But still I got everything red. If you want tested solution, submit test data. > > -- > View this message in context: http://r.789695.n4.nabble.com/Simple-question-about-symbols-tp3461676p3462013.html> Sent from the R help mailing list archive at Nabble.com. -- David Winsemius, MD West Hartford, CT ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Simple question about symbols()

 The link to the csv file is http://www.filedropper.com/data_5I 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]) Thanks for the help.
Open this post in threaded view
|

## Re: Simple question about symbols()

 In reply to this post by David Winsemius David Winsemius comcast.net> writes: > > > On Apr 19, 2011, at 10:51 PM, murilofm wrote: > > > Thanks for the answer; I see that col=c("blue","red")[inv\$c+1]   > > creates a > > vector of "red" and "blue" associated with the binnary c. > > But still I got everything red. > > If you want tested solution, submit test data. >   David also suggests (off-lists) that you use "bg" instead of "col" as the argument name.  (Another strategy is to go to ?symbols and search for "colour" -- I wouldn't expect a new user to guess the c("blue","red")[inv\$c+1] stuff, but you probably could go to the help page and figure out that the appropriate argument name is "bg" ...) ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.