Basic Printing of Tibbles


Introduction

We have covered basics of dataframe or tibble here. To print tibble in R console we use the print(…) function. To view tibble in an interactive fashion in RStudio we use the view(…) function.

Procedure

We will be working with the following tibble:

 
# package for creating tibble
library(tibble)

# create tibble
basic_tibble <- tibble(
  Name = c("Anthony Stark", "Steve Rogers","Bruce Banner","Carol Denvers"),
  Age = c(45,115,47,80),
  Alias = c("Ironman","Captain America","Hulk","Captain Marvel")
  )

The tibble contains the following data:

raw_data

We will print the basic_tibble tibble in console using the print(…) function and view the tibble in RStudio using view(..) function.

Code

 
# refer procedure for definition of basic_tibble
print(basic_tibble)

The output of above code is:

print_tibble

 
# refer procedure for definition of basic_tibble
View(basic_tibble)

The output of above code is:

view_tibble

Conclusion

Thus we have successfully covered basics of printing tibble.

References

  • https://r4ds.had.co.nz/