Re: [Rd] can we override "if" in R?

2017-03-04 Thread Gábor Csárdi
Because the S3 class system is very informal. E.g. if you happen to
have an `if.whatever` function, that will be automatically a method of
your generic.

Gabor

On Sat, Mar 4, 2017 at 7:49 PM, Da Zheng  wrote:
> I'm just curious. Why making "if" generic is even more dangerous?
>
> Best,
> Da
>
> On Sat, Mar 4, 2017 at 1:22 PM, Gábor Csárdi  wrote:
>> `!` is a generic, `if` is not. You can define an `if` that is generic,
>> but this might be even more dangerous
>>
>> ❯ `if` <- function(a, b, c) UseMethod("if")
>> ❯ `if.default` <- function(a,b,c) base::`if`(a, b, c)
>> ❯ `if.foo` <- function(a, b, c) FALSE
>> ❯ a <- structure(42, class = "foo")
>>
>> ❯ if (a) TRUE else FALSE
>> [1] FALSE
>>
>> ❯ if (1) TRUE else FALSE
>> [1] TRUE
>>
>> Gabor
>>
>> On Sat, Mar 4, 2017 at 5:47 PM, Da Zheng  wrote:
>>> Thanks.
>>> Can I override it for a specific class?
>>> I can do that for operators such as "!". For example, "!.fm" works for
>>> objects of the class "fm".
>>> It seems I can't do the same for "if".
>>>
>>> Best,
>>> Da
>>>
>>> On Sat, Mar 4, 2017 at 12:41 PM, Gábor Csárdi  
>>> wrote:
 You can. Perhaps needless to say, be careful with this.

 ❯ `if` <- function(...) FALSE
 ❯ if (TRUE) TRUE else FALSE
 [1] FALSE

 G.

 On Sat, Mar 4, 2017 at 5:36 PM, Da Zheng  wrote:
> Hello,
>
> I heard we can override almost everything in R. Is it possible to
> override "if" keyword in R to evaluate my own object instead of a
> logical value?
>
> Thanks,
> Da
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Control statements with condition with greater than one should give error (not just warning) [PATCH]

2017-03-04 Thread Henrik Bengtsson
Here's a patch that enables the error if
_R_CHECK_CONDITION_={1,true,TRUE,yes,YES}.

$ svn diff
Index: src/main/eval.c
===
--- src/main/eval.c (revision 72303)
+++ src/main/eval.c (working copy)
@@ -1851,9 +1851,19 @@
 Rboolean cond = NA_LOGICAL;

 if (length(s) > 1) {
+ int val = 0; /* warn by default */
+ char *check = getenv("_R_CHECK_CONDITION_");
+ if (check != NULL) {
+val = (strcmp("1", check) == 0 ||
+   strcasecmp("true", check) == 0 ||
+   strcasecmp("yes", check) == 0);
+}
  PROTECT(s); /* needed as per PR#15990.  call gets protected by
warningcall() */
- warningcall(call,
-_("the condition has length > 1 and only the first element will be used"));
+ if (val)
+errorcall(call, _("the condition has length > 1"));
+else
+warningcall(call,
+ _("the condition has length > 1 and only the first element will be used"));
  UNPROTECT(1);
 }
 if (length(s) > 0) {

An alternative is to make _R_CHECK_CONDITION_=false the default behavior.


With this env variable, I think it'll be easier for a developer to
temporarily work around broken dependencies until fixed.  It will also
help identify broken dependencies.  For instance, as soon as one is
identified it can be wrapped up in an:

  with_faulty_conditions(x <- pkg::foo(...))

and additionally faulty if/while statements can be detected.  Your
package will still "work" until downstream packages are fixed.  Here,

with_faulty_conditions <- function(expr, envir = parent.frame()) {
  oenv <- Sys.getenv("_R_CHECK_CONDITION_")
  on.exit(Sys.setenv("_R_CHECK_CONDITION_" = oenv))
  Sys.setenv("_R_CHECK_CONDITION_" = FALSE)
  eval(substitute(expr), envir = envir)
}

/Henrik

On Sat, Mar 4, 2017 at 12:20 PM, Michael Lawrence
 wrote:
> Is there really a need for these complications? Packages emitting this
> warning are broken by definition and should be fixed. Perhaps we could "flip
> the switch" in a test environment and see how much havoc is wreaked and
> whether authors are sufficiently responsive?
>
> Michael
>
> On Sat, Mar 4, 2017 at 12:04 PM, Martin Maechler
>  wrote:
>>
>> > Henrik Bengtsson 
>> > on Fri, 3 Mar 2017 10:10:53 -0800 writes:
>>
>> > On Fri, Mar 3, 2017 at 9:55 AM, Hadley Wickham
>> >  wrote:
>> >>> But, how you propose a warning-to-error transition
>> >>> should be made without wreaking havoc?  Just flip the
>> >>> switch in R-devel and see CRAN and Bioconductor packages
>> >>> break overnight?  Particularly Bioconductor devel might
>> >>> become non-functional (since at times it requires
>> >>> R-devel).  For my own code / packages, I would be able
>> >>> to handle such a change, but I'm completely out of
>> >>> control if one of the package I'm depending on does not
>> >>> provide a quick fix (with the only option to remove
>> >>> package tests for those dependencies).
>> >>
>> >> Generally, a package can not be on CRAN if it has any
>> >> warnings, so I don't think this change would have any
>> >> impact on CRAN packages.  Isn't this also true for
>> >> bioconductor?
>>
>> > Having a tests/warn.R file with:
>>
>> > warning("boom")
>>
>> > passes through R CMD check --as-cran unnoticed.
>>
>> Yes, indeed.. you are right Henrik  that many/most R warning()s would
>> not produce  R CMD check  'WARNING's ..
>>
>> I think Hadley and I fell into the same mental pit of concluding
>> that such warning()s  from   if()  ...
>> would not currently happen in CRAN / Bioc packages and hence
>> turning them to errors would not have a direct effect.
>>
>> With your 2nd e-mail of saying that you'd propose such an option
>> only for a few releases of R you've indeed clarified your intent
>> to me.
>> OTOH, I would prefer using an environment variable (as you've
>> proposed as an alternative)  which is turned "active"  at the
>> beginning only manually or  for the  "CRAN incoming" checks of
>> the CRAN team (and bioconductor submission checks?)
>> and later for  '--as-cran'  etc until it eventually becomes the
>> unconditional behavior of R (and the env.variable is no longer used).
>>
>> Martin
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] can we override "if" in R?

2017-03-04 Thread William Dunlap via R-devel
dplyr::translate_sql() redefines lots of functions, include "if", to
translate from R syntax to SQL syntax.

> dplyr::translate_sql(if ("mpg">25) "better" else "worse")
 CASE WHEN ('mpg' > 25.0) THEN ('better') ELSE ('worse') END

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Sat, Mar 4, 2017 at 12:22 PM, Michael Lawrence
 wrote:
> I'm curious as to precisely why someone would want to do this.
>
> On Sat, Mar 4, 2017 at 11:49 AM, Da Zheng  wrote:
>
>> I'm just curious. Why making "if" generic is even more dangerous?
>>
>> Best,
>> Da
>>
>> On Sat, Mar 4, 2017 at 1:22 PM, Gábor Csárdi 
>> wrote:
>> > `!` is a generic, `if` is not. You can define an `if` that is generic,
>> > but this might be even more dangerous
>> >
>> > ❯ `if` <- function(a, b, c) UseMethod("if")
>> > ❯ `if.default` <- function(a,b,c) base::`if`(a, b, c)
>> > ❯ `if.foo` <- function(a, b, c) FALSE
>> > ❯ a <- structure(42, class = "foo")
>> >
>> > ❯ if (a) TRUE else FALSE
>> > [1] FALSE
>> >
>> > ❯ if (1) TRUE else FALSE
>> > [1] TRUE
>> >
>> > Gabor
>> >
>> > On Sat, Mar 4, 2017 at 5:47 PM, Da Zheng  wrote:
>> >> Thanks.
>> >> Can I override it for a specific class?
>> >> I can do that for operators such as "!". For example, "!.fm" works for
>> >> objects of the class "fm".
>> >> It seems I can't do the same for "if".
>> >>
>> >> Best,
>> >> Da
>> >>
>> >> On Sat, Mar 4, 2017 at 12:41 PM, Gábor Csárdi 
>> wrote:
>> >>> You can. Perhaps needless to say, be careful with this.
>> >>>
>> >>> ❯ `if` <- function(...) FALSE
>> >>> ❯ if (TRUE) TRUE else FALSE
>> >>> [1] FALSE
>> >>>
>> >>> G.
>> >>>
>> >>> On Sat, Mar 4, 2017 at 5:36 PM, Da Zheng 
>> wrote:
>>  Hello,
>> 
>>  I heard we can override almost everything in R. Is it possible to
>>  override "if" keyword in R to evaluate my own object instead of a
>>  logical value?
>> 
>>  Thanks,
>>  Da
>> 
>>  __
>>  R-devel@r-project.org mailing list
>>  https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> [[alternative HTML version deleted]]
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] can we override "if" in R?

2017-03-04 Thread Da Zheng
In my case, I create a new type of matrices and override matrix
operations in R for these matrices.
My goal is to make the system as transparent as possible, which means
my system should execute the existing R code without modification.
The problem is that when data is in my own vectors or matrices, "if"
or "while" can't access their values unless we explicitly convert them
into R objects. But this means users need to modify the existing code.
So I hope I can override "if", "while", etc to access data in my own
vectors and matrices directly.
Does this sound reasonable?

Best,
Da

On Sat, Mar 4, 2017 at 3:22 PM, Michael Lawrence
 wrote:
> I'm curious as to precisely why someone would want to do this.
>
> On Sat, Mar 4, 2017 at 11:49 AM, Da Zheng  wrote:
>>
>> I'm just curious. Why making "if" generic is even more dangerous?
>>
>> Best,
>> Da
>>
>> On Sat, Mar 4, 2017 at 1:22 PM, Gábor Csárdi 
>> wrote:
>> > `!` is a generic, `if` is not. You can define an `if` that is generic,
>> > but this might be even more dangerous
>> >
>> > ❯ `if` <- function(a, b, c) UseMethod("if")
>> > ❯ `if.default` <- function(a,b,c) base::`if`(a, b, c)
>> > ❯ `if.foo` <- function(a, b, c) FALSE
>> > ❯ a <- structure(42, class = "foo")
>> >
>> > ❯ if (a) TRUE else FALSE
>> > [1] FALSE
>> >
>> > ❯ if (1) TRUE else FALSE
>> > [1] TRUE
>> >
>> > Gabor
>> >
>> > On Sat, Mar 4, 2017 at 5:47 PM, Da Zheng  wrote:
>> >> Thanks.
>> >> Can I override it for a specific class?
>> >> I can do that for operators such as "!". For example, "!.fm" works for
>> >> objects of the class "fm".
>> >> It seems I can't do the same for "if".
>> >>
>> >> Best,
>> >> Da
>> >>
>> >> On Sat, Mar 4, 2017 at 12:41 PM, Gábor Csárdi 
>> >> wrote:
>> >>> You can. Perhaps needless to say, be careful with this.
>> >>>
>> >>> ❯ `if` <- function(...) FALSE
>> >>> ❯ if (TRUE) TRUE else FALSE
>> >>> [1] FALSE
>> >>>
>> >>> G.
>> >>>
>> >>> On Sat, Mar 4, 2017 at 5:36 PM, Da Zheng 
>> >>> wrote:
>>  Hello,
>> 
>>  I heard we can override almost everything in R. Is it possible to
>>  override "if" keyword in R to evaluate my own object instead of a
>>  logical value?
>> 
>>  Thanks,
>>  Da
>> 
>>  __
>>  R-devel@r-project.org mailing list
>>  https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] can we override "if" in R?

2017-03-04 Thread Michael Lawrence
I'm curious as to precisely why someone would want to do this.

On Sat, Mar 4, 2017 at 11:49 AM, Da Zheng  wrote:

> I'm just curious. Why making "if" generic is even more dangerous?
>
> Best,
> Da
>
> On Sat, Mar 4, 2017 at 1:22 PM, Gábor Csárdi 
> wrote:
> > `!` is a generic, `if` is not. You can define an `if` that is generic,
> > but this might be even more dangerous
> >
> > ❯ `if` <- function(a, b, c) UseMethod("if")
> > ❯ `if.default` <- function(a,b,c) base::`if`(a, b, c)
> > ❯ `if.foo` <- function(a, b, c) FALSE
> > ❯ a <- structure(42, class = "foo")
> >
> > ❯ if (a) TRUE else FALSE
> > [1] FALSE
> >
> > ❯ if (1) TRUE else FALSE
> > [1] TRUE
> >
> > Gabor
> >
> > On Sat, Mar 4, 2017 at 5:47 PM, Da Zheng  wrote:
> >> Thanks.
> >> Can I override it for a specific class?
> >> I can do that for operators such as "!". For example, "!.fm" works for
> >> objects of the class "fm".
> >> It seems I can't do the same for "if".
> >>
> >> Best,
> >> Da
> >>
> >> On Sat, Mar 4, 2017 at 12:41 PM, Gábor Csárdi 
> wrote:
> >>> You can. Perhaps needless to say, be careful with this.
> >>>
> >>> ❯ `if` <- function(...) FALSE
> >>> ❯ if (TRUE) TRUE else FALSE
> >>> [1] FALSE
> >>>
> >>> G.
> >>>
> >>> On Sat, Mar 4, 2017 at 5:36 PM, Da Zheng 
> wrote:
>  Hello,
> 
>  I heard we can override almost everything in R. Is it possible to
>  override "if" keyword in R to evaluate my own object instead of a
>  logical value?
> 
>  Thanks,
>  Da
> 
>  __
>  R-devel@r-project.org mailing list
>  https://stat.ethz.ch/mailman/listinfo/r-devel
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Control statements with condition with greater than one should give error (not just warning) [PATCH]

2017-03-04 Thread Michael Lawrence
Is there really a need for these complications? Packages emitting this
warning are broken by definition and should be fixed. Perhaps we could
"flip the switch" in a test environment and see how much havoc is wreaked
and whether authors are sufficiently responsive?

Michael

On Sat, Mar 4, 2017 at 12:04 PM, Martin Maechler  wrote:

> > Henrik Bengtsson 
> > on Fri, 3 Mar 2017 10:10:53 -0800 writes:
>
> > On Fri, Mar 3, 2017 at 9:55 AM, Hadley Wickham
> >  wrote:
> >>> But, how you propose a warning-to-error transition
> >>> should be made without wreaking havoc?  Just flip the
> >>> switch in R-devel and see CRAN and Bioconductor packages
> >>> break overnight?  Particularly Bioconductor devel might
> >>> become non-functional (since at times it requires
> >>> R-devel).  For my own code / packages, I would be able
> >>> to handle such a change, but I'm completely out of
> >>> control if one of the package I'm depending on does not
> >>> provide a quick fix (with the only option to remove
> >>> package tests for those dependencies).
> >>
> >> Generally, a package can not be on CRAN if it has any
> >> warnings, so I don't think this change would have any
> >> impact on CRAN packages.  Isn't this also true for
> >> bioconductor?
>
> > Having a tests/warn.R file with:
>
> > warning("boom")
>
> > passes through R CMD check --as-cran unnoticed.
>
> Yes, indeed.. you are right Henrik  that many/most R warning()s would
> not produce  R CMD check  'WARNING's ..
>
> I think Hadley and I fell into the same mental pit of concluding
> that such warning()s  from   if()  ...
> would not currently happen in CRAN / Bioc packages and hence
> turning them to errors would not have a direct effect.
>
> With your 2nd e-mail of saying that you'd propose such an option
> only for a few releases of R you've indeed clarified your intent
> to me.
> OTOH, I would prefer using an environment variable (as you've
> proposed as an alternative)  which is turned "active"  at the
> beginning only manually or  for the  "CRAN incoming" checks of
> the CRAN team (and bioconductor submission checks?)
> and later for  '--as-cran'  etc until it eventually becomes the
> unconditional behavior of R (and the env.variable is no longer used).
>
> Martin
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Control statements with condition with greater than one should give error (not just warning) [PATCH]

