print in r

To print in R, you can use the print() function. This function is used to display the content of an object or variable in the console. Here is an example of how to use the print() function in R:

# Create a variable
x <- 5

# Print the value of x
print(x)

In this example, we first create a variable x and assign it the value of 5. Then, we use the print() function to display the value of x in the console. The output will be:

[1] 5

The [1] indicates the index of the value being printed, and the 5 is the value of x.