Skip to content
Back to formatted view

Raw Message

Message-ID: <CALEXWq2+R6MZDYmVyZoJMc-bdRoE-e3WKFXR9VF44afUO_TsdQ@mail.gmail.com>
Date: 2017-09-26T11:47:36Z
From: IƱaki Ucar
Subject: [R-pkg-devel] tibbles are not data frames
In-Reply-To: <CAFDswJvF_D2tEfVwtjVLH3=aFnPqnJUMC=anmROMGDSWJrOd7g@mail.gmail.com>

2017-09-26 13:41 GMT+02:00 Holger Hoefling <hhoeflin at gmail.com>:
> Hi Thierry,
>
> You write:
>
> "If a package requires a data.frame, then it is up to the _user_ to
> provide a data.frame (and a tibble is not a data.frame). "
>
> Actually, as pointed out before, calling
>
> is.data.frame
>
> on a tibble returns TRUE. So I think that R says - yes, a tibble is a data
> frame. What would be the point of having a "is.data.frame" function, if you
> can't trust its answer?

is.data.frame is just a wrapper for inherits(x, "data.frame"). As
Daniel pointed out before, inherits(x, "data.frame", TRUE) == 1
returns TRUE for data frames and FALSE for tibbles.

I?aki