Re: [R] Decimal series how to make.........

From: Ted Harding <Ted.Harding_at_nessie.mcc.ac.uk>
Date: Wed 14 Jun 2006 - 19:06:07 EST


On 14-Jun-06 anil kumar rohilla wrote:
> Hi List,
> I am new to this Rsoftware, i want to make a sereis for example
> which is having values like this, s<- 0,0.1,0.2,0.3,0.4........,1
>
> i tryed this statement
> s<-0:0.1:1
> but this giving an error megssage.
> but by default increment 1 it is taking ,,,,,so what to do ,,
>
> i want to use this varible in for loop..
>
> like for(j in s)

As well as the use of 'seq' which other have suggested, a nice clean technique is

  s <- 0.1*(0:10)

which also is easier to type than

  s <- seq(0,1,by=0.1)

Best wishes,
Ted.



E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861
Date: 14-Jun-06                                       Time: 10:05:56
------------------------------ XFMail ------------------------------

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jun 14 19:12:26 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 15 Jun 2006 - 00:12:03 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.