body<- appears to not preserve attributes set on functions. Sometimes I use attributes on functions, eg for memoization, etc. Here is a small test case:
f <- structure(function(x) x+1, foo='bar')
attributes(f)
$srcref
function(x) x+1
$foo
[1] "bar"
body(f) <- body(mean)
attributes(f)
NULL
I would expect changing the body to not affect the attributes at all.
body<-
appears to not preserve attributes set on functions. Sometimes I use attributes on functions, eg for memoization, etc. Here is a small test case:$srcref function(x) x+1
$foo [1] "bar"
NULL
I would expect changing the body to not affect the attributes at all.
METADATA