[Rd] as.list method for by Objects

Dario Strbenac dstr7320 at uni.sydney.edu.au
Tue Jan 30 02:00:04 CET 2018


Good day,

I'd like to suggest the addition of an as.list method for a by object that actually returns a list of class "list". This would make it safer to do type-checking, because is.list also returns TRUE for a data.frame variable and using class(result) == "list" is an alternative that only returns TRUE for lists. It's also confusing initially that

> class(x)
[1] "by"
> is.list(x)
[1] TRUE

since there's no explicit class definition for "by" and no mention if it has any superclasses.

--------------------------------------
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia



More information about the R-devel mailing list