How to Apply the print() & cat() Functions in R (Example Code)

This tutorial shows how to use the print and cat functions in the R programming language.

Example: Comparison of print() & cat() Output

example_string <- "dhjfushdnsfjhnnlksdhfknaaaa"      # Example string
print(example_string)                                # print() function
# [1] "dhjfushdnsfjhnnlksdhfknaaaa"
cat(example_string)                                  # cat() function
# dhjfushd
# sfjh
# lksdhfk
# aaaa

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed