oldvar <- ndvar()
oldunc <- ndunc()
ndvar(30)
ndunc(20)
## Given
x0 <- mcdata(3, type="0")
xV <- mcdata(1:ndvar(), type="V")
xU <- mcdata(1:ndunc(), type="U")
xVU <- mcdata(1:(ndunc()*ndvar()), type="VU")
x0M <- mcdata(c(5, 10), type="0", nvariates=2)
xVM <- mcdata(1:(2*ndvar()), type="V", nvariates=2)
xUM <- mcdata(1:(2*ndunc()), type="U", nvariates=2)
xVUM <- mcdata(1:(2*(ndunc()*ndvar())), type="VU", nvariates=2)
## All possible combinations
## "0"
-x0
x0 + 3
## "V"
-xV
3 + xV
xV * (1:ndvar())
xV * x0
xV - xV
## "U"
-xU
xU + 3
(1:ndunc()) * xU
xU * x0
xU - xU
## Watch out the resulting type
xV + xU
xU + xV
## "VU"
-xVU
3 + xVU
(1:(ndunc()*ndvar())) * xVU
xVU + xV
x0 + xVU
xU + xVU
xVU - xVU
## Some Multivariates
x0M+3
xVM * (1:ndvar())
xVM - xV
xUM - xU
xVUM - xU
Run the code above in your browser using DataLab