[R] problems with plot.data.frame

Monica Pisica pisicandru at hotmail.com
Thu Aug 31 19:57:18 CEST 2006


Hi again,

OK i came up with this after i got few good sugegstions.

First my data.frame actually looks like that (Thanks for clarifications to 
Prof. Brian Ripley)

   V1 V2 V3 V4
1  jan  3  1   7
2  mar 2  4  2
3  may 1  3  2
4  jul   3  7  4
5  sep  5  2  3
6  nov  3  1  5

What i want: 1. On x axis i want the ticks with labels column V1 in that 
order and not alpha order.
2. i want points to represent the data, not horizoltal bars as a box-plot 
with only one value as it will plot if i use plot.data.frame

Note. In my table i already have the order i want, but if i wouldn't have it 
prof. Ripley's sugegstion is very welcome.

What i've done in the end:

>plot (mydata$V3, xlab="month")
>axis (side=1, at=c(1:6), labels=c(1:6), ticks=TRUE, col.axis="white")
>month.label <- as.character(mydata[[1]])
>axis(side=1, at=c(1:6), labels = month.label, ticks=TRUE)

This is not an elegant solution but i get the graph i wanted. If anybody has 
a better solution certainly i would like to see it.

thanks you again for all your help,

Monica



More information about the R-help mailing list