Assign keyboard shortcut to run a function

I'm brand new to this forum, having recently decided to explore RStudio as an alternative to Tinn-R. A Tinn-R keyboard shortcut (F2) which I have found extremely useful displays the structure of a highlighted object; i.e., hitting F2 while myVar is highlighted is equivalent to running str(myVar).

Is it possible to define an equivalent shortcut in RStudio? More generally, is it possible to define a shortcut key to run any specified R function (e.g., head(), tail(), names() etc.)?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.