[R] Fwd: how to modify the tickment of x-axis

John Kane jrkrideau at inbox.com
Sat Mar 17 20:27:12 CET 2012


dput() is a way to print out your data in a covenient format for others to read it into an R session.  It has nothing to do with graphing. 

You use the command dput(myfile) to output a data object  or perhaps dput(head(myfile, 10) to output a subset of your file.

Copy and paste into your email and people on the R-help list then can see what your data looks like.  It makes solving problems much easier.

Here is one from a simple data set I use for experimenting.  ( I added the " mat1 <- " to read it into an r matrix.

mat1 <- structure(c(1, 1, 6, 1, 1, NA, 1, 2, 3, 4, 5, 6, 3, 5, 3, 6,
4, 0, 2, 4, 6, 8, 10, 12, NA, 9, 9, 8, 9, 8, 1, 2, 3, 4, 5, 6,
12, 42, NA, 45, 32, 54, 13, 15, 17, 19, 21, 23), .Dim = c(6L,
8L), .Dimnames = list(NULL, c("cata", "catb", "doga", "dogb",
"rata", "ratb", "bata", "batb")))



John Kane
Kingston ON Canada


> -----Original Message-----
> From: totangjie at gmail.com
> Sent: Sat, 17 Mar 2012 22:17:55 +0800
> To: r-help at r-project.org
> Subject: [R] Fwd: how to modify the tickment of x-axis
> 
> hi
>  I plot a series of observation data every minutes in a day as the
> attachment below
> 
> plot(wnd,type='l',lty=1,col='red',lwd=1,xlab=xxlab,ylab=yylab,ylim=YY)
> In the figure, the x-axis tickment is the number of data   How can I
> change
> it
> fore example 1h 2h 3h 4h and so on ?
> someone has told me that use dput but it seems useless.
> 
> Can anyone tell me how to use axis or at ?thank you .
I believe others have already done this.

Good luck

____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!



More information about the R-help mailing list