Re: [R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
Great, that's a good starting point. Andrew On Thu, Jul 9, 2009 at 11:20 AM, Jorge Ivan Velez wrote: > > Hi Andrew, > If I understand correctly, then > > # Data > x <- c(3,4,2) > > # Collection of text and symbols > Text <- c('foo', 'abcd', 'John') > PCH <- c('+','O','$') > > # Plotting > plot(x,

Re: [R] treating a data symbol like a character

2009-07-09 Thread Jorge Ivan Velez
Hi Andrew, If I understand correctly, then # Data x <- c(3,4,2) # Collection of text and symbols Text <- c('foo', 'abcd', 'John') PCH <- c('+','O','$') # Plotting plot(x, pch = PCH) legend('topright', pch = PCH, Text, ncol = 3) should be close to what you want. Note that the text() / points() c

Re: [R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
Thanks for your help. I should have been more clear in my initial e-mail. I shouldn't have used 'alpha' or 'beta,' to avoid confusion with them as Greek symbols. I should have stated something like: O foo O abcd O John While I'm familiar with using legend to make the filled boxes, I'm intereste

Re: [R] treating a data symbol like a character

2009-07-09 Thread Jorge Ivan Velez
Hi Andrew, Do you want to put the symbols you described as a legend in a plot? If so, here is one way: x <- rnorm(3) plot(x, pch = 16, cex = 1.1, col = 1:3) legend('topleft', ncol = 3, c(expression(alpha), expression(beta), expression(gamma)), pch = 16, cex = 1.1, col = 1:3) Is you do no

[R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
Hi, is there a way to treat a data symbol, e.g. one with pch = 16, as a character? Specifically, I'm interested in creating a line of text as follows using the text() function O alpha O beta O gamma where the "O" is pch 16 and filled with a specific color. Not sure if this is possible or not. T