[OGRUG] R plot() Line numbers?

Tyler Smith tyler.smith at mail.mcgill.ca
Wed Apr 25 15:02:42 CEST 2012


To plot the row numbers instead of the symbols, you can also do this:

plot(ick, type = 'n')
text(ick, labels = 1:nrow(ick))

On Mon, Apr 23, 2012 at 9:14 PM, David Gattrell
<david.gattrell at gmail.com> wrote:
> You can use the text() command to place labels next to each symbol...
>
> silly example:
>> ick=c(1:5,2:6)
>> ick=matrix(ick,5,2)
>> ick
>     [,1] [,2]
> [1,]    1    2
> [2,]    2    3
> [3,]    3    4
> [4,]    4    5
> [5,]    5    6
>> plot(ick)
>> text(ick[,1],ick[,2],ick[,2],pos=4,col="blue",offset=0.45)
>> text(ick[,1],ick[,2],ick[,1],pos=3,col="blue",offset=0.45)
>>
>
>
> On Mon, Apr 23, 2012 at 1:14 PM, Helder Mendes <hmendes.lx at gmail.com> wrote:
>
>> Hi all,
>>
>> I'm new in R and in this list and I need help on the plot() function.
>>
>> Is there any way that in the following command in R:
>>
>> > plot(Matrix)
>>
>> (Matrix with dim = nx2)
>>
>> The graphic has the Matrix line number instead of the symbol "o"?
>> Alternativelly how can I label, so that the line number appears next
>> to the symbol?
>>
>>
>> Thanks for any help.
>> LX
>>
>> _______________________________________________
>> R-UG-Ottawa mailing list
>> R-UG-Ottawa at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-ug-ottawa
>>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-UG-Ottawa mailing list
> R-UG-Ottawa at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-ug-ottawa



More information about the R-UG-Ottawa mailing list