2017-03-04 Thread Martin Maechler
> Henrik Bengtsson 
> on Fri, 3 Mar 2017 10:10:53 -0800 writes:

> On Fri, Mar 3, 2017 at 9:55 AM, Hadley Wickham
>  wrote:
>>> But, how you propose a warning-to-error transition
>>> should be made without wreaking havoc?  Just flip the
>>> switch in R-devel and see CRAN and Bioconductor packages
>>> break overnight?  Particularly Bioconductor devel might
>>> become non-functional (since at times it requires
>>> R-devel).  For my own code / packages, I would be able
>>> to handle such a change, but I'm completely out of
>>> control if one of the package I'm depending on does not
>>> provide a quick fix (with the only option to remove
>>> package tests for those dependencies).
>> 
>> Generally, a package can not be on CRAN if it has any
>> warnings, so I don't think this change would have any
>> impact on CRAN packages.  Isn't this also true for
>> bioconductor?

> Having a tests/warn.R file with:

> warning("boom")

> passes through R CMD check --as-cran unnoticed.  

Yes, indeed.. you are right Henrik  that many/most R warning()s would
not produce  R CMD check  'WARNING's ..

I think Hadley and I fell into the same mental pit of concluding
that such warning()s  from   if()  ...
would not currently happen in CRAN / Bioc packages and hence
turning them to errors would not have a direct effect.

With your 2nd e-mail of saying that you'd propose such an option
only for a few releases of R you've indeed clarified your intent
to me.
OTOH, I would prefer using an environment variable (as you've
proposed as an alternative)  which is turned "active"  at the
beginning only manually or  for the  "CRAN incoming" checks of
the CRAN team (and bioconductor submission checks?)
and later for  '--as-cran'  etc until it eventually becomes the
unconditional behavior of R (and the env.variable is no longer used).

Martin

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] can we override "if" in R?

2017-03-04 Thread Da Zheng
I'm just curious. Why making "if" generic is even more dangerous?

Best,
Da

On Sat, Mar 4, 2017 at 1:22 PM, Gábor Csárdi  wrote:
> `!` is a generic, `if` is not. You can define an `if` that is generic,
> but this might be even more dangerous
>
> ❯ `if` <- function(a, b, c) UseMethod("if")
> ❯ `if.default` <- function(a,b,c) base::`if`(a, b, c)
> ❯ `if.foo` <- function(a, b, c) FALSE
> ❯ a <- structure(42, class = "foo")
>
> ❯ if (a) TRUE else FALSE
> [1] FALSE
>
> ❯ if (1) TRUE else FALSE
> [1] TRUE
>
> Gabor
>
> On Sat, Mar 4, 2017 at 5:47 PM, Da Zheng  wrote:
>> Thanks.
>> Can I override it for a specific class?
>> I can do that for operators such as "!". For example, "!.fm" works for
>> objects of the class "fm".
>> It seems I can't do the same for "if".
>>
>> Best,
>> Da
>>
>> On Sat, Mar 4, 2017 at 12:41 PM, Gábor Csárdi  wrote:
>>> You can. Perhaps needless to say, be careful with this.
>>>
>>> ❯ `if` <- function(...) FALSE
>>> ❯ if (TRUE) TRUE else FALSE
>>> [1] FALSE
>>>
>>> G.
>>>
>>> On Sat, Mar 4, 2017 at 5:36 PM, Da Zheng  wrote:
 Hello,

 I heard we can override almost everything in R. Is it possible to
 override "if" keyword in R to evaluate my own object instead of a
 logical value?

 Thanks,
 Da

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Bioc-devel] question on bioconductor/package citation

