Closed RobinHankin closed 1 month ago
Functionality now in place as per 3597866:
library("spray")
#>
#> Attaching package: 'spray'
#> The following objects are masked from 'package:base':
#>
#> pmax, pmin
(jj <- spray(diag(5),1:5))
#> val
#> 0 0 0 0 1 = 5
#> 0 0 0 1 0 = 4
#> 0 0 1 0 0 = 3
#> 0 1 0 0 0 = 2
#> 1 0 0 0 0 = 1
subs(jj,1:5,1:5)
#> [1] 55
subs(jj,1:5,1:5,drop=TRUE)
#> [1] 55
subs(jj,1:5,1:5,drop=FALSE)
#> val
#> = 55
The substitution gives a constant polynomial and one might wish to reduce this to a double. And passing
subs()
ought to do this, but doesn't.