<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><font face="Helvetica"><span style="font-size: 13px;">Let's say I have R open and i’m editing a .R filewith TextMate. In my .R file I have a line of code like this:</span></font><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;">lm(mpg ~ drat, mtcars)</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;">Is it possible to set up a keyboard shortcut, which when pressed whilst an R object was selected, would send <span style="line-height: 16.5pt;">that object to the R console inside a </span>function.</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;">For example:</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;">I select 'mpg', press COMMAND + OPTION + L, and this object would be run in the R console as: length(mpg)</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;">I select ‘mtcars', press COMMAND + OPTION + S, and this object would be run in the R console as: summary(mtcars)</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;">I select 'lm(mpg ~ drat, mtcars)', press COMMAND + OPTION + P, and this object would be run in the R console as: plot(lm(mpg ~ drat, mtcars))</div></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;">Thanks</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px;">Ross</div></body></html>