I'd like to be able to see the function that's used when I use str(), as I'd like to modify it a bit for my own purposes as another function.
When I type str()
, I get the following:
function (object, ...)
UseMethod("str")
<environment: namespace:utils>
So I tried, getAnywhere(str)
:
2 differing objects matching ‘str’ were found
in the following places
.GlobalEnv
package:utils
namespace:utils
Use [] to view one of them
But there's nothing in the documentation about what the syntax should be for using []
So I tried, getAnywhere(str)[1]
:
function (object, ...)
UseMethod("str")
<environment: namespace:utils>
Sigh. Allright, what about showMethods(str)
:
Function "str":
<not a generic function>
So, how do I see the construction of the output for str()
? Or can I?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…