Re: [R-pkg-devel] Absent variables and tibble

2016-06-27 Thread Lenth, Russell V
Hadley's note on partial matching has me scared the most concerning the as.null() coding. So the need for a hasName() (or whatever) function seems all the more compelling, and that it be in base R. Perhaps it should be generic, with a default method that searches in the names attribute,

Re: [R-pkg-devel] Force namespace prefix for a loaded package function

2016-06-27 Thread Duncan Murdoch
On 27/06/2016 5:46 PM, Tim Keitt wrote: http://www.keittlab.org/ On Mon, Jun 27, 2016 at 10:19 AM, Duncan Murdoch > wrote: On 27/06/2016 11:08 AM, Tim Keitt wrote: http://www.keittlab.org/ On Mon, Jun 27, 2016

Re: [Rd] stack problem

2016-06-27 Thread Michael Lawrence
Agreed. Just putting that out there. On Mon, Jun 27, 2016 at 12:49 PM, Gabor Grothendieck wrote: > One would normally want the original order that so that one can stack > a list, operate on the result and then unstack it back with the > unstacked result having the same

Re: [Rd] stack problem

2016-06-27 Thread Gabor Grothendieck
One would normally want the original order that so that one can stack a list, operate on the result and then unstack it back with the unstacked result having the same ordering as the original. LL <- list(z = 1:3, a = list()) # since we can't do s <- stack(LL,. drop = FALSE) do this instead: s <-

Re: [Rd] stack problem

2016-06-27 Thread Michael Lawrence
I'll add the drop argument but I'm wondering about the order of the levels. Should we set the levels to unique(names(x)) or sort them, too? On Mon, Jun 27, 2016 at 10:39 AM, Gabor Grothendieck wrote: > stack() seems to drop empty levels. Perhaps there could be a >

Re: [Bioc-devel] Listing package-specific methods

2016-06-27 Thread Michael Lawrence
There are two relevant queries: 1) What are the methods where at least one signature component is (or extends) this class? 2) What are the methods for this class that are defined in a specific package? #1 is along the lines of what Vince said. I prefer that definition, because I often want to

Re: [Bioc-devel] Listing package-specific methods

2016-06-27 Thread Michael Love
This seems like a pretty simple solution, so I like that :) On Mon, Jun 27, 2016 at 10:46 AM, Hervé Pagès wrote: > Hi Mike, > > IIUC you want to do something like > > setdiff(methods(class="DESeqDataSet"), > methods(class="RangedSummarizedExperiment")) > >

Re: [R-pkg-devel] Absent variables and tibble

2016-06-27 Thread Duncan Murdoch
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

Re: [Bioc-devel] Listing package-specific methods

2016-06-27 Thread Hervé Pagès
Hi Mike, IIUC you want to do something like setdiff(methods(class="DESeqDataSet"), methods(class="RangedSummarizedExperiment")) Maybe this could be handled by methods() itself e.g. with an extra argument that lets the user choose if s/he wants to see all the methods (i.e. specific

[Rd] stack problem

2016-06-27 Thread Gabor Grothendieck
stack() seems to drop empty levels. Perhaps there could be a drop=FALSE argument if one wanted all the original levels. In the example below, we may wish to retain level "b" in s$ind even though component LL$b has length 0. > LL <- list(a = 1:3, b = list()) > s <- stack(LL) > str(s)

Re: [Bioc-devel] Listing package-specific methods

2016-06-27 Thread Michael Love
1) I guess if someone else defined methods for the FooData class then those could be of interest, but I think nearly all of the time I want to know just what this specific package author has defined. 2) This is getting down to my (perhaps idiosyncratic) wants, but I would like a quick and short

Re: [R-pkg-devel] Absent variables and tibble

2016-06-27 Thread Hadley Wickham
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

Re: [Bioc-devel] Listing package-specific methods

2016-06-27 Thread Vincent Carey
1) is the package connection key, or is it the 'directness' of the method in connection with the class of interest? (sorry to be so vague, there must be a more scientific term...) 2) it seems useful to get the signature too. this uses string operations to get at something that the class

[Bioc-devel] Listing package-specific methods

2016-06-27 Thread Michael Love
hi, Following on a conversation from Bioc2016, I think it would be good to have a function available to Bioconductor users that helps in the following situation: I'm a user, trying out a new package 'foo', which defines the FooData class, that builds on top of SummarizedExperiment. The package

Re: [R-pkg-devel] Absent variables and tibble

2016-06-27 Thread Thierry Onkelinx
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

Re: [R-pkg-devel] Force namespace prefix for a loaded package function

2016-06-27 Thread Tim Keitt
http://www.keittlab.org/ On Mon, Jun 27, 2016 at 3:22 AM, Joris Meys wrote: > If you want to call a non exported function, you need three colons > > X:::f () > > And frankly, that is a bad idea. > I think you missed the point (and stated the obvious). A well-designed

Re: [R-pkg-devel] Absent variables and tibble

2016-06-27 Thread Lenth, Russell V
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

Re: [R-pkg-devel] Absent variables and tibble

2016-06-27 Thread Hadley Wickham
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

Re: [R-pkg-devel] Absent variables and tibble

2016-06-27 Thread Johannes Ranke
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 -

Re: [R-pkg-devel] Absent variables and tibble

2016-06-27 Thread 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 - as documented - throw an error if a variable is not found. The

Re: [Rd] Two minor build system patches.

2016-06-27 Thread Ray Donnelly
On Mon, Jun 27, 2016 at 12:07 PM, Duncan Murdoch wrote: > On 27/06/2016 6:58 AM, Ray Donnelly wrote: >> >> Hi all, >> >> I ran into a few problems building R 3.3.1 and came up wth the >> attached patches (fingers crossed they don't get stripped, I've also >> sent this

Re: [Rd] Two minor build system patches.

2016-06-27 Thread Duncan Murdoch
On 27/06/2016 6:58 AM, Ray Donnelly wrote: Hi all, I ran into a few problems building R 3.3.1 and came up wth the attached patches (fingers crossed they don't get stripped, I've also sent this email to Jeroen since that worked last time). Would it be possible to review and merge them if they

[Rd] Two minor build system patches.

2016-06-27 Thread Ray Donnelly
Hi all, I ran into a few problems building R 3.3.1 and came up wth the attached patches (fingers crossed they don't get stripped, I've also sent this email to Jeroen since that worked last time). Would it be possible to review and merge them if they are OK? The first one uses AC_SEARCH_LIBS

[Bioc-devel] 15th Bioconductor birthday coming up

2016-06-27 Thread Steffen Neumann
Hi, I was just digging up some stats on BioC,  and I found in the SVN the first commit: r21 | rgentlem | 2001-07-29 23:51:48 +0200 (So, 29 Jul 2001) So we should not forget to celebrate the 15th anniversary  in ~4 weeks this year, or put up blog posts somewhere.  Other things you can