You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dots in identifier names are just part of the identifier. They are not scope operators. They are not operators at all. They are just a legal character to use in the names of things. They are often used where a normal human being would use underscores, since underscores were assignment operators in S, which I promise you don’t even want to think about.
I'm not sure if you're still updating, or what your understanding is at this point, but this bit is slightly off. Dots are used in function names for method overloading (by class), so print(x) dispatches differently depending on the class of x.
For example, print(data.frame(x)) actually calls print.data.frame(x), but you may want to call print.default() explicitly.
The text was updated successfully, but these errors were encountered:
It's still true that they are not any sort of operator; the method overloading code just understands certain magical names that happen to use . as a separator and dispatches to them at runtime.
I should really add a section on the different class systems!
Also a leading dot in a name will make it "special" in some sense, e.g., ls will not return its name unless 'all.names' is set to TRUE. Also isolated dots have been taken over as meaningful in tidyverse syntax. Arguably this does require consideration of scope.
I'm not sure if you're still updating, or what your understanding is at this point, but this bit is slightly off. Dots are used in function names for method overloading (by class), so
print(x)
dispatches differently depending on the class ofx
.For example,
print(data.frame(x))
actually callsprint.data.frame(x)
, but you may want to callprint.default()
explicitly.The text was updated successfully, but these errors were encountered: