R print()
Published Oct 7, 2022
Contribute to Docs
The print() function prints out the specified argument.
Syntax
print(argument)
The argument to be printed is of a valid data type.
Example
The following example prints out a data frame with the print() function:
school_teams <- data.frame(Sport = c("Basketball", "Baseball", "Football", "Track", "Tennis", "Swim"), Coach = c("Tyler", "Blake", "Stephanie", "Jordan", "Taylor","Brooklyn"), Player_Count = c(15, 24, 22, 20, 12, 29))print(school_teams)
This outputs the following:
Sport Coach Player_Count1 Basketball Tyler 152 Baseball Blake 243 Football Stephanie 224 Track Jordan 205 Tennis Taylor 126 Swim Brooklyn 29
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn R on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours
- Learn how to code and clean and manipulate data for analysis and visualization with the R programming language.
- Beginner Friendly.14 hours