Coercion between two data frames
df_ptype2()
and df_cast()
are the two functions you need to
call from vec_ptype2()
and vec_cast()
methods for data frame
subclasses. See ?howto-faq-coercion-data-frame.
Their main job is to determine the common type of two data frames,
adding and coercing columns as needed, or throwing an incompatible
type error when the columns are not compatible.
df_ptype2(x, y, ..., x_arg = "", y_arg = "") df_cast(x, to, ..., x_arg = "", to_arg = "") tib_ptype2(x, y, ..., x_arg = "", y_arg = "") tib_cast(x, to, ..., x_arg = "", to_arg = "")
x, y, to |
Subclasses of data frame. |
... |
If you call |
x_arg |
Argument names for |
y_arg |
Argument names for |
to_arg |
Argument names for |
When x
and y
are not compatible, an error of class
vctrs_error_incompatible_type
is thrown.
When x
and y
are compatible, df_ptype2()
returns the common
type as a bare data frame. tib_ptype2()
returns the common type
as a bare tibble.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.