[R] substr not by position but by symbol

2012-05-07 Thread YN Kim
Hi all, One of my variables looks like this: .7_-.3_-.2_.9 And this is a character variable. I made this by combining four different number like .7, -.3, -.2, and .9 using paste function. Now, I want to go back to original format from this one combined character variable. For instance, I want to

[R] What are the color's name in heat.color(5)

2012-03-28 Thread YN Kim
Hi all, I'm trying to using heat.color function in my data visualization. So, when I set col = heat.color(5), five different colors are displayed from red to weak yellow. But, now I want to know the color's keys or the names of the displayed heat.color. For instance, I think one of the five displ

[R] is there a command to withdraw already performed command in R?

2012-02-17 Thread YN Kim
Hi all, Is there any command or function to withdraw a command performed already in R? For instance, after drawing a line in existing plot, can I remove the line in the plot? I know I can use a way of overlapping on the former line so that it looks like a removing the line, but I'm wondering ther

[R] Adding Legend about two quantile lines at ggplot

2010-10-19 Thread YN Kim
Hi, all. I'd like to add legend on my graph but I can't. My code is follows. library(ggplot2) score1<-rnorm(100,0,5) score2<-rnorm(400,10,15) mydata<-data.frame(score1,score2) ggplot(mydata,aes(y=score2,x=score1))+geom_point()+stat_quantile(quantiles=c(0.50),col="red")+stat_quantile(quantiles=c(0