[R] Decimal series how to make.........
Gabor Grothendieck
ggrothendieck at gmail.com
Wed Jun 14 13:55:38 CEST 2006
On 6/14/06, Ted Harding <Ted.Harding at nessie.mcc.ac.uk> wrote:
> 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)
>
or 0:10/10 which is even easier to type although perhaps not as clear.
More information about the R-help
mailing list