[R-pkg-devel] discovering if a function in a package is called under RStudio

2018-02-09 Thread Georgi Boshnakov
Hi,

Is there a canonical way for a function to discover if it has been called in a 
session under RStudio?
I looked the at the options() but none seems to be dedicated to this.

Thanks,
Georgi Boshnakov


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


Re: [R-pkg-devel] discovering if a function in a package is called under RStudio

2018-02-09 Thread Joris Meys
Hi,

you can use rstudioapi::isAvailable() for that. There's other packages with
similar functionality (eg the assertive package), and you can always check
whether Sys.getenv("RSTUDIO") == "1".
Cheers
Joris


On Fri, Feb 9, 2018 at 9:09 AM, Georgi Boshnakov <
georgi.boshna...@manchester.ac.uk> wrote:

> Hi,
>
> Is there a canonical way for a function to discover if it has been called
> in a session under RStudio?
> I looked the at the options() but none seems to be dedicated to this.
>
> Thanks,
> Georgi Boshnakov
>
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>



-- 
Joris Meys
Statistical consultant

Department of Data Analysis and Mathematical Modelling
Ghent University
Coupure Links 653, B-9000 Gent (Belgium)


tel: +32 (0)9 264 61 79
---
Biowiskundedagen 2017-2018
http://www.biowiskundedagen.ugent.be/

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

[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] discovering if a function in a package is called under RStudio

2018-02-09 Thread Georgi Boshnakov
Many thanks, I should have looked at rstudioapi, from rstudioapi::isAvailable():

> .Platform$GUI
[1] "RStudio"

Georgi

From: jorism...@gmail.com [mailto:jorism...@gmail.com] On Behalf Of Joris Meys
Sent: 09 February 2018 09:09
To: Georgi Boshnakov
Cc: r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] discovering if a function in a package is called 
under RStudio

Hi,
you can use rstudioapi::isAvailable() for that. There's other packages with 
similar functionality (eg the assertive package), and you can always check 
whether Sys.getenv("RSTUDIO") == "1".
Cheers
Joris


On Fri, Feb 9, 2018 at 9:09 AM, Georgi Boshnakov 
mailto:georgi.boshna...@manchester.ac.uk>> 
wrote:
Hi,

Is there a canonical way for a function to discover if it has been called in a 
session under RStudio?
I looked the at the options() but none seems to be dedicated to this.

Thanks,
Georgi Boshnakov


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



--
Joris Meys
Statistical consultant

Department of Data Analysis and Mathematical Modelling
Ghent University
Coupure Links 653, B-9000 Gent (Belgium)


tel: +32 (0)9 264 61 79
---
Biowiskundedagen 2017-2018
http://www.biowiskundedagen.ugent.be/

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

[[alternative HTML version deleted]]

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


[R-pkg-devel] Hedgehog property based testing

2018-02-09 Thread Huw Campbell
Hi all,

I have ported hedgehog, a property based testing library
 from Haskell to R, and would
really like folks to use it and test the API hard before I release it on
CRAN. I have been using it with great success for my projects for a while;
and have also uncovered a few real bugs in R libraries in the wild.

Hedgehog is similar to *quickcheck* in philosophy and fully compatible with
Hadley Wickham's *testthat* library, so should be easy to integrate. The
idea is to write property tests like this:

test_that("Reverse of reverse is identity",
  forall(gen.c(gen.element(1:100)), function(xs) expect_equal(rev(rev(xs)), xs))
)

Give it a shot and please do hit me up with any questions.

For all that I like about R, I think it can be tough to write robust
code which handles all the edge
cases one could throw at it, so great testing is invaluable.

Cheers,
Huw

[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] Fwd: Collaboration Request: h2o R Package Function Cheatsheet

2018-02-09 Thread Juan Telleria Ruiz de Aguirre
Yes,

Thank you for the tips Suzen.

I will try to finish it in a couple of weeks from now, hope it is useful.

Kind regards,
Juan Telleria

2018-02-04 23:49 GMT+01:00 Suzen, Mehmet :
> Dear Juan,
>
> A good start. A suggestion for versioning, instead of versioning on
> file names, maybe you can use git tags for release numbers. Github
> will create a release bundle with you release tag.  RStudio has nice
> templates for cheatsheets too [1], I think you use their template  and
> possibly you could contribute there.
>
> Best,
> -m
>
> [1] 
> https://www.rstudio.com/resources/cheatsheets/how-to-contribute-a-cheatsheet/
>
>
> Mehmet Süzen
> 
>
>
> On 3 February 2018 at 23:00, Juan Telleria Ruiz de Aguirre
>  wrote:
>> Dear R Package Developers,
>>
>> I have just started doing a cheatsheet for h2o R Package:
>>
>> https://cran.r-project.org/web/packages/h2o/index.html
>>
>> So if anyone is interested in contribution, I attach what I have done
>> till now in Github:
>>
>> https://github.com/jtelleria/H2O-Cheatsheet
>>
>> A H2O.ai Statistical Algorithms Cheatsheet already exists, but the new
>> one will be focused on R h2o package functions:
>>
>> https://github.com/h2oai/h2o-tutorials/blob/master/training/h2o_algos/h2o_algos_cheat_sheet_04_25_17.pdf
>>
>> Kind regards,
>> Juan Telleria
>>
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

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