3.2 Creating tibbles
You can create a simple tibble with the tibble
function, similarly as when you create a data frame:
<- tibble(
mytibble letters = LETTERS,
numbers = 1:26
)
- Convert a data frame to a tibble:
<- data.frame(letters = LETTERS,
mydf numbers = 1:26)
as_tibble(mydf)
- Convert a tibble to a data frame (useful to interact with R code that doesn’t support tibbles):
as.data.frame(mytibble)