On 28/06/2016 1:15 PM, Duncan Murdoch wrote:
I've now added a simple implementation of hasName to R-devel and
R-patched. When I find the time, I'll go through the base packages and
change the !is.null(x$name) idiom to hasName. (All but "base", that
is: hasName is in utils, and it is better if
I've now added a simple implementation of hasName to R-devel and
R-patched. When I find the time, I'll go through the base packages and
change the !is.null(x$name) idiom to hasName. (All but "base", that
is: hasName is in utils, and it is better if base remains self-contained.)
If any bottl
s
-Original Message-
From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com
<mailto:murdoch.dun...@gmail.com>]
Sent: Monday, June 27, 2016 12:50 PM
To: Hadley Wickham mailto:h.wick...@gmail.com>>; Lenth, Russell V
mailto:russell-le...@uio
ailto:murdoch.dun...@gmail.com]
>> Sent: Monday, June 27, 2016 12:50 PM
>> To: Hadley Wickham ; Lenth, Russell V <
>> russell-le...@uiowa.edu>
>> Cc: r-package-devel@r-project.org
>> Subject: Re: [R-pkg-devel] Absent variables and tibble
>>
>> On 27/
ct: Re: [R-pkg-devel] Absent variables and tibble
On 27/06/2016 1:09 PM, Hadley Wickham wrote:
The other thing you need to be aware of it you're using the other
approach is partial matching:
df <- data.frame(xyz = 1)
is.null(df$x)
#> [1] FALSE
Duncan - I think that argues for
vel@r-project.org
Subject: Re: [R-pkg-devel] Absent variables and tibble
On 27/06/2016 1:09 PM, Hadley Wickham wrote:
> The other thing you need to be aware of it you're using the other
> approach is partial matching:
>
> df <- data.frame(xyz = 1)
> is.null(df$x)
> #> [
On 27/06/2016 1:09 PM, Hadley Wickham wrote:
The other thing you need to be aware of it you're using the other
approach is partial matching:
df <- data.frame(xyz = 1)
is.null(df$x)
#> [1] FALSE
Duncan - I think that argues for including a has_name() (hasName() ?)
function in base R. Is that som
The other thing you need to be aware of it you're using the other
approach is partial matching:
df <- data.frame(xyz = 1)
is.null(df$x)
#> [1] FALSE
Duncan - I think that argues for including a has_name() (hasName() ?)
function in base R. Is that something you'd consider?
Hadley
On Mon, Jun 27,
On 27/06/2016 10:46 AM, Hadley Wickham wrote:
On Mon, Jun 27, 2016 at 9:03 AM, Duncan Murdoch
wrote:
> On 27/06/2016 9:22 AM, Lenth, Russell V wrote:
>>
>> My package 'lsmeans' is now suddenly broken because of a new provision in
>> the 'tibble' package (loaded by 'dplyr' 0.5.0), whereby the "[[
Dear Russell.
The assertthat package (by Hadley) provides a has_name() function.
> library(assertthat)
> x <- data.frame(y = NA)
> has_name(x, "y")
[1] TRUE
> has_name(x, "x")
[1] FALSE
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Thanks, Hadley. I do understand why you'd want more careful checking.
If you're going to provide a variable-existing function, may I suggest a short
name like 'has'? I.e., has(x, var) returns TRUE if x has var in it.
Thanks
Russ
> On Jun 27, 2016, at 9:47 AM, Hadley Wickham wrote:
>
> On M
On Mon, Jun 27, 2016 at 9:03 AM, Duncan Murdoch
wrote:
> On 27/06/2016 9:22 AM, Lenth, Russell V wrote:
>>
>> My package 'lsmeans' is now suddenly broken because of a new provision in
>> the 'tibble' package (loaded by 'dplyr' 0.5.0), whereby the "[[" and "$"
>> methods for 'tbl_df' objects - as d
Am Montag, 27. Juni 2016, 10:03:35 schrieb Duncan Murdoch:
> On 27/06/2016 9:22 AM, Lenth, Russell V wrote:
> > My package 'lsmeans' is now suddenly broken because of a new provision in
> > the 'tibble' package (loaded by 'dplyr' 0.5.0), whereby the "[[" and "$"
> > methods for 'tbl_df' objects - a
On 27/06/2016 9:22 AM, Lenth, Russell V wrote:
My package 'lsmeans' is now suddenly broken because of a new provision in the 'tibble' package
(loaded by 'dplyr' 0.5.0), whereby the "[[" and "$" methods for 'tbl_df'
objects - as documented - throw an error if a variable is not found.
The proble
My package 'lsmeans' is now suddenly broken because of a new provision in the
'tibble' package (loaded by 'dplyr' 0.5.0), whereby the "[[" and "$" methods
for 'tbl_df' objects - as documented - throw an error if a variable is not
found.
The problem is that my code uses tests like this:
15 matches
Mail list logo