I believe a similar question has been asked here. However, I am still having trouble adding my own function to an existing package. I've tried
myfun <- function(x) print(x)
environment(myfun) <- asNamespace('stats')
However, when I call
stats::myfun
It tells me that Error: 'myfun' is not an exported object from 'namespace:stats'
. How can I export myfun
?