RobinHankin / mvp

https://robinhankin.github.io/mvp/
8 stars 3 forks source link

bug in subsy() #21

Closed RobinHankin closed 5 years ago

RobinHankin commented 5 years ago

If one of the arguments to subsy() is a vector of length greater than 1, it does not substitute as expected:

> P <- as.mvp("a^2+a*b+b^4")
> P
mvp object algebraically equal to
a b  +  a^2  +  b^4
> subsy(P,a=1,b=2)  # works
[1] 19
> subsy(P,a=1)   # works
mvp object algebraically equal to
1  +  b  +  b^4
> subsy(P,a=1:2,b=1:2) # fails
mvp object algebraically equal to
a b  +  a^2  +  b^4
> 
RobinHankin commented 5 years ago

fixed in c6ec8994d55f7a2b9939db7292ad0d37230ae9e6 by the implementation of subvec().