VOOZH about

URL: https://www.geeksforgeeks.org/r-language/printing-out-to-the-screen-or-to-a-file-in-r-programming-cat-function/

⇱ Printing out to the Screen or to a File in R Programming - cat() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Printing out to the Screen or to a File in R Programming - cat() Function

Last Updated : 15 Jul, 2025

cat() function in R Language is used to print out to the screen or to a file.
 

Syntax: 
cat(..., file = "", sep = " ", fill = FALSE, labels = NULL, append = FALSE)
Parameters: 
...: atomic vectors, names, NULL and objects with no output 
file: the file in which printing will be done 
sep: specified separator 
fill: If fill=TRUE, a new line will be printed, otherwise not 
labels: specified labels 
 


Example 1: 
 

Output: 
 

GeeksforGeeks
Geeks
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9
1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9


Example 2: 
 

Output: 
 

1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9
1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9
( a ): 1 
( b ): 2 
( c ): 3 
( d ): 4 
( e ): 5 
( f ): 6 
( g ): 7 
( h ): 8 
( i ): 9


 

Comment
Article Tags:

Explore