In RStudio, I know that if I press F2 while the caret is on a function name I will be shown the source code for that function as if it was an open R script, which syntax highlighting and everything.
How do I do the same for operators like %in%
and names like if
? These things don't work:
%in%
into the script or console and pressing F2/Go To Definition.The only way I can view their source code is by running `%in%` in the console, where it shows me an unhighlighted version.
Thanks!
Simply open the file on command line with vim <filename> , type :syntax on<ENTER> , then :hardcopy<ENTER> to print it.
Usages. Open code file or select code snippet in Text Editor, then press F1 and then select/type Copy Syntax , or right click the Text Editor and then click Copy Syntax in context menu, the code with syntax highlight will copy to clipboard.
You can see them by using View()
with backticks around the argument:
View(`%in%`)
View(`if`)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With