interactive() Function in R (Example) | Test if R is Running Interactively
This tutorial shows how to check whether R runs interactively using the interactive function in the R programming language.
The tutorial contains the following:
Let’s take a look at some R codes in action.
Example: Test if R is Running Interactively Using interactive() Function
This example explains how to test whether an R session is interactive, i.e. it is assumed that the current R session is one in which is a human operator to interact with.
For this, we can simply execute the interactive command as shown below:
interactive() # Apply interactive function # [1] TRUE
The previous R code has returned the logical indicator TRUE, i.e. it is assumed that a human is there to, for instance, conduct corrections to incorrect input.
Video & Further Resources
I have recently published a video on my YouTube channel, which shows the examples of this tutorial. Please find the video below:
The YouTube video will be added soon.
In addition, you may read the related posts on my website. You can find a selection of related articles below.
Summary: You have learned in this article how to apply the interactive function in the R programming language. Don’t hesitate to let me know in the comments section, if you have further questions. In addition, please subscribe to my email newsletter to receive updates on new posts.
Subscribe to the Statistics Globe Newsletter
Get regular updates on the latest tutorials, offers & news at Statistics Globe.
I hate spam & you may opt out anytime: Privacy Policy.
Thank you!
Welcome to the Statistics Globe newsletter. From now on, I’ll send you regular emails about statistics, data science, AI, and programming with R and Python.
I’m Joachim Schork. On this website, I provide statistics tutorials as well as code in Python and R programming.
Statistics Globe Newsletter
Get regular updates on the latest tutorials, offers & news at Statistics Globe. I hate spam & you may opt out anytime: Privacy Policy.
Thank you!
Please check your email inbox and click the confirmation link to complete your subscription. If you don’t see the email within a few minutes, please also check your spam/junk folder.






