Skip to content
Related Articles

Related Articles

Interactive() Function in R

Improve Article
Save Article
  • Last Updated : 02 Jun, 2022
Improve Article
Save Article

In this article, we are going to see interactive() Function in R Programming Language.

Interactive() Function 

It returns TRUE when R is being used interactively and FALSE otherwise. This function is used to test whether R runs interactively or not.

Syntax: interactive()  

It will return TRUE, if is running interactively, otherwise FALSE.

Example 1:

Check whether the environment is Running interactively or not.

R




interactive()


Output:

TRUE

Example 2:

Check whether the environment is Running interactively or not by creating two vectors and display them

R




# vector1
vec1 = c(2,3,4)
  
# vector2
vec2 = c(2,1,2,3)
  
# display
print(vec1)
print(vec2)
  
# check for interactivity
interactive()


Output:

[1] 2 3 4
[1] 2 1 2 3
[1] TRUE
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!