| broadcaster | R Documentation | 
broadcaster() checks if an array has the "broadcaster" attribute. 
broadcaster()<- sets or un-sets the class attribute "broadcaster" on an array. 
The broadcaster class attribute exists purely to overload the
arithmetic, Boolean, bit-wise, and relational infix operators,
to support broadcasting. 
This makes mathematical expressions with multiple variables,
where precedence may be important,
far more convenient. 
Like in the following calculation: 
x / (y + z) 
See broadcast_operators for more information. 
broadcaster(x)
broadcaster(x) <- value
x | 
 object to check or set.   | 
value | 
 set to   | 
For broadcaster(): 
TRUE if an array or vector is a broadcaster, or FALSE if it is not. 
For broadcaster()<-: 
Returns nothing,
but sets (if right hand side is TRUE)
or removes (if right hand side is FALSE)
the "broadcaster" class attribute. 
 
# maths ====
x <- 1:10
broadcaster(x) <- TRUE
y <- 1:10
broadcaster(y) <- TRUE
x + y / x
x + 1 # mathematically equivalent to the above, since x == y
(x + y) / x
2 * x/x # mathematically equivalent to the above, since x == y
dim(x) <- c(10, 1)
dim(y) <- c(1, 10)
x + y / x
(x + y) / x
(x + y) * x
# relational operators ====
x <- 1:10
y <- array(1:10, c(1, 10))
broadcaster(x) <- TRUE
broadcaster(y) <- TRUE
x == y
x != y
x < y
x > y
x <= y
x >= y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.