VOOZH about

URL: https://www.geeksforgeeks.org/r-language/convert-an-object-to-a-string-in-r-programming-tostring-function/

⇱ Convert an Object to a String in R Programming - toString() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Convert an Object to a String in R Programming - toString() Function

Last Updated : 15 Jul, 2025
toString() function in R Language is used to convert an object into a single character string.
Syntax: toString(x, width) Parameters: x: Object width: maximum string width
Example 1: Output:
[1] "Geeks, for, geeks"
[1] "Geeks, f...."
Example 2: Output:
[1] "1, 2, 3, 4, 5, 6, 7, 8, 9"
Comment
Article Tags:

Explore