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
Interactive() Function in R
In this article, we are going to see interactive() Function in R Programming Language.