[R-pkg-devel] discovering if a function in a package is called under RStudio

Georgi Boshnakov georgi.boshnakov at manchester.ac.uk
Fri Feb 9 10:22:59 CET 2018


Many thanks, I should have looked at rstudioapi, from rstudioapi::isAvailable():

> .Platform$GUI
[1] "RStudio"

Georgi

From: jorismeys at gmail.com [mailto:jorismeys at gmail.com] On Behalf Of Joris Meys
Sent: 09 February 2018 09:09
To: Georgi Boshnakov
Cc: r-package-devel at r-project.org
Subject: Re: [R-pkg-devel] discovering if a function in a package is called under RStudio

Hi,
you can use rstudioapi::isAvailable() for that. There's other packages with similar functionality (eg the assertive package), and you can always check whether Sys.getenv("RSTUDIO") == "1".
Cheers
Joris


On Fri, Feb 9, 2018 at 9:09 AM, Georgi Boshnakov <georgi.boshnakov at manchester.ac.uk<mailto:georgi.boshnakov at manchester.ac.uk>> wrote:
Hi,

Is there a canonical way for a function to discover if it has been called in a session under RStudio?
I looked the at the options() but none seems to be dedicated to this.

Thanks,
Georgi Boshnakov


______________________________________________
R-package-devel at r-project.org<mailto:R-package-devel at r-project.org> mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel



--
Joris Meys
Statistical consultant

Department of Data Analysis and Mathematical Modelling
Ghent University
Coupure Links 653, B-9000 Gent (Belgium)
<https://maps.google.com/?q=Coupure+links+653,%C2%A0B-9000+Gent,%C2%A0Belgium&entry=gmail&source=g>

tel: +32 (0)9 264 61 79
-----------
Biowiskundedagen 2017-2018
http://www.biowiskundedagen.ugent.be/

-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list