[Rd] makepredictcall
Therneau, Terry M., Ph.D.
therne@u @end|ng |rom m@yo@edu
Sat Aug 13 13:20:28 CEST 2022
I'm trying to better understand makepredictcall. The method for ns() starts with the
following very cryptic comment and line of code:
## check must work correctly when call is a symbol, both for quote(ns) and quote(t1):
if(as.character(call)[1L] == "ns" || (is.call(call) && identical(eval(call[[1L]]),
ns))) {
The phrase "t1" appears no where else in the src/library/splines/R, and there is nothing
relevant in stats/R either (t1 gets used as a temp variable in 2 subfunctions).
So, what is the purpose of this line of code?
I can see that if a user typed zed <- ns, then used 'zed' in their call, that the right
hand clause would then be true but not the left; but why worry about that case?
Terry T.
PS (The help file isn't very helpful for creating such a method BTW. It tells why you
should make one, and what happens if you get it right, but nothing on how.)
--
Terry M Therneau, PhD
Department of Quantitative Health Sciences
Mayo Clinic
therneau using mayo.edu
"TERR-ree THUR-noh"
[[alternative HTML version deleted]]
More information about the R-devel
mailing list