r/R_Programming • u/beren323 • Jan 09 '17
How to edit str()?
I am trying to edit the function str() so that it conveniently lists the column number next to the column name. I found "methods(str)", then "getAnywhere(str.data.frame)", which shows me the code I want to edit, but I can't figure out how to edit it. I am fairly certain I can alter the code to be the way I want it, but what command allows me to do so? Thanks!
3
Upvotes
View all comments
Show parent comment
2
u/[deleted] Jan 10 '17
Yea, I would just copy the code you see there and edit in to a new function called myStr or something. I can imagine the problems that come in when code that depends on a base function no longer works because it's been edited.
And if you get really motivated, it's not too much work to create a package. So, when you want to load any functions you've written without loading a script it's as simple as using library()