[R] Changing Index Labelling on x axis

Ivan Calandra ivan.calandra at univ-reims.fr
Fri Jul 22 10:58:31 CEST 2016


Hi Nick,

If I understand you correctly, that should do it:
plot(x=seq_along(data)+2, y=data)

HTH,
Ivan

--
Ivan Calandra, PhD
Scientific Mediator
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calandra at univ-reims.fr
--
https://www.researchgate.net/profile/Ivan_Calandra
https://publons.com/author/705639/

Le 22/07/2016 à 10:47, WRAY NICHOLAS a écrit :
> Hi  I have a vector of data (for example c(2,3,4,5,4,3,2)
>
> data<-c(2,3,4,5,4,3,2)
> plot(data)
>
> I simply want to up the index values along the x axis by 2, so that instead of
> 1, I have 3, instead of 2 I have 4 etc etc.  Despite ages playing around with
> the axis function I can't get it to work, and keep getting weird error messages.
>   This is likely to be laughably simple but if someone can help me out I'd be
> grateful
>
> Thanks Nick W
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>



More information about the R-help mailing list