From jori@mey@ @ending from gm@il@com  Thu Aug  9 14:55:30 2018
From: jori@mey@ @ending from gm@il@com (Joris Meys)
Date: Thu, 9 Aug 2018 14:55:30 +0200
Subject: [Rd] vctrs: a type system for the tidyverse
In-Reply-To: <CABdHhvH9Xo-W3gj7Sk+htfa9uzVLhWZSmk_mP+o6BoaFub=1hQ@mail.gmail.com>
References: <CABdHhvFARmiExcEk=NUjfPcRtYnoF4pAA5WTws6r1C+X76zHEw@mail.gmail.com>
 <CAMFmJsn_wNxuV2SQqUiZroJYV+rHRKdADi8Fjg8fRjJr0RGuwQ@mail.gmail.com>
 <CABdHhvEAV-bhprxVMHF_R8vKdN3VEriV86kGNNU02RiK=+m4dQ@mail.gmail.com>
 <CABdHhvHw+_sFcD3H92KQhvurxC8eAyR2A0frZUk7pBcOaVB2Hw@mail.gmail.com>
 <23403.4648.841262.201573@stat.math.ethz.ch>
 <CAMFmJs=hHXYdkd-2kRH48sxB5VJAO4g5Rs35einXs8GwQJ7C8g@mail.gmail.com>
 <CALEXWq2J-J5obavQ=dpkHJmqpt9WQ5a3uZS7L6gY-Fs4X_AuNg@mail.gmail.com>
 <CAO1zAVbaB9fmtrFFYLuusm2jOyh1SHQnDm3U8vjFPNiitk=+hw@mail.gmail.com>
 <CABdHhvH9Xo-W3gj7Sk+htfa9uzVLhWZSmk_mP+o6BoaFub=1hQ@mail.gmail.com>
Message-ID: <CAO1zAVbutLaTFbL5BM8kgv2Lo7VVYVkYoCxC-YQwDR+ptGkjRA@mail.gmail.com>

Hi Hadley,

my point actually came from a data analyst point of view. A character
variable is something used for extra information, eg the "any other ideas?"
field of a questionnaire. A categorical variable is a variable describing
categories defined by the researcher. If it is made clear that a factor is
the object type needed for a categorical variable, there is no confusion.
All my students get it. But I agree that in many cases people are taught
that a factor is somehow related to character variables. And that does not
make sense from a data analyst point of view if you think about variables
as continuous, ordinal and nominal in a model context.

So I don't think adding more confusing behaviour and pitfalls is a solution
to something that's essentially a misunderstanding. It's something that's
only solved by explaining it correctly imho.

Cheers
Joris

On Thu, Aug 9, 2018 at 2:36 PM Hadley Wickham <h.wickham at gmail.com> wrote:

>
> I 100% agree with you, and is this the behaviour that vctrs used to
> have and dplyr currently has (at least in bind_rows()). But
> pragmatically, my experience with dplyr is that people find this
> behaviour confusing and unhelpful. And when I played the full
> expression of this behaviour in vctrs, I found that it forced me to
> think about the levels of factors more than I'd otherwise like to: it
> made me think like a programmer, not like a data analyst. So in an
> ideal world, yes, I think factors would have stricter behaviour, but
> my sense is that imposing this strictness now will be onerous to most
> analysts.
>
> Hadley
>
> --
> http://hadley.nz
>


-- 
Joris Meys
Statistical consultant

Department of Data Analysis and Mathematical Modelling
Ghent University
Coupure Links 653, B-9000 Gent (Belgium)
<https://maps.google.com/?q=Coupure+links+653,%C2%A0B-9000+Gent,%C2%A0Belgium&entry=gmail&source=g>

-----------
Biowiskundedagen 2017-2018
http://www.biowiskundedagen.ugent.be/

-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

	[[alternative HTML version deleted]]



[Rd] vctrs: a type system for the tidyverse
Joris Meys