<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div>Lets say I have a file on desktop called called ‘test.csv’. I discovered by accident that if I drag ‘test.csv’ to an R file, this code is pasted into the R file:</div><div><br></div><div><div>read.csv(file = "../../../../Desktop/test.csv", header = TRUE, stringsAsFactors = FALSE)</div></div><div><br></div><div>But if the file is a .xls file, only this get pasted into the R file:</div><div><br></div><div>/Users/rossahmed/Desktop/test.xls</div><div><br></div><div>How can I add a command that, when I drag a .xls file into an R file, this get pasted in:</div><div><br></div><div>read.xls("/Users/rossahmed/Desktop/test.xls")</div></body></html>