Hi all R users I would like to know how acess the coordinates of the ECDF object. I look for the example, in this part: ###################### print(ls.Fn12 <- ls(env= environment(Fn12))) ###################### but I do not know to extract the Y coordinate and put it in other variable. My objective is to make a plot and identify the points with labels. ############# Example by ?ecdf y <- round(rnorm(12),1); y[3] <- y[1] Fn12 <- ecdf(y) Fn12 print(knots(Fn12), dig=2) 12*Fn12(knots(Fn12)) ## ~= 1:12 if there were no ties summary(Fn12) summary.stepfun(Fn12) print(ls.Fn12 <- ls(env= environment(Fn12))) ##[1] "f" "method" "n" "x" "y" "yleft" "yright" ############# Example by ?ecdf My objetive seems to this: plot(Fn12) identify( x = knots(Fn12), y = ??????????, labels="my string set") or text... thanks in advanced klebyn
Hi, try environment(Fn12)$y environment(Fn12)$x Nolwenn ************************************** Nolwenn Le Meur, PhD Fred Hutchinson Cancer Research Center Computational Biology 1100 Fairview Ave. N., M2-B876 P.O. Box 19024 Seattle, WA 98109-1024 On Tue, 1 Nov 2005, klebyn wrote:> > > Hi all R users > > > I would like to know how acess the coordinates > of the ECDF object. > > I look for the example, > in this part: > ###################### > print(ls.Fn12 <- ls(env= environment(Fn12))) > ###################### > > but I do not know to extract > the Y coordinate and put it in other variable. > > My objective is to make a plot > and identify the points with labels. > > > ############# Example by ?ecdf > > y <- round(rnorm(12),1); y[3] <- y[1] > Fn12 <- ecdf(y) > Fn12 > print(knots(Fn12), dig=2) > 12*Fn12(knots(Fn12)) ## ~= 1:12 if there were no ties > > summary(Fn12) > summary.stepfun(Fn12) > > print(ls.Fn12 <- ls(env= environment(Fn12))) > ##[1] "f" "method" "n" "x" "y" "yleft" "yright" > > ############# Example by ?ecdf > > > My objetive seems to this: > > plot(Fn12) > identify( x = knots(Fn12), y = ??????????, labels="my string set") > > or text... > > > thanks in advanced > > klebyn > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
If you wish to apply labels to identified points: I am sure there is a better way, but what I have done is use locator(n) #n is how many points you wish to identify. Then click on the points. The coordinates of each point are returned. Then I use identify(x, y, labels = My Label) ...for each point identified. It would be great if you could click on the points and have them identified & labelled, but I'm not sure how to do it. -----Original Message----- From: klebyn [mailto:klebyn at yahoo.com.br] Sent: Wednesday, 2 November 2005 12:25 PM To: r-help at stat.math.ethz.ch Subject: [R] help with the coordinates of the ECDF object Hi all R users I would like to know how acess the coordinates of the ECDF object. I look for the example, in this part: ###################### print(ls.Fn12 <- ls(env= environment(Fn12))) ###################### but I do not know to extract the Y coordinate and put it in other variable. My objective is to make a plot and identify the points with labels. ############# Example by ?ecdf y <- round(rnorm(12),1); y[3] <- y[1] Fn12 <- ecdf(y) Fn12 print(knots(Fn12), dig=2) 12*Fn12(knots(Fn12)) ## ~= 1:12 if there were no ties summary(Fn12) summary.stepfun(Fn12) print(ls.Fn12 <- ls(env= environment(Fn12))) ##[1] "f" "method" "n" "x" "y" "yleft" "yright" ############# Example by ?ecdf My objetive seems to this: plot(Fn12) identify( x = knots(Fn12), y = ??????????, labels="my string set") or text... thanks in advanced klebyn ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html