Dear R-users, Suppose I have the following x-y coordinates which give the boundaries of a polygon: > x <- c(5,4,5,9,6,6,4,7,10,7,10,4,10) > y <- c(6,3,2,6,3,7,5,4,4,7, 5,4, 6)
I would like to plot the following graph: > plot(x,y) > ord <- c(7,12,2,3,5,8,9,11,13,4,10,6,1) > polygon(x[ord],y[ord]) How I can obtain the above ordering (in the example an anti-clockwise ordering) such that I can use polygon() to connect the points? I searched previous messages but I did not find any relevant to this problem. Thanks, Luca +-----------------------------------------------------------------------+ | Dr. Luca Scrucca | | Dipartimento di Scienze Statistiche tel. +39 - 075 - 5855278 | | Universit� degli Studi di Perugia fax. +39 - 075 - 5855950 | | Via Pascoli - C.P. 1315 Succ. 1 | | 06100 PERUGIA (ITALY) | | (o_ (o_ (o_ | | E-mail: [EMAIL PROTECTED] //\ //\ //\ | | Web page: http://www.stat.unipg.it/luca V_/_ V_/_ V_/_ | +-----------------------------------------------------------------------+ ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
