[R] plotting the following data

jim holtman jholtman at gmail.com
Fri May 21 18:27:14 CEST 2010


Not exactly sure what you mean by "equally spaced";  here is one way:

> x <- read.table(textConnection("time    f
+ 0h    0.00
+ 0.5h    0.54
+ 1h    1.15
+ 2h    2.33
+ 4h    1.57
+ 6h    2.19
+ 18h    1.45
+ 24h    1.79"), header=TRUE, as.is=TRUE)
>
> plot(x$f, xaxt='n')
> axis(1, at=1:8, labels=x$time)


On Fri, May 21, 2010 at 12:15 PM, ANJAN PURKAYASTHA
<anjan.purkayastha at gmail.com> wrote:
> Hi,
> I need to plot $time on the x-axis and $f on the y-axis for the following
> data:
> time    f
> 0h    0.00
> 0.5h    0.54
> 1h    1.15
> 2h    2.33
> 4h    1.57
> 6h    2.19
> 18h    1.45
> 24h    1.79
> I want the order of the data-points to be retained and the x-coordinates of
> each of the 8 data-points to be equally spaced.
> however, using plot($time, $f) completely scrambles the ordering of the
> points.
> Any pointers to this newbie on how to plot these data points accurately will
> be much appreciated.
> Thanks,
> Anjan
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list