Hello Tal! Nothing showed up when I used those commands! The plot still shows dots with no labels! Thanks
On Sun, Jul 26, 2009 at 7:28 AM, Tal Galili <tal.gal...@gmail.com> wrote: > Hi Khaled, > Did my answer help ? > > > > > On Sun, Jul 26, 2009 at 12:15 AM, Khaled OUANES <koua...@gmail.com> wrote: > >> Thanks for the answer Tal! >> But I can't get it to work correctly! :( >> Please bear with me this is the first time I am using R! and I am in a >> rush >> to correct a paper >> in fact on the plane I am plotting a table >> > fullpointed=read.table("fullpoints_backup.txt",h=F) >> > plot(range(-2.5,0.95),range(0.00,1.00),type="n",axes=TRUE) >> and in this table there are 300 points >> I want to label the first 175 points with A and the others with S >> I couldn't figure how to configure correctly labels.to.plot <- >> sample(c("A","B"), 100, replace = T) and text(x, y , labels = >> labels.to.plot) ? >> >> for instance: >> 0,48875 0,142857143 > the point plotted will be labelled a >> 0,409 0,142857143 > the point plotted will be labelled a >> 0,45611 0,25 > labelled a >> 0,49833 0,222222222 > labelled a >> #the first 175 >> >> 0,61158 0,125 > labelled S >> 0,5709 0,125 > labelled S >> 0,53266 0,125 > labelled S >> >> # the remaining >> Regards >> >> >> >> >> On Sat, Jul 25, 2009 at 5:32 PM, Tal Galili <tal.gal...@gmail.com> wrote: >> >> > Sure, >> > >> > Here is an example: >> > >> > # get some random data to play with >> > x <- runif(100) >> > y <- runif(100) >> > labels.to.plot <- sample(c("A","B"), 100, replace = T) >> > >> > # set up the window, play them one by one to see what they do >> > plot.window(ylim = c(0,1), xlim = c(0,1)) >> > plot.new() >> > axis(1) >> > axis(2) >> > box() >> > >> > # plot the things you wished to plot, where you wanted them plotted >> > text(x, y , labels = labels.to.plot) >> > >> > >> > >> > Cheers, >> > Tal >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > On Sat, Jul 25, 2009 at 7:20 PM, Khaled OUANES <koua...@gmail.com> >> wrote: >> > >> >> hey >> >> thanks for the answer but I couldn't achieve it? would you explain a >> bit >> >> more? >> >> I have like 300 points to label! >> >> thanks >> >> >> > >> > >> > >> > -- >> > ---------------------------------------------- >> > >> > >> > My contact information: >> > Tal Galili >> > Phone number: 972-50-3373767 >> > FaceBook: Tal Galili >> > My Blogs: >> > http://www.r-statistics.com/ >> > http://www.talgalili.com >> > http://www.biostatistics.co.il >> > >> > >> > >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > > > -- > ---------------------------------------------- > > > My contact information: > Tal Galili > Phone number: 972-50-3373767 > FaceBook: Tal Galili > My Blogs: > http://www.r-statistics.com/ > http://www.talgalili.com > http://www.biostatistics.co.il > > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.