[R] vector subtraction

R. Michael Weylandt michael.weylandt at gmail.com
Fri Apr 20 12:48:14 CEST 2012


You're thinking about it wrong. This is an arithmetic sequence:

seq(from = 1000, by = -30, length.out = 15)

Michael



On Fri, Apr 20, 2012 at 5:14 AM, uday <uday_143_4u at hotmail.com> wrote:
> I would like to calculate vector from existing  value
> e.g
> v       <- 1000
> s       <- 30
> d1    <- v-s
>                   d1    <- 970
> d2    <- d1 -s
>                   d2    <- 940
> d 3   <- d2-s
>                   d3    <- 910
> :
> :
> d15   <- .....
>
> so how I should get vector of length 15         d < -  970,940 , 910 ,
> .......
>
> --
> View this message in context: http://r.789695.n4.nabble.com/vector-subtraction-tp4573299p4573299.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.



More information about the R-help mailing list