2017-03-04 Thread Michael Lawrence
On Sat, Mar 4, 2017 at 6:13 AM, Dwivedi, Bhakti 
wrote:

> Hi,
>
>
>
> I have a few general questions. With such a rigorous peer-review process
> in place for new package submissions in Bioconductor, I was wondering if
> there is a way to assess the package acceptance rate?
>
>
>
> The reason I asked, I want to include the Bioconductor package citation in
> my NIH bio-sketch; however, given the format requirements, I cannot provide
> a URL and the unfortunately the release citation is not recognized similar
> to a citation for a typical journal article. Have anyone thought of a
> Bioconductor software journal? Is there a better way to cite a package that
> I am unware of? Would appreciate your help and suggestions.
>
>
>
In terms of impact, things like the number of downloads and number of
reverse dependencies are probably good metrics.


>
> Also, I am really interested in becoming a Bioconductor member/participant
> and volunteering as a code/documentation reviewer or contributor to a part
> of a project. Is there someone I can contact to achieve this or get an idea
> of what may be required to get there?
>
>
>
My opinion on ways to contribute to Bioconductor include:
1) Using Bioconductor, popularizing it and contributing feedback
2) Contributing packages (that integrate with and extend the platform, not
just to distribute a package)
3) Reviewing packages (great practice for getting better at developing your
own)
4) Providing training, workshops, etc, including at the Bioc conference
5) Contributing workflow tutorials/articles, including through the F1000
channel
6) Answering questions on the support site

I'm sure I'm missing some. Another avenue, not yet established, would be
formal, public working groups / projects towards specific aims. For
example, the MultiAssayExperiment was close to that. We could also identify
gaps or decaying areas in the infrastructure and ask for help instead of
spending core group resources. That would require some trust, and the
avenues above would be ways of gaining it. The move to git(hub) would give
us an issue tracker, pull requests, review mechanisms, etc for managing the
process.



> Thank you.
>
>
>
> Regards,
>
> Bhakti
>
>
>
>
>
>
> 
>
> This e-mail message (including any attachments) is for...{{dropped:10}}

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


Re: [Rd] can we override "if" in R?

2017-03-04 Thread Gábor Csárdi
`!` is a generic, `if` is not. You can define an `if` that is generic,
but this might be even more dangerous

❯ `if` <- function(a, b, c) UseMethod("if")
❯ `if.default` <- function(a,b,c) base::`if`(a, b, c)
❯ `if.foo` <- function(a, b, c) FALSE
❯ a <- structure(42, class = "foo")

❯ if (a) TRUE else FALSE
[1] FALSE

❯ if (1) TRUE else FALSE
[1] TRUE

Gabor

On Sat, Mar 4, 2017 at 5:47 PM, Da Zheng  wrote:
> Thanks.
> Can I override it for a specific class?
> I can do that for operators such as "!". For example, "!.fm" works for
> objects of the class "fm".
> It seems I can't do the same for "if".
>
> Best,
> Da
>
> On Sat, Mar 4, 2017 at 12:41 PM, Gábor Csárdi  wrote:
>> You can. Perhaps needless to say, be careful with this.
>>
>> ❯ `if` <- function(...) FALSE
>> ❯ if (TRUE) TRUE else FALSE
>> [1] FALSE
>>
>> G.
>>
>> On Sat, Mar 4, 2017 at 5:36 PM, Da Zheng  wrote:
>>> Hello,
>>>
>>> I heard we can override almost everything in R. Is it possible to
>>> override "if" keyword in R to evaluate my own object instead of a
>>> logical value?
>>>
>>> Thanks,
>>> Da
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] can we override "if" in R?

2017-03-04 Thread Da Zheng
Thanks.
Can I override it for a specific class?
I can do that for operators such as "!". For example, "!.fm" works for
objects of the class "fm".
It seems I can't do the same for "if".

