2.1 Introduction

Almost all of the functions that you’ll use in the tidyverse produce tibbles. To coerce a data.frame into tibble, we can use as_tibble():

相比于 data.frame()tibble() 创建数据矿的附加操作要少的多:它不能改变输入的类型(例如,不会默认将字符串转变为因子)、变量的名称,也不能创建行名称。

有些比较旧的函数不支持 tibble,如果遇到这种函数,可以使用 as_data_frame() 转换到传统的 data.frame 上。

add_row(.data, ..., .before = NULL, .after = NULL) s a convenient way to add one or more rows of data to an existing data frame. ... should be name-value pairs corresponding to column names and its value. By default new row are added after the last row.

Yet we cannot create new variables with add_row:

enframe() converts named atomic vectors or lists to one- or two-column data frames . For vectors with more than 2 elements, a list column is created.

For a list, the result will also be a list column.

deframe() is the opposite of enframe()