ColonColon: Like R function ' : ' but can be applied to vectors.

Description Usage Arguments Value Author(s) Examples

Description

x%::%y is similar to x:y, except x and y are allowed to be vectors.

Usage

1
x %::% y

Arguments

x

numeric vector.

y

numeric vector.

Value

A numeric vector of the form

c(x[1]:y[1], x[2]:y[2], ...).

If x and y have lengths nx and ny, then x and y are recycled until

x[nx]:y[ny]

is performed.

Author(s)

Aaron Hayman

Examples

1
2
3
4
5
6
7
8
  1%::%c(8,7)
  c(1:8,1:7) # are both equal

  c(0,1)%::%c(4,7)
  c(0:4,1:7) # are both equal

  c(0,1)%:%c(5,4,-3)
  c(0:5,1:4,0:-3,1:5,0:4,1:-3) # are both equal

jgrevel/BAST1-R-Library documentation built on May 21, 2019, 10:11 a.m.