Best,
Da

On Sat, Mar 4, 2017 at 12:41 PM, Gábor Csárdi  wrote:
> You can. Perhaps needless to say, be careful with this.
>
> ❯ `if` <- function(...) FALSE
> ❯ if (TRUE) TRUE else FALSE
> [1] FALSE
>
> G.
>
> On Sat, Mar 4, 2017 at 5:36 PM, Da Zheng  wrote:
>> Hello,
>>
>> I heard we can override almost everything in R. Is it possible to
>> override "if" keyword in R to evaluate my own object instead of a
>> logical value?
>>
>> Thanks,
>> Da
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] can we override "if" in R?

2017-03-04 Thread Da Zheng
Hello,

I heard we can override almost everything in R. Is it possible to
override "if" keyword in R to evaluate my own object instead of a
logical value?

Thanks,
Da

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Bioc-devel] question on bioconductor/package citation

2017-03-04 Thread Martin Morgan

On 03/04/2017 09:13 AM, Dwivedi, Bhakti wrote:

Hi,



I have a few general questions. With such a rigorous peer-review
process in place for new package submissions in Bioconductor, I was
wondering if there is a way to assess the package acceptance rate?


One could summarize the number times the '3a. accepted' (118) tag is 
associated with closed issues, versus '3b. declined' (9; packages are 
sometimes marked as 'declined' for reasons not related to the review 
process; packages reviewed in the same issue, e.g., software and 
experiment data packages, are only counted once).


  https://github.com/Bioconductor/Contributions/issues

We (I) view the review process as an opportunity to improve the 
technical quality of submitted packages (the output of the review 
process is a technically better package than the input), rather than to 
pass judgment on scientific merit or impose an absolute threshold on 
technical quality. I'm not sure how this fits with standard measures of 
academic contribution.




The reason I asked, I want to include the Bioconductor package
citation in my NIH bio-sketch; however, given the format
requirements, I cannot provide a URL and the unfortunately the
release citation is not recognized similar to a citation for a
typical journal article. Have anyone thought of a Bioconductor
software journal? Is there a better way to cite a package that I am
unware of? Would appreciate your help and suggestions.


Not sure what you mean about 'cannot provide a URL' but in case it's not 
known the url https://bioconductor.org/packages/ always 
points to the current release version of your package or, if a new 
package and only available in devel, the devel version.


The F1000 Bioconductor channel represents one publication venue, with 
the emphasis there on utility of the package within the overall 
Bioconductor ecosystem.


  https://f1000research.com/channels/bioconductor





Also, I am really interested in becoming a Bioconductor
member/participant and volunteering as a code/documentation reviewer
or contributor to a part of a project. Is there someone I can contact
to achieve this or get an idea of what may be required to get there?


We would like to enable more widespread community participation in the 
review process, and will try to provide an update in the not too distant 
future.


Martin Morgan
Bioconductor





Thank you.



Regards,

Bhakti








This e-mail message (including any attachments) is for...{{dropped:11}}


___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


[Bioc-devel] question on bioconductor/package citation

2017-03-04 Thread Dwivedi, Bhakti
Hi,



I have a few general questions. With such a rigorous peer-review process in 
place for new package submissions in Bioconductor, I was wondering if there is 
a way to assess the package acceptance rate?



The reason I asked, I want to include the Bioconductor package citation in my 
NIH bio-sketch; however, given the format requirements, I cannot provide a URL 
and the unfortunately the release citation is not recognized similar to a 
citation for a typical journal article. Have anyone thought of a Bioconductor 
software journal? Is there a better way to cite a package that I am unware of? 
Would appreciate your help and suggestions.



Also, I am really interested in becoming a Bioconductor member/participant and 
volunteering as a code/documentation reviewer or contributor to a part of a 
project. Is there someone I can contact to achieve this or get an idea of what 
may be required to get there?



Thank you.



Regards,

Bhakti








This e-mail message (including any attachments) is for t...{{dropped:14}}

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel