Closed RobinHankin closed 3 months ago
Also:
suppressMessages(library("clifford"))
x <- 5 + 6*e(1) - 7*e(1:3)
x
#> Element of a Clifford algebra, equal to
#> + 5 + 6e_1 - 7e_123
getcoeffs(x,1)
#> [1] 6
getcoeffs(x,0)
#> [1] 0
The second call to getcoeffs()
is seriously unexpected: I was trying to get 5
(which would indeed be returned by x[0]
). Actually, direct use of getcoeffs()
to find the constant is awkward: you need to use getcoeffs(x,list(numeric(0)))
to get the 5
.
In any event, none of this is documented at ?Extract.clifford
.
Above,
x[0]
works as expected butx[0,drop=TRUE]
gives an unexpected result (here I wanted5
).