benmarwick / rrtools

rrtools: Tools for Writing Reproducible Research in R
Other
671 stars 85 forks source link

openProject #8

Closed nevrome closed 7 years ago

nevrome commented 7 years ago

The call to openProject via rstudioapi::callFun() only works in the newer RStudio Versions (and of course not if your not using RStudio). Maybe we should add a check whether the function is called from a up to date RStudio version and only run rstudioapi::callFun("openProject", paste0("./", path)) in that case.

The openProject and initializeProject functions were added in version 1.1.287 of RStudio.

dakni commented 7 years ago

sounds reasonable. We could check the version in the current call of rstudioapi and change

if(rstudioapi::isAvailable())

to

if(rstudioapi::isAvailable() & rstudioapi::getVersion() >= xxx)

However, I am not sure how to "compare" certain version. The output of getVersion has two classes "package_version" and "numeric_version". How to access these?

MartinHinz commented 7 years ago

Sorry, was not aware of the issues... So, #10 should be a workaround.

benmarwick commented 7 years ago

Good spotting! I've used @MartinHinz's suggestion of browseURL for now, in 33e2c824b26b835a27a34716a68fb4c075d253f8