Re: [R-pkg-devel] Detritus reported by r-hub builder check_for_cran

2022-01-16 Thread Rainer M Krug
Thanks Uwe,

I’ll try submission to CRAN beginning of next week.

Rainer



On 15 Jan 2022 at 00:40:00, Uwe Ligges 
wrote:

>
>
> On 14.01.2022 15:14, Rainer M Krug wrote:
>
> Hi
>
>
> I want to re-submit an archived package to CRAN, and I get, when checking
>
> on hub builder, the following Note:
>
>
> * checking for detritus in the temp directory ... NOTE
>
> Found the following files/directories:
>
>'lastMiKTeXException'
>
>
> If it is not part of your package it may be related due to failing
> MikTeX when building, e.g., the manual or vignettes?
> If hat worked otherwise I'd ignore it unless it also happens on CRAN.
>
> Best,
> Uwe Ligges
>
>
>
> See
>
>
> https://builder.r-hub.io/status/dmdScheme_1.2.7.tar.gz-b5319e2e45f14b43b997198525243159
>
>
>
> Any suggestions how this can be fixed?
>
>
> Thanks.
>
>
> I also get from the following,
>
>
> * checking for non-standard things in the check directory ... NOTE
>
> Found the following files/directories:
>
>‘Formula’ ‘Hmisc’ ‘WikidataQueryServiceR’ ‘WikidataR’ ‘WikipediR’
>
>‘XML’ ‘ape’ ‘assertthat’ ‘backports’ ‘bit’ ‘bit64’ ‘bold’ ‘checkmate’
>
>‘clipr’ ‘conditionz’ ‘crul’ ‘data.table’ ‘emeScheme’ ‘fastmatch’
>
>‘foreach’ ‘ggplot2’ ‘gridExtra’ ‘gtable’ ‘htmlTable’ ‘htmlwidgets’
>
>‘httpcode’ ‘igraph’ ‘isoband’ ‘iterators’ ‘jpeg’ ‘latticeExtra’
>
>‘natserv’ ‘pbapply’ ‘phangorn’ ‘plyr’ ‘png’ ‘quadprog’ ‘ratelimitr’
>
>‘readr’ ‘rentrez’ ‘reshape’ ‘ritis’ ‘rncl’ ‘rotl’ ‘rredlist’
>
>‘solrium’ ‘taxize’ ‘triebeard’ ‘tzdb’ ‘urltools’ ‘viridis’ ‘vroom’
>
>    ‘wikitaxa’ ‘worrms’ ‘zoo’
>
>
>
> (
>
>
> https://builder.r-hub.io/status/dmdScheme_1.2.7.tar.gz-396cbbe5d27d4707add4317628dd6cf8
>
> )
>
> but I assume that is not relevant.
>
> —
>
>
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
>
> UCT), Dipl. Phys. (Germany)
>
>
> Orcid ID: -0002-7490-0066
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
> Office Y34-J-74
>
> Winterthurerstrasse 190
>
> 8075 Zürich
>
> Switzerland
>
>
> Office: +41 (0)44 635 47 64
>
> Cell:+41 (0)78 630 66 57
>
> email:  rainer.k...@uzh.ch
>
> rai...@krugs.de
>
> Skype: RMkrug
>
>
> PGP: 0x0F52F982
>
>
>
>
> Rainer M. Krug
>
>
> Orcid ID: -0002-7490-0066
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
> Office Y34-J-74
>
> Winterthurerstrasse 190
>
> 8075 Zürich
>
> Switzerland
>
>
> Office: +41 (0)44 635 47 64
>
> Cell:+41 (0)78 630 66 57
>
> email:  rainer.k...@uzh.ch
>
> rai...@krugs.de
>
> Skype: RMkrug
>
>
> PGP: 0x0F52F982
>
>
>
>
> Rainer M. Krug
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
> Office Y34-J-74
>
> Winterthurerstrasse 190
>
> 8075 Zürich
>
> Switzerland
>
>
> Office: +41 (0)44 635 47 64
>
> Cell:+41 (0)78 630 66 57
>
> email:  rainer.k...@uzh.ch
>
> rai...@krugs.de
>
> Skype: RMkrug
>
>
> PGP: 0x0F52F982
>
>
>
>
> Rainer M. Krug
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
>
>
> Office: +41 (0)44 635 47 64
>
> Cell:+41 (0)78 630 66 57
>
> email:  rainer.k...@uzh.ch
>
> rai...@krugs.de
>
> Skype: RMkrug
>
>
> PGP: 0x0F52F982
>
>
>
>
> Rainer M. Krug
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
>
>
>
>
>
> Rainer M. Krug
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
>
>
> R.M
>
>
>
> Rainer M. Krug
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
>
>
> R.M.Ke
>
>
>
> Rainer M. Krug
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
>
>
> R.M.Keug@
>
>
>
> Rainer M. Krug
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
>
>
> R.M.Keug@gmail.
>
>
>
> Rainer M. Krug
>
>
> Department of Evolutionary Biology and Environmental Studies
>
> University of Zürich
>
>
>
> r.m.k...@gmail.com
>
>
>
> Rainer M. Krug
>
>
> D

[R-pkg-devel] Detritus reported by r-hub builder check_for_cran

2022-01-14 Thread Rainer M Krug
Hi

I want to re-submit an archived package to CRAN, and I get, when checking
on hub builder, the following Note:

* checking for detritus in the temp directory ... NOTE
Found the following files/directories:
  'lastMiKTeXException'


See
https://builder.r-hub.io/status/dmdScheme_1.2.7.tar.gz-b5319e2e45f14b43b997198525243159


Any suggestions how this can be fixed?

Thanks.

I also get from the following,

* checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
  ‘Formula’ ‘Hmisc’ ‘WikidataQueryServiceR’ ‘WikidataR’ ‘WikipediR’
  ‘XML’ ‘ape’ ‘assertthat’ ‘backports’ ‘bit’ ‘bit64’ ‘bold’ ‘checkmate’
  ‘clipr’ ‘conditionz’ ‘crul’ ‘data.table’ ‘emeScheme’ ‘fastmatch’
  ‘foreach’ ‘ggplot2’ ‘gridExtra’ ‘gtable’ ‘htmlTable’ ‘htmlwidgets’
  ‘httpcode’ ‘igraph’ ‘isoband’ ‘iterators’ ‘jpeg’ ‘latticeExtra’
  ‘natserv’ ‘pbapply’ ‘phangorn’ ‘plyr’ ‘png’ ‘quadprog’ ‘ratelimitr’
  ‘readr’ ‘rentrez’ ‘reshape’ ‘ritis’ ‘rncl’ ‘rotl’ ‘rredlist’
  ‘solrium’ ‘taxize’ ‘triebeard’ ‘tzdb’ ‘urltools’ ‘viridis’ ‘vroom’
  ‘wikitaxa’ ‘worrms’ ‘zoo’


(
https://builder.r-hub.io/status/dmdScheme_1.2.7.tar.gz-396cbbe5d27d4707add4317628dd6cf8
)
but I assume that is not relevant.
—

Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:+41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982



Rainer M. Krug

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:+41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982



Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:+41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982



Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


Office: +41 (0)44 635 47 64
Cell:+41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982



Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich





Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


R.M


Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


R.M.Ke


Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


R.M.Keug@


Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


R.M.Keug@gmail.


Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


r.m.k...@gmail.com


Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


r.m.k...@gmail.com



Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


r.m.k...@gmail.com




Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


r.m.k...@gmail.com


---

Rainer M. Krug

Department of Evolutionary Biology and Environmental Studies
University of Zürich


r.m.k...@gmail.com

[[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] Pre-test check fails with "non-standard things in check directory" on one platform

2021-09-02 Thread Rainer M Krug



> On 2 Sep 2021, at 14:02, Duncan Murdoch  wrote:
> 
> On 02/09/2021 6:29 a.m., Rainer M Krug wrote:
>> Hi
>> I submitted an update of the dmdScheme package and got the response back 
>> from the pre-submission check that it failed on one platform with the Note:
>> * checking for non-standard things in the check directory ... NOTE
>> Found the following files/directories:
>>   ‘emeScheme’
>> (Links to the logs are here:
>> package dmdScheme_1.2.7.tar.gz does not pass the incoming checks 
>> automatically, please see the following pre-tests:
>> Windows: 
>> <https://win-builder.r-project.org/incoming_pretest/dmdScheme_1.2.7_20210901_161445/Windows/00check.log>
>> Status: OK
>> Debian: 
>> <https://win-builder.r-project.org/incoming_pretest/dmdScheme_1.2.7_20210901_161445/Debian/00check.log>
>> Status: 1 NOTE
>> )
>> This only occurs on the CRAN server and I can not reproduce it with rhub or 
>> locally on my Mac with 4.1.1.
>> I can currently not check the level version, as it seems to be not compiling 
>> for Mac.
>> Could somebody give any guidance, how to fix this? Which one is the “check 
>> directory"?
> 
> That's the one reported at the start of the log as the "log directory".
> 
> Fixing it is a little harder without more info.  That looks like a name that 
> you would have created, given the name of your package.  You should look at 
> your package source to figure out if there's an example or test that created 
> it but didn't delete it.
> 

Thanks Duncan.


I will look at it and come back when I have further questions.

Rainer


> Duncan Murdoch

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[alternative HTML version deleted]]

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


[R-pkg-devel] Pre-test check fails with "non-standard things in check directory" on one platform

2021-09-02 Thread Rainer M Krug
Hi

I submitted an update of the dmdScheme package and got the response back from 
the pre-submission check that it failed on one platform with the Note:

* checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
  ‘emeScheme’

(Links to the logs are here:

package dmdScheme_1.2.7.tar.gz does not pass the incoming checks automatically, 
please see the following pre-tests:
Windows: 
<https://win-builder.r-project.org/incoming_pretest/dmdScheme_1.2.7_20210901_161445/Windows/00check.log>
Status: OK
Debian: 
<https://win-builder.r-project.org/incoming_pretest/dmdScheme_1.2.7_20210901_161445/Debian/00check.log>
Status: 1 NOTE

)

This only occurs on the CRAN server and I can not reproduce it with rhub or 
locally on my Mac with 4.1.1.

I can currently not check the level version, as it seems to be not compiling 
for Mac. 

Could somebody give any guidance, how to fix this? Which one is the “check 
directory"? 

Thanks,

Rainer

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982

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


Re: [R-pkg-devel] CRAN, API packages, Keys and tests

2020-09-07 Thread Rainer M Krug
Hi Josh,

Thanks for the thumbs-up for CRAN.

With the secure variable on Travis - that is exactly what I am doing.

Thanks a lot,

Rainer


> On 4 Sep 2020, at 16:22, Joshua Ulrich  wrote:
> 
> On Fri, Sep 4, 2020 at 9:20 AM Joshua Ulrich  <mailto:josh.m.ulr...@gmail.com>> wrote:
>> 
>> Hi Rainer,
>> 
>> You could set an environment variable with the API key, and only run
>> the tests if the variable is set.
>> 
> Sorry, I missed that you're already doing this.  I confirm that it
> works for CRAN.  I also set my API key as a private/secure variable on
> TravisCI, so the tests will run there.
> 
> IIRC, testthat does something similar. You could look at that pattern,
> since it works on CRAN for many packages.
> 
>> Here's an example that I use:
>> https://github.com/joshuaulrich/quantmod/blob/master/tests/test_getSymbols.R#L4
>> 
>> Best,
>> Josh
>> 
>> On Fri, Sep 4, 2020 at 3:25 AM Rainer M Krug  wrote:
>>> 
>>> I know this has been asked a few times - but I can’t find anything which 
>>> might help me.
>>> 
>>> I have a package (https://github.com/rkrug/ROriginStamp) which wraps around 
>>> API calls to OriginStamp (https://originstamp.com) to obtain trusted time 
>>> stamps.
>>> 
>>> The package works, but the tests are the problem on remote machines.
>>> 
>>> My question is:
>>> 
>>> 1) I have disabled all tests and all examples if there is no environmental 
>>> variable set with the API Key - is this OK for CRAN?
>>> 2) If not, how can I make this CRAN compliant?
>>> 
>>> Thanks,
>>> 
>>> Rainer
>>> 
>>> 
>>> --
>>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>>> UCT), Dipl. Phys. (Germany)
>>> 
>>> Orcid ID: -0002-7490-0066
>>> 
>>> Department of Evolutionary Biology and Environmental Studies
>>> University of Zürich
>>> Office Y34-J-74
>>> Winterthurerstrasse 190
>>> 8075 Zürich
>>> Switzerland
>>> 
>>> Office: +41 (0)44 635 47 64
>>> Cell:   +41 (0)78 630 66 57
>>> email:  rainer.k...@uzh.ch
>>>rai...@krugs.de
>>> Skype: RMkrug
>>> 
>>> PGP: 0x0F52F982
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>>> UCT), Dipl. Phys. (Germany)
>>> 
>>> Orcid ID: -0002-7490-0066
>>> 
>>> Department of Evolutionary Biology and Environmental Studies
>>> University of Zürich
>>> Office Y34-J-74
>>> Winterthurerstrasse 190
>>> 8075 Zürich
>>> Switzerland
>>> 
>>> Office: +41 (0)44 635 47 64
>>> Cell:   +41 (0)78 630 66 57
>>> email:  rainer.k...@uzh.ch
>>>rai...@krugs.de
>>> Skype: RMkrug
>>> 
>>> PGP: 0x0F52F982
>>> 
>>> __
>>> R-package-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>> 
>> 
>> 
>> --
>> Joshua Ulrich  |  about.me/joshuaulrich
>> FOSS Trading  |  www.fosstrading.com
> 
> 
> 
> -- 
> Joshua Ulrich  |  about.me/joshuaulrich <http://about.me/joshuaulrich>
> FOSS Trading  |  www.fosstrading.com <http://www.fosstrading.com/>
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[alternative HTML version deleted]]

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


[R-pkg-devel] CRAN, API packages, Keys and tests

2020-09-04 Thread Rainer M Krug
I know this has been asked a few times - but I can’t find anything which might 
help me.

I have a package (https://github.com/rkrug/ROriginStamp) which wraps around API 
calls to OriginStamp (https://originstamp.com) to obtain trusted time stamps.

The package works, but the tests are the problem on remote machines.

My question is:

1) I have disabled all tests and all examples if there is no environmental 
variable set with the API Key - is this OK for CRAN?
2) If not, how can I make this CRAN compliant?

Thanks,

Rainer


--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982





--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982

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


Re: [R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?

2020-07-13 Thread Rainer M Krug



> On 13 Jul 2020, at 11:31, Paul SAVARY  wrote:
> 
> Thanks you too.
> 
> That is also what I am doing. Note that I am downloading jar files into a 
> directory created in rappdirs::user_data_dir() using the command 
> download.file(url, ...).

Jup - exactly.

> 
> If I do not specify 'mode='wb'' in download.file() on a Windows OS, 
> downloaded jar file is corrupted and cannot be used because a text file is 
> created in which \n are converted into \r\n, which does not make sens for a 
> binary file.

Yes - the `mode = “wb”` bit me as well - developing on MacOS, testing on travis 
on GitHub with Linux and Mac,, and what did I get, a corrupt jar on windows.

Thanks,

Rainer

> 
> I hope it can help
> Cheers
> 
> Paul Savary - PhD Student
> UMR 6049 ThéMA (Besançon), UMR 6282 Biogéosciences (Dijon), ARP-Astrance 
> (Paris) 
> Phone number : +33.6.30.97.34.27 
> Research topics: population genetics, landscape ecology, graph theory, 
> spatial statistics
> 
> - Mail original -
> De: "Rainer M Krug" 
> À: "Maëlle SALMON" 
> Cc: "r-package-devel" 
> Envoyé: Lundi 13 Juillet 2020 11:15:10
> Objet: Re: [R-pkg-devel]  Proper CRAN way - How to handle dependency of java 
> jar file?
> 
> Thanks Maëlle - that is exactly what I am doing at the moment.
> 
> Cheers,
> 
> Rainer
> 
> 
>> On 13 Jul 2020, at 08:17, Maëlle SALMON  wrote:
>> 
>> Regarding where to save the jar file, you might be interested in "app dirs" 
>> (via tools::R_user_dir() in R from 4.0, the rappdirs package, the hoardr 
>> package) cf 
>> https://blog.r-hub.io/2020/03/12/user-preferences/#not-so-temporary-files3
>> 
>> Maëlle.
>> 
>> Den tisdag 23 juni 2020 14:56:30 CEST, Rainer M Krug  
>> skrev: 
>> 
>> 
>> 
>> 
>> 
>> Thanks Duncan.
>> 
>>> On 23 Jun 2020, at 14:35, Duncan Murdoch  wrote:
>>> 
>>> Your assumption that .jar files are not allowed is wrong:  a number of 
>>> packages contain them:  rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ...  
>>> There's a specific mention about how to include them in the CRAN policy 
>>> document:
>> 
>> That’s good to know.
>> 
>>> 
>>> "For Java .class and .jar files, the sources should be in a top-level java 
>>> directory in the source package (or that directory should explain how they 
>>> can be obtained)."
>> 
>> So a tet file in the inst/jar directory giving the link to the GitHub repo 
>> would be fine in this case?
>> 
>>> 
>>> If you still decide not to include your .jar file (maybe it is too big, for 
>>> example),
>> 
>> 
>> I guess it would be stretching it a bit, as the jar file is 8.2 MB, and 
>> plantuml has regular continuous updates, so I would prefer to keep it 
>> dynamic.
>> 
>> 
>>> then I think your option 1 is unusable for those people who can't write to 
>>> the library location because of permission problems. (Admin privileges are 
>>> often necessary to install packages in the main library.)  Generally I 
>>> think everyone can install packages somewhere, but users do really get 
>>> confused when they have multiple library locations, possibly each 
>>> containing a different version of a package.
>> 
>> So the suggested option would be to have a function, which 
>> 1) ask the user to create a directory in the home folder 
>> 2) download the jar file into that directory or, when no permission is 
>> granted, into the tmpdir()
>> 
>> Thanks, no major changes necessary for that,
>> 
>> Rainer
>> 
>> 
>>> 
>>> Duncan Murdoch
>>> 
>>> On 23/06/2020 8:18 a.m., Rainer M Krug wrote:
>>>> Hi
>>>> I have a package called `plantuml` (https://github.com/rkrug/plantuml) 
>>>> which converts plantuml code to UML graphs. It uses for this the java 
>>>> program https://plantuml.com which is Open Source.
>>>> As it is not allowed to distribute a binary with an R package, I use the 
>>>> approach of a function which downloads the jar file into the directory 
>>>> `system.file("jar/plantuml.jar", package = "plantuml”)`.
>>>> This works nicely, and at the moment, the function is called automatically 
>>>> before the plantuml.jar is used.
>>>> Now I would like to submit the package to CRAN. I can’t find the 
>>>> guidelines anymore, so I am asking here:
>>>> What is the appropriate way of handling this?
>>

Re: [R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?

2020-07-13 Thread Rainer M Krug
Thanks Maëlle - that is exactly what I am doing at the moment.

Cheers,

Rainer


> On 13 Jul 2020, at 08:17, Maëlle SALMON  wrote:
> 
> Regarding where to save the jar file, you might be interested in "app dirs" 
> (via tools::R_user_dir() in R from 4.0, the rappdirs package, the hoardr 
> package) cf 
> https://blog.r-hub.io/2020/03/12/user-preferences/#not-so-temporary-files3
> 
> Maëlle.
> 
> Den tisdag 23 juni 2020 14:56:30 CEST, Rainer M Krug  skrev: 
> 
> 
> 
> 
> 
> Thanks Duncan.
> 
>> On 23 Jun 2020, at 14:35, Duncan Murdoch  wrote:
>> 
>> Your assumption that .jar files are not allowed is wrong:  a number of 
>> packages contain them:  rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ...  
>> There's a specific mention about how to include them in the CRAN policy 
>> document:
> 
> That’s good to know.
> 
>> 
>> "For Java .class and .jar files, the sources should be in a top-level java 
>> directory in the source package (or that directory should explain how they 
>> can be obtained)."
> 
> So a tet file in the inst/jar directory giving the link to the GitHub repo 
> would be fine in this case?
> 
>> 
>> If you still decide not to include your .jar file (maybe it is too big, for 
>> example),
> 
> 
> I guess it would be stretching it a bit, as the jar file is 8.2 MB, and 
> plantuml has regular continuous updates, so I would prefer to keep it dynamic.
> 
> 
>> then I think your option 1 is unusable for those people who can't write to 
>> the library location because of permission problems. (Admin privileges are 
>> often necessary to install packages in the main library.)  Generally I think 
>> everyone can install packages somewhere, but users do really get confused 
>> when they have multiple library locations, possibly each containing a 
>> different version of a package.
> 
> So the suggested option would be to have a function, which 
> 1) ask the user to create a directory in the home folder 
> 2) download the jar file into that directory or, when no permission is 
> granted, into the tmpdir()
> 
> Thanks, no major changes necessary for that,
> 
> Rainer
> 
> 
>> 
>> Duncan Murdoch
>> 
>> On 23/06/2020 8:18 a.m., Rainer M Krug wrote:
>>> Hi
>>> I have a package called `plantuml` (https://github.com/rkrug/plantuml) 
>>> which converts plantuml code to UML graphs. It uses for this the java 
>>> program https://plantuml.com which is Open Source.
>>> As it is not allowed to distribute a binary with an R package, I use the 
>>> approach of a function which downloads the jar file into the directory 
>>> `system.file("jar/plantuml.jar", package = "plantuml”)`.
>>> This works nicely, and at the moment, the function is called automatically 
>>> before the plantuml.jar is used.
>>> Now I would like to submit the package to CRAN. I can’t find the guidelines 
>>> anymore, so I am asking here:
>>> What is the appropriate way of handling this?
>>> I can think of a at least two ways of making it obvious to the user, that a 
>>> binary is downloaded:
>>> 1) if the file plantuml.jar is not present, ask the user to run the 
>>> function `updatePlantumlJar()` which downloads the jar to the original 
>>> location in the package directory
>>> 2) tell the user to download the file manually and to put it somewhere, 
>>> where the package will find it
>>> I would prefer the first version, as the plantuml.jar would be in the 
>>> package directory, where usually nobody but the package is doing stuff.
>>> Any suggestions on how I could make this “CRAN conform”?
>>> Thanks a lot,
>>> Rainer
>>> --
>>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>>> UCT), Dipl. Phys. (Germany)
>>> Orcid ID: -0002-7490-0066
>>> Department of Evolutionary Biology and Environmental Studies
>>> University of Zürich
>>> Office Y34-J-74
>>> Winterthurerstrasse 190
>>> 8075 Zürich
>>> Switzerland
>>> Office:+41 (0)44 635 47 64
>>> Cell:  +41 (0)78 630 66 57
>>> email:  rainer.k...@uzh.ch
>>> rai...@krugs.de
>>> Skype:RMkrug
>>> PGP: 0x0F52F982
>>> --
>>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>>> UCT), Dipl. Phys. (Germany)
>>> Orcid ID: -0002-7490-0066
>>> Department of Evolutionary Biology and Environmental Studies
>>> University of Zürich

Re: [R-pkg-devel] Making possible the use of external java codes by downloading it

2020-07-03 Thread Rainer M Krug
Pleas keep the list in CC so that they know tat you have a solution. Thanks.

There is the function “Sys.which()” which returns the full path to an 
executable. Although in many cases correct, it can be that Java is installed 
but not in the path. So I have a variable called “java.path” which is used when 
java is called - the default is set to `java.path <- Sys.which("java”)`

Plesase see https://github.com/rkrug/plantuml/blob/dev/R/aaa.R 
<https://github.com/rkrug/plantuml/blob/dev/R/aaa.R> and 
https://github.com/rkrug/plantuml/blob/dev/R/options.R 
<https://github.com/rkrug/plantuml/blob/dev/R/options.R> how I implemented it.



> On 3 Jul 2020, at 11:09, Paul SAVARY  wrote:
> 
> I thank you Rainer.
> 
> Then, I think I will allow users to download the .jar file from an url into 
> the user data directory.
> I get the path to this directory with "rappdirs::user_data_dir()".
> 
> Do you know how to check if java is installed on their machine?
> 
> I thought about using something like that:
> 
> jv <- system2("java", args = c("-version"))
> if(jv != 0){
>   stop("You have to install java on your machine.")
> }
> 
> Cheers
> Paul
> 
> De: "Rainer M Krug" 
> À: "Paul SAVARY" 
> Cc: "r-package-devel" 
> Envoyé: Vendredi 3 Juillet 2020 10:33:15
> Objet: Re: [R-pkg-devel] Making possible the use of external java codes by 
> downloading it
> 
> Please check out the recent thread "Proper CRAN way - How to handle 
> dependency of java jar file?” About a week ago - I asked essentially the same 
> questions.
> 
> Cheers,
> 
> Rainer
> 
> 
> 
> On 3 Jul 2020, at 10:15, Paul SAVARY  <mailto:paul.sav...@univ-fcomte.fr>> wrote:
> 
> Hello everyone,
> 
> I would like to include external java codes (.jar files) to a package in 
> order to speed up some computations.
> However, this would increase the package size above 5 Mb and this code would 
> not be working for users without java installation. 
> 
> Instead, I could include a default parameter in the function calling another 
> R package making the same computation but more slowly. It would be best for 
> users without java on their computer.
> Besides, I could allow users to download the external java code from a stable 
> url, and include in the R function all the arguments to launch this java code 
> (wrapper for the java code). When downloaded, the jar file should be copied 
> directly into the extdata directory in the user computer if possible.
> 
> Does it seem feasible to you? 
> 
> Many thanks 
> Regards
> Paul
> 
> __
> R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing 
> list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel 
> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>
> 
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
> UCT), Dipl. Phys. (Germany)
> 
> Orcid ID: -0002-7490-0066
> 
> Department of Evolutionary Biology and Environmental Studies
> University of Zürich
> Office Y34-J-74
> Winterthurerstrasse 190
> 8075 Zürich
> Switzerland
> 
> Office:   +41 (0)44 635 47 64
> Cell: +41 (0)78 630 66 57
> email:      rainer.k...@uzh.ch <mailto:rainer.k...@uzh.ch>
>   rai...@krugs.de <mailto:rai...@krugs.de>
> Skype: RMkrug
> 
> PGP: 0x0F52F982
> 
> 
> 
> 

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] Making possible the use of external java codes by downloading it

2020-07-03 Thread Rainer M Krug
Please check out the recent thread "Proper CRAN way - How to handle dependency 
of java jar file?” About a week ago - I asked essentially the same questions.

Cheers,

Rainer



> On 3 Jul 2020, at 10:15, Paul SAVARY  wrote:
> 
> Hello everyone,
> 
> I would like to include external java codes (.jar files) to a package in 
> order to speed up some computations.
> However, this would increase the package size above 5 Mb and this code would 
> not be working for users without java installation. 
> 
> Instead, I could include a default parameter in the function calling another 
> R package making the same computation but more slowly. It would be best for 
> users without java on their computer.
> Besides, I could allow users to download the external java code from a stable 
> url, and include in the R function all the arguments to launch this java code 
> (wrapper for the java code). When downloaded, the jar file should be copied 
> directly into the extdata directory in the user computer if possible.
> 
> Does it seem feasible to you? 
> 
> Many thanks 
> Regards
> Paul
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] [EXTERNAL] Proper CRAN way - How to handle dependency of java jar file?

2020-06-23 Thread Rainer M Krug
Perfect. You also mention the “backports”  package - how can I use that one to 
be able to also support old versions of R?

Thanks,

Rainer


> On 23 Jun 2020, at 16:34, Hong Ooi  wrote:
> 
> Yes, that’s the one.
>  
> From: Rainer M Krug  
> Sent: Tuesday, 23 June 2020 11:12 PM
> To: Hong Ooi 
> Cc: R Package Devel 
> Subject: Re: [EXTERNAL] [R-pkg-devel] Proper CRAN way - How to handle 
> dependency of java jar file?
>  
> Thanks Hong - I like that.
>  
> I found that package in the tools::R_user_dir() package - us that the one?
>  
> Rainer
>  
> 
> 
> On 23 Jun 2020, at 15:07, Hong Ooi  <mailto:hong...@microsoft.com>> wrote:
>  
> Another possibility, if you want the jar to be dynamic and also have a 
> standard location for it, is to write it to the R config/user dir. This is 
> available via R_user_dir() in R 4.0 (and earlier versions via the backports 
> package). An older alternative that still works is to use the rappdirs 
> package.
> 
> 
> -Original Message-----
> From: R-package-devel  <mailto:r-package-devel-boun...@r-project.org>> On Behalf Of Rainer M Krug
> Sent: Tuesday, 23 June 2020 10:48 PM
> To: Duncan Murdoch  <mailto:murdoch.dun...@gmail.com>>
> Cc: R Package Devel  <mailto:r-package-devel@r-project.org>>
> Subject: [EXTERNAL] Re: [R-pkg-devel] Proper CRAN way - How to handle 
> dependency of java jar file?
> 
> Thanks Duncan.
> 
> 
> On 23 Jun 2020, at 14:35, Duncan Murdoch  <mailto:murdoch.dun...@gmail.com>> wrote:
> 
> Your assumption that .jar files are not allowed is wrong:  a number of 
> packages contain them:  rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ...  
> There's a specific mention about how to include them in the CRAN policy 
> document:
> 
> That’s good to know.
> 
> 
> 
> "For Java .class and .jar files, the sources should be in a top-level java 
> directory in the source package (or that directory should explain how they 
> can be obtained)."
> 
> So a tet file in the inst/jar directory giving the link to the GitHub repo 
> would be fine in this case?
> 
> 
> 
> If you still decide not to include your .jar file (maybe it is too big, for 
> example),
> 
> 
> I guess it would be stretching it a bit, as the jar file is 8.2 MB, and 
> plantuml has regular continuous updates, so I would prefer to keep it dynamic.
> 
> 
> 
> then I think your option 1 is unusable for those people who can't write to 
> the library location because of permission problems. (Admin privileges are 
> often necessary to install packages in the main library.)  Generally I think 
> everyone can install packages somewhere, but users do really get confused 
> when they have multiple library locations, possibly each containing a 
> different version of a package.
> 
> So the suggested option would be to have a function, which 
> 1) ask the user to create a directory in the home folder 
> 2) download the jar file into that directory or, when no permission is 
> granted, into the tmpdir()
> 
> Thanks, no major changes necessary for that,
> 
> Rainer
> 
> 
> 
> 
> Duncan Murdoch
> 
> On 23/06/2020 8:18 a.m., Rainer M Krug wrote:
> 
> Hi
> I have a package called `plantuml` (https://github.com/rkrug/plantuml 
> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frkrug%2Fplantuml=02%7C01%7Chongooi%40microsoft.com%7C590b1587b3394bb6a8fd08d817770dc9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285147406339418=tDq%2Fnri4fwPoPvupKmloF47d5QH1Vb3J0lb5L17%2Fu%2FY%3D=0>)
>  which converts plantuml code to UML graphs. It uses for this the java 
> program https://plantuml.com 
> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplantuml.com%2F=02%7C01%7Chongooi%40microsoft.com%7C590b1587b3394bb6a8fd08d817770dc9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285147406339418=5vv%2B%2BXZCPuoblNQUH9%2Fyaz8Fg39aV8XlNIMh1RawoU0%3D=0>
>  which is Open Source.
> As it is not allowed to distribute a binary with an R package, I use the 
> approach of a function which downloads the jar file into the directory 
> `system.file("jar/plantuml.jar", package = "plantuml”)`.
> This works nicely, and at the moment, the function is called automatically 
> before the plantuml.jar is used.
> Now I would like to submit the package to CRAN. I can’t find the guidelines 
> anymore, so I am asking here:
> What is the appropriate way of handling this?
> I can think of a at least two ways of making it obvious to the user, that a 
> binary is downloaded:
> 1) if the file plantuml.jar is not present, ask the user to run the function 
> `updatePlantumlJar()` which downloads the jar t

Re: [R-pkg-devel] [EXTERNAL] Proper CRAN way - How to handle dependency of java jar file?

2020-06-23 Thread Rainer M Krug
Thanks Hong - I like that.

I found that package in the tools::R_user_dir() package - us that the one?

Rainer


> On 23 Jun 2020, at 15:07, Hong Ooi  wrote:
> 
> Another possibility, if you want the jar to be dynamic and also have a 
> standard location for it, is to write it to the R config/user dir. This is 
> available via R_user_dir() in R 4.0 (and earlier versions via the backports 
> package). An older alternative that still works is to use the rappdirs 
> package.
> 
> 
> -Original Message-
> From: R-package-devel  On Behalf Of 
> Rainer M Krug
> Sent: Tuesday, 23 June 2020 10:48 PM
> To: Duncan Murdoch 
> Cc: R Package Devel 
> Subject: [EXTERNAL] Re: [R-pkg-devel] Proper CRAN way - How to handle 
> dependency of java jar file?
> 
> Thanks Duncan.
> 
>> On 23 Jun 2020, at 14:35, Duncan Murdoch  wrote:
>> 
>> Your assumption that .jar files are not allowed is wrong:  a number of 
>> packages contain them:  rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ...  
>> There's a specific mention about how to include them in the CRAN policy 
>> document:
> 
> That’s good to know.
> 
>> 
>> "For Java .class and .jar files, the sources should be in a top-level java 
>> directory in the source package (or that directory should explain how they 
>> can be obtained)."
> 
> So a tet file in the inst/jar directory giving the link to the GitHub repo 
> would be fine in this case?
> 
>> 
>> If you still decide not to include your .jar file (maybe it is too big, for 
>> example),
> 
> 
> I guess it would be stretching it a bit, as the jar file is 8.2 MB, and 
> plantuml has regular continuous updates, so I would prefer to keep it dynamic.
> 
> 
>> then I think your option 1 is unusable for those people who can't write to 
>> the library location because of permission problems. (Admin privileges are 
>> often necessary to install packages in the main library.)  Generally I think 
>> everyone can install packages somewhere, but users do really get confused 
>> when they have multiple library locations, possibly each containing a 
>> different version of a package.
> 
> So the suggested option would be to have a function, which 
> 1) ask the user to create a directory in the home folder 
> 2) download the jar file into that directory or, when no permission is 
> granted, into the tmpdir()
> 
> Thanks, no major changes necessary for that,
> 
> Rainer
> 
> 
>> 
>> Duncan Murdoch
>> 
>> On 23/06/2020 8:18 a.m., Rainer M Krug wrote:
>>> Hi
>>> I have a package called `plantuml` (https://github.com/rkrug/plantuml) 
>>> which converts plantuml code to UML graphs. It uses for this the java 
>>> program https://plantuml.com which is Open Source.
>>> As it is not allowed to distribute a binary with an R package, I use the 
>>> approach of a function which downloads the jar file into the directory 
>>> `system.file("jar/plantuml.jar", package = "plantuml”)`.
>>> This works nicely, and at the moment, the function is called automatically 
>>> before the plantuml.jar is used.
>>> Now I would like to submit the package to CRAN. I can’t find the guidelines 
>>> anymore, so I am asking here:
>>> What is the appropriate way of handling this?
>>> I can think of a at least two ways of making it obvious to the user, that a 
>>> binary is downloaded:
>>> 1) if the file plantuml.jar is not present, ask the user to run the 
>>> function `updatePlantumlJar()` which downloads the jar to the original 
>>> location in the package directory
>>> 2) tell the user to download the file manually and to put it somewhere, 
>>> where the package will find it
>>> I would prefer the first version, as the plantuml.jar would be in the 
>>> package directory, where usually nobody but the package is doing stuff.
>>> Any suggestions on how I could make this “CRAN conform”?
>>> Thanks a lot,
>>> Rainer
>>> --
>>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>>> UCT), Dipl. Phys. (Germany)
>>> Orcid ID: -0002-7490-0066
>>> Department of Evolutionary Biology and Environmental Studies
>>> University of Zürich
>>> Office Y34-J-74
>>> Winterthurerstrasse 190
>>> 8075 Zürich
>>> Switzerland
>>> Office: +41 (0)44 635 47 64
>>> Cell:   +41 (0)78 630 66 57
>>> email:  rainer.k...@uzh.ch
>>> rai...@krugs.de
>>> Skype: RMkrug
>>> PGP: 0x0F52F982

Re: [R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?

2020-06-23 Thread Rainer M Krug
Thanks Duncan.

> On 23 Jun 2020, at 14:35, Duncan Murdoch  wrote:
> 
> Your assumption that .jar files are not allowed is wrong:  a number of 
> packages contain them:  rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ...  
> There's a specific mention about how to include them in the CRAN policy 
> document:

That’s good to know.

> 
> "For Java .class and .jar files, the sources should be in a top-level java 
> directory in the source package (or that directory should explain how they 
> can be obtained)."

So a tet file in the inst/jar directory giving the link to the GitHub repo 
would be fine in this case?
 
> 
> If you still decide not to include your .jar file (maybe it is too big, for 
> example),


I guess it would be stretching it a bit, as the jar file is 8.2 MB, and 
plantuml has regular continuous updates, so I would prefer to keep it dynamic.


> then I think your option 1 is unusable for those people who can't write to 
> the library location because of permission problems. (Admin privileges are 
> often necessary to install packages in the main library.)  Generally I think 
> everyone can install packages somewhere, but users do really get confused 
> when they have multiple library locations, possibly each containing a 
> different version of a package.

So the suggested option would be to have a function, which 
1) ask the user to create a directory in the home folder 
2) download the jar file into that directory or, when no permission is granted, 
into the tmpdir()

Thanks, no major changes necessary for that,

Rainer
 

> 
> Duncan Murdoch
> 
> On 23/06/2020 8:18 a.m., Rainer M Krug wrote:
>> Hi
>> I have a package called `plantuml` (https://github.com/rkrug/plantuml) which 
>> converts plantuml code to UML graphs. It uses for this the java program 
>> https://plantuml.com which is Open Source.
>> As it is not allowed to distribute a binary with an R package, I use the 
>> approach of a function which downloads the jar file into the directory 
>> `system.file("jar/plantuml.jar", package = "plantuml”)`.
>> This works nicely, and at the moment, the function is called automatically 
>> before the plantuml.jar is used.
>> Now I would like to submit the package to CRAN. I can’t find the guidelines 
>> anymore, so I am asking here:
>> What is the appropriate way of handling this?
>> I can think of a at least two ways of making it obvious to the user, that a 
>> binary is downloaded:
>> 1) if the file plantuml.jar is not present, ask the user to run the function 
>> `updatePlantumlJar()` which downloads the jar to the original location in 
>> the package directory
>> 2) tell the user to download the file manually and to put it somewhere, 
>> where the package will find it
>> I would prefer the first version, as the plantuml.jar would be in the 
>> package directory, where usually nobody but the package is doing stuff.
>> Any suggestions on how I could make this “CRAN conform”?
>> Thanks a lot,
>> Rainer
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys. (Germany)
>> Orcid ID: -0002-7490-0066
>> Department of Evolutionary Biology and Environmental Studies
>> University of Zürich
>> Office Y34-J-74
>> Winterthurerstrasse 190
>> 8075 Zürich
>> Switzerland
>> Office:  +41 (0)44 635 47 64
>> Cell:+41 (0)78 630 66 57
>> email:  rainer.k...@uzh.ch
>>  rai...@krugs.de
>> Skype: RMkrug
>> PGP: 0x0F52F982
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys. (Germany)
>> Orcid ID: -0002-7490-0066
>> Department of Evolutionary Biology and Environmental Studies
>> University of Zürich
>> Office Y34-J-74
>> Winterthurerstrasse 190
>> 8075 Zürich
>> Switzerland
>> Office:  +41 (0)44 635 47 64
>> Cell:+41 (0)78 630 66 57
>> email:  rainer.k...@uzh.ch
>>  rai...@krugs.de
>> Skype: RMkrug
>> PGP: 0x0F52F982
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[alternative HTML version deleted]]

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


[R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?

2020-06-23 Thread Rainer M Krug
Hi

I have a package called `plantuml` (https://github.com/rkrug/plantuml) which 
converts plantuml code to UML graphs. It uses for this the java program 
https://plantuml.com which is Open Source. 

As it is not allowed to distribute a binary with an R package, I use the 
approach of a function which downloads the jar file into the directory 
`system.file("jar/plantuml.jar", package = "plantuml”)`. 

This works nicely, and at the moment, the function is called automatically 
before the plantuml.jar is used.

Now I would like to submit the package to CRAN. I can’t find the guidelines 
anymore, so I am asking here: 

What is the appropriate way of handling this?

I can think of a at least two ways of making it obvious to the user, that a 
binary is downloaded:

1) if the file plantuml.jar is not present, ask the user to run the function 
`updatePlantumlJar()` which downloads the jar to the original location in the 
package directory

2) tell the user to download the file manually and to put it somewhere, where 
the package will find it

I would prefer the first version, as the plantuml.jar would be in the package 
directory, where usually nobody but the package is doing stuff.

Any suggestions on how I could make this “CRAN conform”?

Thanks a lot,

Rainer

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982





--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982

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


Re: [R-pkg-devel] Strange leftovers after check by CRAN

2020-03-20 Thread Rainer M Krug
That’s good to know - thanks.

As I am checking with —as-cran, these were all on anyway.

Cheers,

Rainer


> On 20 Mar 2020, at 10:37, Tomas Kalibera  wrote:
> 
> On 3/19/20 6:03 PM, Max Turgeon wrote:
>> Is there perhaps a typo in the environment variable name? This line suggests 
>> there should be an underscore at the beginning too:
>> 
>> https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L6028 
>> <https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L6028>
> Also the correct name is in R Internals, where the variable is documented.
> 
> Tomas
> 
>> 
>> Max Turgeon
>> Assistant Professor
>> Department of Statistics
>> Department of Computer Science
>> University of Manitoba
>> maxturgeon.ca<http://maxturgeon.ca> <http://maxturgeon.ca/>
>> 
>> 
>> ____
>> From: R-package-devel  
>> <mailto:r-package-devel-boun...@r-project.org> on behalf of Rainer M Krug 
>>  <mailto:rai...@krugs.de>
>> Sent: March 19, 2020 11:21:08 AM
>> To: R Package Devel
>> Subject: [R-pkg-devel] Strange leftovers after check by CRAN
>> 
>> Hi
>> 
>> My package dmdScheme gets always one note after submission to CRAN:
>> 
>> 
>> ...
>> * checking for detritus in the temp directory ... NOTE
>> Found the following files/directories:
>>   �calibre_4.99.4_tmp_8yyefjbo� �calibre_4.99.4_tmp_ft15_af5�
>>   �calibre_4.99.4_tmp_jy4e07d6� �calibre_4.99.4_tmp_oxx_azo2�
>>   �runtime-hornik�
>> * DONE
>> 
>> These leftovers are only reported from CRAN, and locally everything is fine. 
>> Uwe recommended to set the environmental variable
>> 
>> R_CHECK_THINGS_IN_CHECK_DIR_=true
>> 
>> But this does not change anything, I get the report back
>> 
>> ...
>> * checking for detritus in the temp directory ... OK
>> * DONE
>> 
>> Any suggestions how I can track down the where these are coming from? Each 
>> time my package has to go through a manual check at CRAN�
>> 
>> Thanks,
>> 
>> Rainer
>> 
>> 
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys. (Germany)
>> 
>> Orcid ID: -0002-7490-0066
>> 
>> Department of Evolutionary Biology and Environmental Studies
>> University of Z�rich
>> Office Y34-J-74
>> Winterthurerstrasse 190
>> 8075 Z�rich
>> Switzerland
>> 
>> Office: +41 (0)44 635 47 64
>> Cell:+41 (0)78 630 66 57
>> email:  rainer.k...@uzh.ch <mailto:rainer.k...@uzh.ch>
>> rai...@krugs.de <mailto:rai...@krugs.de>
>> Skype: RMkrug
>> 
>> PGP: 0x0F52F982
>> 
>> __
>> R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing 
>> list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel 
>> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>
>> 
>>  [[alternative HTML version deleted]]
>> 
>> 
>> 
>> __
>> R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing 
>> list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel 
>> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>
> 

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] Strange leftovers after check by CRAN

2020-03-19 Thread Rainer M Krug





> On 19 Mar 2020, at 17:45, Kevin Ushey  wrote:
> 
> FWIW if I search for calibre_4.99.4 I see that it's a package on the
> Debian repositories (a packaged copy of https://calibre-ebook.com/ it
> seems?) so it seems like something is intentionally or unintentionally
> trying to download and use that.

OK - that explains, why I not seeing the detritus on my Mac. 

> 
> The only hint I see is that Bookdown does support calibre as an output.

I have no package book down installed on my system, wherefore dmdScheme does 
not depend on it.

> 
> As an aside, I'm not sure if that's a typo but you're missing a
> leading underscore in the envvar:
> 
> _R_CHECK_THINGS_IN_CHECK_DIR_=true

Might be - but I tried it with the _ and also no detritus (see above).

I don’t feel like installing a virtual machine / docker to follow this up.

OK.

Thanks,

Rainer


> 
> Best,
> Kevin
> 
> On Thu, Mar 19, 2020 at 9:21 AM Rainer M Krug  wrote:
>> 
>> Hi
>> 
>> My package dmdScheme gets always one note after submission to CRAN:
>> 
>> 
>> ...
>> * checking for detritus in the temp directory ... NOTE
>> Found the following files/directories:
>>  ‘calibre_4.99.4_tmp_8yyefjbo’ ‘calibre_4.99.4_tmp_ft15_af5’
>>  ‘calibre_4.99.4_tmp_jy4e07d6’ ‘calibre_4.99.4_tmp_oxx_azo2’
>>  ‘runtime-hornik’
>> * DONE
>> 
>> These leftovers are only reported from CRAN, and locally everything is fine. 
>> Uwe recommended to set the environmental variable
>> 
>> R_CHECK_THINGS_IN_CHECK_DIR_=true
>> 
>> But this does not change anything, I get the report back
>> 
>> ...
>> * checking for detritus in the temp directory ... OK
>> * DONE
>> 
>> Any suggestions how I can track down the where these are coming from? Each 
>> time my package has to go through a manual check at CRAN…
>> 
>> Thanks,
>> 
>> Rainer
>> 
>> 
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys. (Germany)
>> 
>> Orcid ID: -0002-7490-0066
>> 
>> Department of Evolutionary Biology and Environmental Studies
>> University of Zürich
>> Office Y34-J-74
>> Winterthurerstrasse 190
>> 8075 Zürich
>> Switzerland
>> 
>> Office: +41 (0)44 635 47 64
>> Cell:   +41 (0)78 630 66 57
>> email:  rainer.k...@uzh.ch
>>rai...@krugs.de
>> Skype: RMkrug
>> 
>> PGP: 0x0F52F982
>> 
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[alternative HTML version deleted]]

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


[R-pkg-devel] Strange leftovers after check by CRAN

2020-03-19 Thread Rainer M Krug
Hi

My package dmdScheme gets always one note after submission to CRAN:


...
* checking for detritus in the temp directory ... NOTE
Found the following files/directories:
  ‘calibre_4.99.4_tmp_8yyefjbo’ ‘calibre_4.99.4_tmp_ft15_af5’
  ‘calibre_4.99.4_tmp_jy4e07d6’ ‘calibre_4.99.4_tmp_oxx_azo2’
  ‘runtime-hornik’
* DONE

These leftovers are only reported from CRAN, and locally everything is fine. 
Uwe recommended to set the environmental variable 

R_CHECK_THINGS_IN_CHECK_DIR_=true

But this does not change anything, I get the report back

...
* checking for detritus in the temp directory ... OK
* DONE

Any suggestions how I can track down the where these are coming from? Each time 
my package has to go through a manual check at CRAN…

Thanks,

Rainer


--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982

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


Re: [R-pkg-devel] R CMD build hanging for some but not all packages

2020-02-12 Thread Rainer M Krug
Thanks Gabor.

The speed is OK (much faster than copying everything), but in my case, all 
files are ignored, although the package builds fine. So the .Rbuildignore is 
fine for R. It looks as followed:

```
^.*\.Rproj$
^\.Rproj\.user$
^Makefile$
^Readme\\.$
^README\..*$

## Temporary folder
^tmp$
^temp$

## Example Data Folder
^inst/0.raw.data$
^inst/1.pre-processed.data$

```

Rainer



> On 11 Feb 2020, at 15:30, Gábor Csárdi  wrote:
> 
> It is actually rather complicated, because .Rbuildignore can have
> regular expressions, that refer to files or directories, and for the
> latter you need to ignore the whole directory. You can look up in the
> R source code how R does it, maybe you can reuse that code.
> 
> Here is a quick and dirty function that does it, mostly based on code
> from the remotes package. It is very slow for me currently, mainly
> because my .git directory has thousands of files. Still faster than
> copying a huge directory I guess.
> 
> Speeding it up is left as an exercise. :) I think doing a manual
> filtering for /.git initially would probably make it fast enough. Oh,
> it is also not super tested. :)
> 
> without_ignored <- function(path = ".",
>extra = c("^\\.git$", "^\\.gitignore$")) {
>  paths <- dir(path, recursive = TRUE, all.files = TRUE)
>  ignore_file <- file.path(path, ".Rbuildignore")
>  ignore <- c(extra, tools:::get_exclude_patterns())
> 
>  if (file.exists(ignore_file)) {
>ignore <- c(ignore, readLines(ignore_file, warn = FALSE))
>  }
> 
>  vlapply <- function(X, FUN, ..., USE.NAMES = TRUE) {
>vapply(X, FUN, logical(1L), ..., USE.NAMES = USE.NAMES)
>  }
> 
>  matches_ignores <- function(x) {
>any(vlapply(ignore, grepl, x, perl = TRUE, ignore.case = TRUE))
>  }
> 
>  directories <- function(paths) {
>dirs <- unique(dirname(paths))
>out <- dirs[dirs != "."]
>while(length(dirs) > 0 && any(dirs != ".")) {
>  out <- unique(c(out, dirs[dirs != "."]))
>  dirs <- unique(dirname(dirs))
>}
>sort(out)
>  }
> 
>  # We need to search for the paths as well as directories in the path, so
>  # `^foo$` matches `foo/bar`
>  should_ignore <- function(path) {
>any(vlapply(c(path, directories(path)), matches_ignores))
>  }
> 
>  paths[! vlapply(paths, should_ignore)]
> }
> 
> Gabor
> 
> On Tue, Feb 11, 2020 at 2:23 PM Ben Bolker  wrote:
>> 
>> 
>>   Something like file.copy( setdiff(list.files(recursive=TRUE)),
>> scan(".Rbuildignore", what=character())),  to = destdir) ?
>> 
>> On 2020-02-11 8:50 a.m., Rainer Krug wrote:
>>> Thinking about it - what would be the easiest way, to copy the package, 
>>> excluding files in .Rbuidignore, into the temp directory?
>>> 
>>> I would like to use directly the .Rbuildignore file, to exclude the files 
>>> from copying.
>>> 
>>> Any suggestions?
>>> 
>>> 
>>>> On 11 Feb 2020, at 10:20, Rainer M Krug  wrote:
>>>> 
>>>> 
>>>> 
>>>>> On 11 Feb 2020, at 09:54, Gábor Csárdi  wrote:
>>>>> 
>>>>> On Tue, Feb 11, 2020 at 8:52 AM Rainer M Krug  wrote:
>>>>>> On 11 Feb 2020, at 09:42, Gábor Csárdi  wrote:
>>>>>> On Tue, Feb 11, 2020 at 8:38 AM Rainer M Krug  wrote:
>>>>>> On 10 Feb 2020, at 17:58, Gábor Csárdi  wrote:
>>>>>> 
>>>>>> Maybe you have large, ignored files in the package directory? R first
>>>>>> creates a copy of the whole directory and only applies `.Rbuildignore`
>>>>>> after that.
>>>>>> 
>>>>>> THANKS - you solved my question without me having to answer it. As I am 
>>>>>> using a makefile to build the package, I can easily rename the ignored 
>>>>>> directories before calling build.
>>>>>> 
>>>>>> But the question is why are these ignored directories scanned before 
>>>>>> building the package? They should be ignored anyway?
>>>>>> 
>>>>>> Rainer
>>>>>> 
>>>>>> 
>>>>>> A makefile is a good idea, but I would rather move the files that are
>>>>>> needed to a temporary directory, instead of temporarily renaming
>>>>>> unneeded files, because if the makefile fails, then you won't restore
>>>>>> them and your project will be in a broken state.
>>>>>> 
>>>>>

Re: [R-pkg-devel] [EXTERNAL] R CMD build hanging for some but not all packages

2020-02-11 Thread Rainer M Krug
Yes - I would suggest that this would be a useful change. As the files in 
.Rbuildignore are ignored anyway during build. So the ignoring could be done at 
the copying stage and not during the building stage?

Rainer


> On 11 Feb 2020, at 13:20, Hong Ooi  wrote:
> 
> They are scanned probably because R CMD build does something like cp * to 
> copy everything to a temp folder first up, before processing it. An argument 
> could be made that it should manually loop through all files and dirs, 
> checking each against .Rbuildignore before copying.
> 
> 
> From: Rainer M Krug  
> Sent: Tuesday, 11 February 2020 7:38 PM
> To: Gábor Csárdi 
> Cc: Hong Ooi ; r-package-devel@r-project.org
> Subject: [EXTERNAL] Re: [R-pkg-devel] R CMD build hanging for some but not 
> all packages
> 
> 
> 
> 
> On 10 Feb 2020, at 17:58, Gábor Csárdi <mailto:csardi.ga...@gmail.com> wrote:
> 
> Maybe you have large, ignored files in the package directory? R first
> creates a copy of the whole directory and only applies `.Rbuildignore`
> after that.
> 
> 
> 
> THANKS - you solved my question without me having to answer it. As I am using 
> a makefile to build the package, I can easily rename the ignored directories 
> before calling build.
> 
> But the question is why are these ignored directories scanned before building 
> the package? They should be ignored anyway?
> 
> Rainer
> 
> 
> 
> 
> Gabor
> 
> On Mon, Feb 10, 2020 at 4:54 PM Hong Ooi via R-package-devel
> <mailto:r-package-devel@r-project.org> wrote:
> 
> 
> Actually, cancel that: it finished successfully, but took 3 minutes to 
> prepare the package:
> 
> r$> devtools::build()
> v  checking for file 'C:\Users\hongo\Documents\GitHub\AzureStor/DESCRIPTION'
> -  preparing 'AzureStor': (3m 4s)
> v  checking DESCRIPTION meta-information ...
> -  installing the package to build vignettes
> v  creating vignettes (6.5s)
> -  checking for LF line-endings in source and make files and shell scripts 
> (13.8s)
> -  checking for empty or unneeded directories
> -  building 'AzureStor_3.1.0.9000.tar.gz'
> 
> This is really weird, I'm used to the package prep step taking 10 seconds at 
> most.
> 
> 
> -Original Message-
> From: R-package-devel <mailto:r-package-devel-boun...@r-project.org> On 
> Behalf Of Hong Ooi via R-package-devel
> Sent: Tuesday, 11 February 2020 3:50 AM
> To: mailto:r-package-devel@r-project.org
> Subject: [EXTERNAL] [R-pkg-devel] R CMD build hanging for some but not all 
> packages
> 
> This is with R 3.6.2 on Windows 10 Pro 1909.
> 
> In the last couple of weeks, devtools::build() and devtools::check() have 
> started hanging on some, but not all, of my packages. After some poking 
> around, I discovered that it's actually R CMD build that is having problems, 
> right after the "checking for file 'DESCRIPTION'" step.
> 
> A reproducible example can be found by cloning my AzureStor package: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2FAzureStor=02%7C01%7Chongooi%40microsoft.com%7C7962d328eb984556a2e708d7aecdc0db%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637170071036915332=cmY0VPEiEgcuhI%2B4wIT8iIimQhq7751IJ0KHdsPaMtg%3D=0
>  If you run "R CMD build ." in the package directory, it should hang. This is 
> a relatively simple package that doesn't require compilation, although it 
> does import some commonly-used packages like httr, curl, jsonlite and xml2.
> 
> As far as I can tell, R on Ubuntu works fine. What's going on?
> 
> __
> mailto:R-package-devel@r-project.org mailing list
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel=02%7C01%7Chongooi%40microsoft.com%7C7962d328eb984556a2e708d7aecdc0db%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637170071036925320=XbCKzK3no6v5asG5assjd7oxy%2BOk9or2LbS%2Fkg8GESw%3D=0
> 
> __
> mailto:R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 
> __
> mailto:R-package-devel@r-project.org mailing list
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel=02%7C01%7Chongooi%40microsoft.com%7C7962d328eb984556a2e708d7aecdc0db%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637170071036925320=XbCKzK3no6v5asG5assjd7oxy%2BOk9or2LbS%2Fkg8GESw%3D=0
> 
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
> UCT), Dipl. Phys. (Germany)
> Orcid ID: -0002-7490-0066
> 
> Department of Evolutionary Biolo

Re: [R-pkg-devel] R CMD build hanging for some but not all packages

2020-02-11 Thread Rainer M Krug



> On 11 Feb 2020, at 09:54, Gábor Csárdi  wrote:
> 
> On Tue, Feb 11, 2020 at 8:52 AM Rainer M Krug  wrote:
>> On 11 Feb 2020, at 09:42, Gábor Csárdi  wrote:
>> On Tue, Feb 11, 2020 at 8:38 AM Rainer M Krug  wrote:
>> On 10 Feb 2020, at 17:58, Gábor Csárdi  wrote:
>> 
>> Maybe you have large, ignored files in the package directory? R first
>> creates a copy of the whole directory and only applies `.Rbuildignore`
>> after that.
>> 
>> THANKS - you solved my question without me having to answer it. As I am 
>> using a makefile to build the package, I can easily rename the ignored 
>> directories before calling build.
>> 
>> But the question is why are these ignored directories scanned before 
>> building the package? They should be ignored anyway?
>> 
>> Rainer
>> 
>> 
>> A makefile is a good idea, but I would rather move the files that are
>> needed to a temporary directory, instead of temporarily renaming
>> unneeded files, because if the makefile fails, then you won't restore
>> them and your project will be in a broken state.
>> 
>> 
>> You are right. Having two targets (prepare build, finalise build) which move 
>> the files and put them back afterwards would be the best option (and make 
>> the build call both).
>> 
>> Is there a way to have an .onExit() type function in a makefile?
> 
> The on-exit mechanism can fail as well. It is just better not to move
> around the files of the project I think.

True.

Thanks,

Rainer

> 
> Gabor
> 
> [...]

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] R CMD build hanging for some but not all packages

2020-02-11 Thread Rainer M Krug



> On 11 Feb 2020, at 09:42, Gábor Csárdi  wrote:
> 
> On Tue, Feb 11, 2020 at 8:38 AM Rainer M Krug  <mailto:rai...@krugs.de>> wrote:
>> 
>> 
>> 
>> On 10 Feb 2020, at 17:58, Gábor Csárdi  wrote:
>> 
>> Maybe you have large, ignored files in the package directory? R first
>> creates a copy of the whole directory and only applies `.Rbuildignore`
>> after that.
>> 
>> THANKS - you solved my question without me having to answer it. As I am 
>> using a makefile to build the package, I can easily rename the ignored 
>> directories before calling build.
>> 
>> But the question is why are these ignored directories scanned before 
>> building the package? They should be ignored anyway?
>> 
>> Rainer
> 
> A makefile is a good idea, but I would rather move the files that are
> needed to a temporary directory, instead of temporarily renaming
> unneeded files, because if the makefile fails, then you won't restore
> them and your project will be in a broken state.

You are right. Having two targets (prepare build, finalise build) which move 
the files and put them back afterwards would be the best option (and make the 
build call both).

Is there a way to have an .onExit() type function in a makefile?

Rainer


> 
> Gabor
> 
> [...]

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] R CMD build hanging for some but not all packages

2020-02-11 Thread Rainer M Krug



> On 10 Feb 2020, at 17:58, Gábor Csárdi  wrote:
> 
> Maybe you have large, ignored files in the package directory? R first
> creates a copy of the whole directory and only applies `.Rbuildignore`
> after that.



THANKS - you solved my question without me having to answer it. As I am using a 
makefile to build the package, I can easily rename the ignored directories 
before calling build.

But the question is why are these ignored directories scanned before building 
the package? They should be ignored anyway?

Rainer


> 
> Gabor
> 
> On Mon, Feb 10, 2020 at 4:54 PM Hong Ooi via R-package-devel
>  wrote:
>> 
>> Actually, cancel that: it finished successfully, but took 3 minutes to 
>> prepare the package:
>> 
>> r$> devtools::build()
>> v  checking for file 'C:\Users\hongo\Documents\GitHub\AzureStor/DESCRIPTION'
>> -  preparing 'AzureStor': (3m 4s)
>> v  checking DESCRIPTION meta-information ...
>> -  installing the package to build vignettes
>> v  creating vignettes (6.5s)
>> -  checking for LF line-endings in source and make files and shell scripts 
>> (13.8s)
>> -  checking for empty or unneeded directories
>> -  building 'AzureStor_3.1.0.9000.tar.gz'
>> 
>> This is really weird, I'm used to the package prep step taking 10 seconds at 
>> most.
>> 
>> 
>> -Original Message-
>> From: R-package-devel  On Behalf Of 
>> Hong Ooi via R-package-devel
>> Sent: Tuesday, 11 February 2020 3:50 AM
>> To: r-package-devel@r-project.org
>> Subject: [EXTERNAL] [R-pkg-devel] R CMD build hanging for some but not all 
>> packages
>> 
>> This is with R 3.6.2 on Windows 10 Pro 1909.
>> 
>> In the last couple of weeks, devtools::build() and devtools::check() have 
>> started hanging on some, but not all, of my packages. After some poking 
>> around, I discovered that it's actually R CMD build that is having problems, 
>> right after the "checking for file 'DESCRIPTION'" step.
>> 
>> A reproducible example can be found by cloning my AzureStor package: 
>> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2FAzureStordata=02%7C01%7Chongooi%40microsoft.com%7Cae76a58d39b64b491a1008d7ae4955a9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637169502304943506sdata=RW3TQM2D%2F3X43oGhiywDyKd%2F4oo5hFkOoVwZTUe9cOw%3Dreserved=0
>>  If you run "R CMD build ." in the package directory, it should hang. This 
>> is a relatively simple package that doesn't require compilation, although it 
>> does import some commonly-used packages like httr, curl, jsonlite and xml2.
>> 
>> As far as I can tell, R on Ubuntu works fine. What's going on?
>> 
>> __
>> R-package-devel@r-project.org mailing list
>> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-develdata=02%7C01%7Chongooi%40microsoft.com%7Cae76a58d39b64b491a1008d7ae4955a9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637169502304943506sdata=DPyD6zGGcxq41irkaMfMLyjnmqSB96PiIxIh9N2p%2Ft4%3Dreserved=0
>> 
>> __
>> 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

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] Proper way to ask a user to set permanent variables?

2020-01-17 Thread Rainer M Krug
Hi Dirk,

The package-local environment is definitely a good approach (I use it myself an 
a few packages). And the options() are nice as they represent a standardised 
interface in R (Note to myself: I should use these more in my packages).

But unless I am missing something, these are not persistent between sessions? I 
assume, that is not an issue in your case?

Cheers,

Rainer
 

> On 15 Jan 2020, at 23:47, Dirk Eddelbuettel  wrote:
> 
> 
> Jonathan,
> 
> In all but one (maybe two?) of my packages I found relying on options()
> sufficient. I usually follow the somewhat-common pattern of creating a
> package-local environment in R/init.R or R/zzz.R. I then fill it with values
> reflecting options() (often under a tag starting with the package name)
> and/or environment variables, and sometime also provide 'setters' to update
> the environment values. That have proven to be both good enough and rather
> robust and, as an added benefit, does not depend on anything further.
> 
> Cheers, Dirk
> 
> -- 
> http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] Proper way to ask a user to set permanent variables?

2020-01-14 Thread Rainer M Krug
I second that - it provides the most consistent way of storing information 
permanently.

I was in a similar situation, and ended up using the function at 

https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/master/R/cache.R 
<https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/master/R/cache.R>

And the location `rappdirs::user_config_dir(appname = "dmdScheme", appauthor = 
"dmdScheme”)` as the permanent cache.

I either either 
- use a temporary cache if the cache does not exist
- if the cache does exist, use that one, and
- use the `createPermanent` argument to create the cache so that it can be used.

Cheers,

Rainer


> On 14 Jan 2020, at 17:34, Gábor Csárdi  wrote:
> 
> You can use the rappdirs package to look up the standard places for
> permanent config, cache etc. files. E.g. on macOS:
> 
> ❯ rappdirs::user_cache_dir()
> [1] "/Users/gaborcsardi/Library/Caches"
> 
> Gabor
> 
> On Tue, Jan 14, 2020 at 4:10 PM Jonathan Greenberg  wrote:
>> 
>> Folks:
>> 
>> My package gdalUtils is a wrapper for a set of binaries on disk (the GDAL 
>> Utilities) -- these have about as many places to install as there are people 
>> installing it, and the system environment variables aren't always much help 
>> (they aren't always set) for locating them.  My package is trying to 
>> dummy-proof the usage as much as possible, so one of the things it does is 
>> if it can't find the install, it goes search for the install in, first, 
>> standard locations and runs a short test to see if the install is valid and, 
>> if not, goes on a longer hunt.  Right now, it does this search everytime 
>> someone boots up R and uses it, which slows down the process.
>> 
>> What I'm wondering is twofold:
>> 
>> 1) Are there any packages/methods by which user "preferences" are saved that 
>> don't require saving workspaces (e.g. does R have a standardized 
>> "preferences" location that packages can use).
>> 
>> 2) If the answer to #1 is "no", what is the preferred method for saving 
>> variables for use by packages that are always restored on boot -- e.g. I was 
>> thinking something like .Renviron but I think that's Rstudio only.  I'm 
>> concerned with workspace-type saves since I feel like that often results in 
>> a ton of variables being saved.
>> 
>> Thanks!
>> 
>> --j
>> 
>>[[alternative HTML version deleted]]
>> 
>> __________
>> 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

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] DOI in of package in DESCRIPTION file

2019-12-16 Thread Rainer M Krug
Thanks Robert,

I will add this as well as in the Description field.

Rainer


> On 16 Dec 2019, at 15:52, Robert M. Flight  wrote:
> 
> Are you wanting to provide the DOI for citation purposes? Then I would 
> recommend making sure you have a valid citation file 
> https://r-pkgs.org/inst.html#inst-citation 
> <https://r-pkgs.org/inst.html#inst-citation> (which should be fine having a 
> DOI field), and add it to the README as well.
> 
> -Robert
> 
> Robert M Flight, PhD
> Bioinformatics Research Associate
> Puller of Rabbits from Hats
> Research Parasite
> Resource Center for Stable Isotope Resolved Metabolomics
> Manager, Systems Biology and Omics Integration Journal Club
> Markey Cancer Center
> CC434 Roach Building
> University of Kentucky
> Lexington, KY
> 
> Twitter: @rmflight
> Web: rmflight.github.io <http://rmflight.github.io/>
> ORCID: http://orcid.org/-0001-8141-7788 
> <http://orcid.org/-0001-8141-7788>
> EM rfligh...@gmail.com <mailto:rfligh...@gmail.com>
> PH 502-509-1827 
> 
> To call in the statistician after the experiment is done may be no more than 
> asking him to perform a post-mortem examination: he may be able to say what 
> the experiment died of. - Ronald Fisher
> 
> On Mon, Dec 16, 2019 at 9:43 AM Rainer M Krug  <mailto:rai...@krugs.de>> wrote:
> Hi
> 
> UI am preparing my package for CRAN. I have a DOI for my package, and would 
> like to add Ito the DESCRIPTION file.
> 
> At the moment, I am adding
> 
> DOI: https://zenodo.org/record/3229615 
> <https://zenodo.org/record/3229615>
> 
> To the DESCRIPTION file. This raises not an error during check, but tells me, 
> that DOI is a unknown field.
> 
> Is there a recommended way, of adding the DOI of a package to the DESCRIPTION 
> file? I did not find anything when googling.
> 
> Thanks,
> 
> Rainer
> 
> 
> 
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
> UCT), Dipl. Phys. (Germany)
> 
> Orcid ID: -0002-7490-0066
> 
> Department of Evolutionary Biology and Environmental Studies
> University of Zürich
> Office Y34-J-74
> Winterthurerstrasse 190
> 8075 Zürich
> Switzerland
> 
> Office: +41 (0)44 635 47 64
> Cell:   +41 (0)78 630 66 57
> email:  rainer.k...@uzh.ch <mailto:rainer.k...@uzh.ch>
> rai...@krugs.de <mailto:rai...@krugs.de>
> Skype: RMkrug
> 
> PGP: 0x0F52F982
> 
> __
> R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing 
> list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel 
> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] DOI in of package in DESCRIPTION file

2019-12-16 Thread Rainer M Krug
Thanks Uwe, I will do so.

Rainer


> On 16 Dec 2019, at 15:56, Uwe Ligges  wrote:
> 
> 
> 
> On 16.12.2019 15:34, Rainer M Krug wrote:
>> Hi
>> UI am preparing my package for CRAN. I have a DOI for my package, and would 
>> like to add Ito the DESCRIPTION file.
>> At the moment, I am adding
>>  DOI: https://zenodo.org/record/3229615
> 
> This is not a DOI, the DOI is actually
> 
> 10.5281/zenodo.3229615
> 
> and we do not have a field fo it, but you can cite it within the Description 
> field and link to it via a sentence and DOI such as:
> 
> "See R.M. Krug and O. Petchey (2019) ."
> 
> Best,
> Uwe Ligges
> 
> 
>> To the DESCRIPTION file. This raises not an error during check, but tells 
>> me, that DOI is a unknown field.
>> Is there a recommended way, of adding the DOI of a package to the 
>> DESCRIPTION file? I did not find anything when googling.
>> Thanks,
>> Rainer
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys. (Germany)
>> Orcid ID: -0002-7490-0066
>> Department of Evolutionary Biology and Environmental Studies
>> University of Zürich
>> Office Y34-J-74
>> Winterthurerstrasse 190
>> 8075 Zürich
>> Switzerland
>> Office:  +41 (0)44 635 47 64
>> Cell:+41 (0)78 630 66 57
>> email:  rainer.k...@uzh.ch
>>  rai...@krugs.de
>> Skype: RMkrug
>> PGP: 0x0F52F982
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[alternative HTML version deleted]]

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


[R-pkg-devel] DOI in of package in DESCRIPTION file

2019-12-16 Thread Rainer M Krug
Hi

UI am preparing my package for CRAN. I have a DOI for my package, and would 
like to add Ito the DESCRIPTION file.

At the moment, I am adding

DOI: https://zenodo.org/record/3229615

To the DESCRIPTION file. This raises not an error during check, but tells me, 
that DOI is a unknown field.

Is there a recommended way, of adding the DOI of a package to the DESCRIPTION 
file? I did not find anything when googling.

Thanks,

Rainer



--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982

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


Re: [R-pkg-devel] CRAN submission with "possibly unsafe calls" or alternative approach?

2019-12-06 Thread Rainer M Krug
Thanks for the clarification - I was not aware of that. I will put the 
variables in an environment and call them via a function before submission to 
CRAN..

Thanks,

Rainer


> On 6 Dec 2019, at 12:03, peter dalgaard  wrote:
> 
> I think you may want to rethink the mechanism. 
> 
> Locked bindings are generally there to allow the compiler to make assumptions 
> about the type, etc., of objects (or rather: not make assumptions because it 
> will know what the type is). Unlocking invalidates this and may trigger 
> recompilation or introduce errors. (There are people who know the details 
> much better than I do).
> 
> I seem to recall that people have come up with ways to set up an environment 
> which can contain mutable objects of this sort.
> 
> -pd
> 
>> On 6 Dec 2019, at 10:05 , Rainer M Krug  wrote:
>> 
>> Hi
>> 
>> In my package `dmdScheme` I define three variables. Depending on a state in 
>> the package (a selected metadata schemes) these are set as followed from 
>> within the package:
>> 
>> ```
>> unlockBinding("dmdScheme_example", as.environment("package:dmdScheme"))
>> assign("dmdScheme_example", scheme_example, "package:dmdScheme")
>> lockBinding("dmdScheme_example", as.environment("package:dmdScheme"))
>> 
>> 
>> scheme_raw <- as_dmdScheme_raw(scheme_example)
>> unlockBinding("dmdScheme_raw", as.environment("package:dmdScheme"))
>> assign("dmdScheme_raw", scheme_raw, "package:dmdScheme")
>> lockBinding("dmdScheme_raw", as.environment("package:dmdScheme"))
>> 
>> 
>> scheme <- as_dmdScheme(scheme_raw, keepData = FALSE, checkVersion = FALSE)
>> unlockBinding("dmdScheme", as.environment("package:dmdScheme"))
>> assign("dmdScheme", scheme, "package:dmdScheme")
>> lockBinding("dmdScheme", as.environment("package:dmdScheme”))
>> ```
>> 
>> ( See 
>> https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/b97e7b5ef116476e065aeec1da1050eecbd6adf7/R/scheme_use.R#L37-L49
>>  )
>> 
>> My reasoning is that I want to lock these variables, as they are essential 
>> to the functioning of the package.
>> 
>> But I get, probably not surprising, the following NOTE:
>> 
>> 
>> ```
>> * checking R code for possible problems ... NOTE
>> Found the following possibly unsafe calls:
>> File ‘dmdScheme/R/scheme_use.R’:
>> unlockBinding("dmdScheme_example", as.environment("package:dmdScheme"))
>> unlockBinding("dmdScheme_raw", as.environment("package:dmdScheme"))
>> unlockBinding("dmdScheme", as.environment("package:dmdScheme"))
>> ```
>> 
>> For the submission to CRAN, Can I disregard this note and explain it during 
>> the submission?
>> 
>> My second question concerns the values itself. I set the variables to NULL 
>> in the /data folder in the package, but even after they are set as above, 
>> the valuee in `dmdScheme::dmdScheme` is still NULL:
>> 
>> ```
>>> names(dmdScheme)
>> [1] "Experiment"   "Genus""Treatments"   "Measurement"
>> [5] "DataExtraction"   "DataFileMetaData"
>>> names(dmdScheme::dmdScheme)
>> NULL
>>> 
>> ```
>> 
>> Is there a way, that I can change the value of dmdScheme::… variables during 
>> runtime?
>> 
>> Thanks,
>> 
>> Rainer
>> 
>> 
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys. (Germany)
>> 
>> Orcid ID: 0000-0002-7490-0066
>> 
>> Department of Evolutionary Biology and Environmental Studies
>> University of Zürich
>> Office Y34-J-74
>> Winterthurerstrasse 190
>> 8075 Zürich
>> Switzerland
>> 
>> Office:  +41 (0)44 635 47 64
>> Cell:+41 (0)78 630 66 57
>> email:  rainer.k...@uzh.ch
>>  rai...@krugs.de
>> Skype: RMkrug
>> 
>> PGP: 0x0F52F982
>> 
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 
> -- 
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: pd@cbs.dk  Priv: pda...@gmail.com
> 
> 
> 
> 
> 
> 
> 
> 
> 

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[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] Package write access for storing new files

2019-12-06 Thread Rainer M Krug
Thanks for the tip with rappdirs.

I am just not sure, how I should handle the questions, as it should also run in 
a shiny application?



> On 6 Dec 2019, at 10:12, Gregory Jefferis  wrote:
> 
> I use rappdirs to construct a platform appropriate consistent package 
> download directory. But for CRAN I believe you will need to obtain some kind 
> of user confirmation at least once to allow this behaviour. Best, Greg. 
> 
> Sent from my iPhone
> 
>> On 6 Dec 2019, at 08:43, Rainer M Krug  wrote:
>> 
>> Hi
>> 
>> I am writing a package which downloads files which become part of the 
>> package (only useful for functions in the package and independent of the 
>> working directory) into
>> 
>>   system.file("installedSchemes", package = "dmdScheme")
>> 
>> (See 
>> https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/b97e7b5ef116476e065aeec1da1050eecbd6adf7/R/scheme_install.R#L71-L75
>>  for the function).
>> 
>> I know that is regulated for R packages, but I can’t find it.
>> 
>> Is this allowed for R packages? Will this be allowed for CRAN?
>> 
>> I would prefer not to allow custom paths here, as it would complicate things.
>> 
>> Thanks,
>> 
>> Rainer
>> 
>> 
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys. (Germany)
>> 
>> Orcid ID: -0002-7490-0066
>> 
>> Department of Evolutionary Biology and Environmental Studies
>> University of Zürich
>> Office Y34-J-74
>> Winterthurerstrasse 190
>> 8075 Zürich
>> Switzerland
>> 
>> Office:+41 (0)44 635 47 64
>> Cell:   +41 (0)78 630 66 57
>> email:  rainer.k...@uzh.ch
>>   rai...@krugs.de
>> Skype: RMkrug
>> 
>> PGP: 0x0F52F982
>> 
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[alternative HTML version deleted]]

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


[R-pkg-devel] CRAN submission with "possibly unsafe calls" or alternative approach?

2019-12-06 Thread Rainer M Krug
Hi

In my package `dmdScheme` I define three variables. Depending on a state in the 
package (a selected metadata schemes) these are set as followed from within the 
package:

```
  unlockBinding("dmdScheme_example", as.environment("package:dmdScheme"))
  assign("dmdScheme_example", scheme_example, "package:dmdScheme")
  lockBinding("dmdScheme_example", as.environment("package:dmdScheme"))


  scheme_raw <- as_dmdScheme_raw(scheme_example)
  unlockBinding("dmdScheme_raw", as.environment("package:dmdScheme"))
  assign("dmdScheme_raw", scheme_raw, "package:dmdScheme")
  lockBinding("dmdScheme_raw", as.environment("package:dmdScheme"))


  scheme <- as_dmdScheme(scheme_raw, keepData = FALSE, checkVersion = FALSE)
  unlockBinding("dmdScheme", as.environment("package:dmdScheme"))
  assign("dmdScheme", scheme, "package:dmdScheme")
  lockBinding("dmdScheme", as.environment("package:dmdScheme”))
```

( See 
https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/b97e7b5ef116476e065aeec1da1050eecbd6adf7/R/scheme_use.R#L37-L49
 )

My reasoning is that I want to lock these variables, as they are essential to 
the functioning of the package.

But I get, probably not surprising, the following NOTE:


```
* checking R code for possible problems ... NOTE
Found the following possibly unsafe calls:
File ‘dmdScheme/R/scheme_use.R’:
  unlockBinding("dmdScheme_example", as.environment("package:dmdScheme"))
  unlockBinding("dmdScheme_raw", as.environment("package:dmdScheme"))
  unlockBinding("dmdScheme", as.environment("package:dmdScheme"))
```

For the submission to CRAN, Can I disregard this note and explain it during the 
submission?

My second question concerns the values itself. I set the variables to NULL in 
the /data folder in the package, but even after they are set as above, the 
valuee in `dmdScheme::dmdScheme` is still NULL:

```
> names(dmdScheme)
[1] "Experiment"   "Genus""Treatments"   "Measurement"
[5] "DataExtraction"   "DataFileMetaData"
> names(dmdScheme::dmdScheme)
NULL
>
```

Is there a way, that I can change the value of dmdScheme::… variables during 
runtime?

Thanks,

Rainer


--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982

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


[R-pkg-devel] Package write access for storing new files

2019-12-06 Thread Rainer M Krug
Hi

I am writing a package which downloads files which become part of the package 
(only useful for functions in the package and independent of the working 
directory) into

system.file("installedSchemes", package = "dmdScheme")

(See 
https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/b97e7b5ef116476e065aeec1da1050eecbd6adf7/R/scheme_install.R#L71-L75
 for the function).

I know that is regulated for R packages, but I can’t find it.

Is this allowed for R packages? Will this be allowed for CRAN?

I would prefer not to allow custom paths here, as it would complicate things.

Thanks,

Rainer


--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982

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


Re: [R-pkg-devel] Package dependency graphs of packages in development (local)

2019-05-09 Thread Rainer M Krug
Nope:

```
> meta_cache_update()
ℹ Checking for package metadata updates
✔ Downloaded metadata files, 1.37 MB in 5 files.
   
✔ Updating metadata database
   
> itdepends::dep_plot_size(".")
ℹ Checking for package metadata updates
✖ Metadata download failed  
   
Error in stop(http_error(resp)) : 
Not Found (HTTP 404).

Could not load or update metadata cache. If you think your local cache is 
broken, try deleting it with `meta_cache_cleanup()`, or the
`$cleanup()` method.
> 

I can download the cache manually (see above). 

Rainer


```

> On 9 May 2019, at 13:16, Gábor Csárdi  wrote:
> 
> It fails to download package metadata. Maybe your internet access is
> restricted?
> 
> Gabor
> 
> On Thu, May 9, 2019 at 12:12 PM Rainer M Krug  wrote:
>> 
>> But I don’t get it to run.
>> 
>> When I do
>> 
>>> itdepends::dep_plot_size(".")
>> ℹ Checking for package metadata updates
>> ✖ Metadata download failed
>> Error in stop(http_error(resp)) :
>> Not Found (HTTP 404).
>> 
>> Could not load or update metadata cache. If you think your local cache is 
>> broken, try deleting it with `meta_cache_cleanup()`, or the
>> `$cleanup()` method.
>> d>
>> 
>> I get an error. Suggestions?
>> 
>> Rainer
>> 
>> 
>> 
>> On 9 May 2019, at 12:20, Rainer M Krug  wrote:
>> 
>> Thanks.
>> 
>> This sounds like a really useful package - I’ll check it out.
>> 
>> 
>> On 9 May 2019, at 12:15, Maëlle SALMON  wrote:
>> 
>> Could https://github.com/jimhester/itdepends help?
>> 
>> Maëlle.
>> Den torsdag 9 maj 2019 12:10:14 CEST, Rainer M Krug  skrev:
>> 
>> 
>> Thanks Gabor.
>> 
>> This gives me an impressive long list. Is there a way to see this 
>> graphically? Parsing seems to be a long, tedious process.
>> 
>> I want to identify packages which I should leave out to reduce the number of 
>> (indirect) dependencies.
>> 
>> Rainer
>> 
>> 
>>> On 9 May 2019, at 11:24, Gábor Csárdi  wrote:
>>> 
>>> You can do something like this with https://github.com/r-lib/pkgdepends:
>>> 
>>> pr <- pkgdepends::remotes()$new("local::.", library = tempfile())
>>> #> ℹ Creating library directory:
>>> `/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5wgn/T//Rtmpo5NL9R/filee95427c73f55`
>>> 
>>> pr$solve()
>>> #> ℹ Checking for package metadata updates
>>> #> ✔ All 10 metadata files are current.
>>> #> ✔ Using session cached package metadata
>>> #> ✔ Using cached package metadata
>>> #> PKG SOLUTION, 1 refs, resolved in 1.2s, solved in 193ms
>>> ───
>>> #>  local::.
>>> #> Dependencies:
>>> #>  github:
>>> #>r-lib/crancache, r-lib/rcmdcheck
>>> #>  standard:
>>> #>askpass, assertthat, backports, base64enc, bit, bit64, blob, callr,
>>> #>cli, clisymbols, cranlike, crayon, curl, DBI, debugme, desc,
>>> #>digest, evaluate, fansi, glue, gmailr, highr, hms, httr, jsonlite,
>>> #>knitr, magrittr, markdown, memoise, mime, openssl, parsedate,
>>> #>pillar, pkgbuild, pkgconfig, prettyunits, processx, progress, ps,
>>> #>R6, rappdirs, Rcpp, rematch2, remotes, rlang, rprojroot, RSQLite,
>>> #>sessioninfo, stringi, stringr, sys, tibble, utf8, whoami, withr,
>>> #>xfun, xopen, yaml
>>> 
>>> tibble::as_tibble(pr$get_solution()$data)
>>> #> # A tibble: 61 x 27
>>> #>ref  type  direct status package version license
>>> needscompilation priority
>>> #>
>>> #>  1 loca… local TRUE  OKrevdep… 1.0.0.… MIT + … NA  NA
>>> #>  2 askp… stan… FALSE  OKaskpass 1.1NA  FALSENA
>>> #>  3 asse… stan… FALSE  OKassert… 0.2.1  NA  FALSENA
>>> #>  4 back… stan… FALSE  OKbackpo… 1.1.4  NA  FALSENA
>>> #>  5 base… stan… FALSE  OKbase64… 0.1-3  NA  FALSENA
>>> #>  6 bit64 stan… FALSE  OKbit64  0.9-7  NA  FALSENA
>>> #>

Re: [R-pkg-devel] Package dependency graphs of packages in development (local)

2019-05-09 Thread Rainer M Krug
Thanks Gabor. 

This gives me an impressive long list. Is there a way to see this graphically? 
Parsing seems to be a long, tedious process.

I want to identify packages which I should leave out to reduce the number of 
(indirect) dependencies.

Rainer


> On 9 May 2019, at 11:24, Gábor Csárdi  wrote:
> 
> You can do something like this with https://github.com/r-lib/pkgdepends:
> 
> pr <- pkgdepends::remotes()$new("local::.", library = tempfile())
> #> ℹ Creating library directory:
> `/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5wgn/T//Rtmpo5NL9R/filee95427c73f55`
> 
> pr$solve()
> #> ℹ Checking for package metadata updates
> #> ✔ All 10 metadata files are current.
> #> ✔ Using session cached package metadata
> #> ✔ Using cached package metadata
> #> PKG SOLUTION, 1 refs, resolved in 1.2s, solved in 193ms
> ───
> #>   local::.
> #> Dependencies:
> #>   github:
> #> r-lib/crancache, r-lib/rcmdcheck
> #>   standard:
> #> askpass, assertthat, backports, base64enc, bit, bit64, blob, callr,
> #> cli, clisymbols, cranlike, crayon, curl, DBI, debugme, desc,
> #> digest, evaluate, fansi, glue, gmailr, highr, hms, httr, jsonlite,
> #> knitr, magrittr, markdown, memoise, mime, openssl, parsedate,
> #> pillar, pkgbuild, pkgconfig, prettyunits, processx, progress, ps,
> #> R6, rappdirs, Rcpp, rematch2, remotes, rlang, rprojroot, RSQLite,
> #> sessioninfo, stringi, stringr, sys, tibble, utf8, whoami, withr,
> #> xfun, xopen, yaml
> 
> tibble::as_tibble(pr$get_solution()$data)
> #> # A tibble: 61 x 27
> #>ref   type  direct status package version license
> needscompilation priority
> #>   
> #>  1 loca… local TRUE   OK revdep… 1.0.0.… MIT + … NA   NA
> #>  2 askp… stan… FALSE  OK askpass 1.1 NA  FALSENA
> #>  3 asse… stan… FALSE  OK assert… 0.2.1   NA  FALSENA
> #>  4 back… stan… FALSE  OK backpo… 1.1.4   NA  FALSENA
> #>  5 base… stan… FALSE  OK base64… 0.1-3   NA  FALSENA
> #>  6 bit64 stan… FALSE  OK bit64   0.9-7   NA  FALSENA
> #>  7 bit   stan… FALSE  OK bit 1.1-14  NA  FALSENA
> #>  8 blob  stan… FALSE  OK blob1.1.1   NA  FALSENA
> #>  9 callr stan… FALSE  OK callr   3.2.0   NA  FALSENA
> #> 10 cli   stan… FALSE  OK cli 1.1.0   NA  FALSENA
> #> # … with 51 more rows, and 18 more variables: md5sum , sha256 ,
> #> #   filesize , built , platform , rversion ,
> repodir ,
> #> #   target , deps , mirror , sources , remote ,
> #> #   error , metadata , extra , dep_types ,
> #> #   cache_status , lib_status 
> 
> And the `deps` column there shows the direct dependencies of the dependencies:
> 
> ❯ pr$get_solution()$data$deps[1:2]
> #> [[1]]
> #> # A tibble: 25 x 5
> #>ref typepackageopversion
> #> 
> #>  1 assertthat  Imports assertthat """"
> #>  2 callr   Imports callr  """"
> #>  3 cli Imports cli""""
> #>  4 clisymbols  Imports clisymbols """"
> #>  5 r-lib/crancache Imports crancache  >=0.0.0.9001
> #>  6 crayon  Imports crayon """"
> #>  7 DBI Imports DBI    """"
> #>  8 descImports desc   >=1.1.1.9002
> #>  9 glueImports glue   """"
> #> 10 gmailr  Imports gmailr """"
> #> # … with 15 more rows
> #>
> #> [[2]]
> #> # A tibble: 2 x 5
> #>   ref  type package  opversion
> #>
> #> 1 testthat suggests testthat """"
> #> 2 sys  imports  sys  >=2.1
> 
> Gabor
> 
> On Thu, May 9, 2019 at 8:53 AM Rainer M Krug  wrote:
>> 
>> Hi
>> 
>> I am quite sure, there was a recent discussion about dependency graphs of 
>> packages. I saw the post from Dirk at 
>> http://dirk.eddelbuettel.com/blog/2018/02/28/#017_dependencies but 
>> `tools::package_dependencies()` does only work on packages on CRAN.
>> 
>> But my package is not yet on CRAN (but on GitHub and a drat repo), and I 
>> would like to look at the package dependencies BEFORE submitting to CRAN.
>> 
>> Is there a tool which allows me to plot a depen

[R-pkg-devel] Package dependency graphs of packages in development (local)

2019-05-09 Thread Rainer M Krug
Hi

I am quite sure, there was a recent discussion about dependency graphs of 
packages. I saw the post from Dirk at 
http://dirk.eddelbuettel.com/blog/2018/02/28/#017_dependencies but 
`tools::package_dependencies()` does only work on packages on CRAN. 

But my package is not yet on CRAN (but on GitHub and a drat repo), and I would 
like to look at the package dependencies BEFORE submitting to CRAN.

Is there a tool which allows me to plot a dependency graph for my local package?

Thanks,

Rainer


--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Orcid ID: -0002-7490-0066

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982

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


Re: [R-pkg-devel] Checking for future file timestamps - warning with worldclockapi HTTP status 403 Site Disabled

2019-03-19 Thread Rainer M Krug
Thanks - will do so.

Rainer

> On 19 Mar 2019, at 12:14, Gábor Csárdi  wrote:
> 
> AFAICT you can still get a NOTE about it, so I would just leave the
> workaround in place:
> https://github.com/wch/r-source/blob/87110b6b9e20c324c44766cc8f5816580f681a2a/src/library/tools/R/check.R#L457
> 
> G.
> 
> On Tue, Mar 19, 2019 at 11:11 AM Rainer M Krug  wrote:
>> 
>> Can anyone confirm if this has been fixed? I would like to remove the 
>> _R_CHECK_SYSTEM_CLOCK_=0 but would like to know in advance.
>> 
>> Thanks
>> 
>> Rainer
>> 
>> 
>>> On 8 Mar 2019, at 10:03, Gábor Csárdi  wrote:
>>> 
>>> I think you can put this in appveyor.yml:
>>> 
>>> environment:
>>>  _R_CHECK_SYSTEM_CLOCK_: 0
>>> 
>>> before the "build_script" section.
>>> 
>>> Gabor
>>> 
>>> On Fri, Mar 8, 2019 at 5:15 AM Marta Karaś  wrote:
>>>> 
>>>> I have faced the same problem with using http://worldclockapi.com/. I dealt
>>>> with Travis fail (because warnings are changed to errors) after setting
>>>> environment variable _R_CHECK_SYSTEM_CLOCK_ to zero, as adviced above.
>>>> 
>>>> How I deal with appveyor fail for the same reason? It may be seen in my
>>>> built output here (link)
>>>> <https://ci.appveyor.com/project/martakarass/adept/build/job/vq4ncvg6qbh526u4>.
>>>> I googled but was unable to find the equivalent of
>>>> 
>>>> env:
>>>> - _R_CHECK_SYSTEM_CLOCK_=0
>>>> 
>>>> 
>>>> for appveyor. Would appreciate any hint a lot - thank you!
>>>> Marta
>>>> 
>>>> On Thu, Mar 7, 2019 at 2:53 PM Hadley Wickham  wrote:
>>>> 
>>>>> As of ~7 hours ago, the warning is suppressed:
>>>>> 
>>>>> https://github.com/wch/r-source/commit/31ee14c620eb1b939acd322f3b5617f998aab8e8
>>>>> 
>>>>> (But the service still doesn't work)
>>>>> 
>>>>> Hadley
>>>>> 
>>>>> On Thu, Mar 7, 2019 at 11:03 AM Hadley Wickham 
>>>>> wrote:
>>>>>> 
>>>>>> It appears that the code was added by BDR on 2 Sep 2018:
>>>>>> 
>>>>> https://github.com/wch/r-source/commit/d839b1e04e173f90b51ad809ef0bdb18095abe6f
>>>>>> 
>>>>>> I assume we are seeing failing R CMD check results because
>>>>>> http://worldclockapi.com/api/json/utc/now has recently died.
>>>>>> 
>>>>>> It would be appreciated if someone from R-core could look into this as
>>>>>> it's currently causing all R-devel builds on travis to fail.
>>>>>> 
>>>>>> Hadley
>>>>>> 
>>>>>> On Thu, Mar 7, 2019 at 9:32 AM Bob Rudis  wrote:
>>>>>>> 
>>>>>>> (a) that's gd news (#ty)
>>>>>>> (b) genuine apologies for my confusion
>>>>>>> (c) why was the introduction of reliance on a third-party site even
>>>>> under consideration?
>>>>>>> 
>>>>>>>> On Mar 7, 2019, at 09:32, peter dalgaard  wrote:
>>>>>>>> 
>>>>>>>> It's not "stealth fixed"! It was never there... (on the release
>>>>> branch)
>>>>>>>> 
>>>>>>>> The timestamp checking code is still present in R-devel. I presume
>>>>> something needs to be done about the breakage.
>>>>>>>> 
>>>>>>>> - pd
>>>>>>>> 
>>>>>>>>> On 7 Mar 2019, at 14:38 , Bob Rudis  wrote:
>>>>>>>>> 
>>>>>>>>> It's fixed in the RC that's GA on the 11th.
>>>>>>>>> 
>>>>>>>>> I think perhaps "stealth fixed" may be more appropro since it's not
>>>>> in SVN logs, Bugzilla nor noted prominently in any of the various NEWS*
>>>>> files.
>>>>>>>>> 
>>>>>>>>> Then there's the "why was the core R installation using a third
>>>>> party, non-HTTPS site for this to begin with".
>>>>>>>>> 
>>>>>>>>> And, in other news, there are tests in the R source that rely on a
>>>>> check of `foo.bar` for connectivity. `.bar` is a valid domain and 
>>>>&g

Re: [R-pkg-devel] Checking for future file timestamps - warning with worldclockapi HTTP status 403 Site Disabled

2019-03-19 Thread Rainer M Krug
Can anyone confirm if this has been fixed? I would like to remove the 
_R_CHECK_SYSTEM_CLOCK_=0 but would like to know in advance.

Thanks

Rainer


> On 8 Mar 2019, at 10:03, Gábor Csárdi  wrote:
> 
> I think you can put this in appveyor.yml:
> 
> environment:
>   _R_CHECK_SYSTEM_CLOCK_: 0
> 
> before the "build_script" section.
> 
> Gabor
> 
> On Fri, Mar 8, 2019 at 5:15 AM Marta Karaś  wrote:
>> 
>> I have faced the same problem with using http://worldclockapi.com/. I dealt
>> with Travis fail (because warnings are changed to errors) after setting
>> environment variable _R_CHECK_SYSTEM_CLOCK_ to zero, as adviced above.
>> 
>> How I deal with appveyor fail for the same reason? It may be seen in my
>> built output here (link)
>> <https://ci.appveyor.com/project/martakarass/adept/build/job/vq4ncvg6qbh526u4>.
>> I googled but was unable to find the equivalent of
>> 
>> env:
>>  - _R_CHECK_SYSTEM_CLOCK_=0
>> 
>> 
>> for appveyor. Would appreciate any hint a lot - thank you!
>> Marta
>> 
>> On Thu, Mar 7, 2019 at 2:53 PM Hadley Wickham  wrote:
>> 
>>> As of ~7 hours ago, the warning is suppressed:
>>> 
>>> https://github.com/wch/r-source/commit/31ee14c620eb1b939acd322f3b5617f998aab8e8
>>> 
>>> (But the service still doesn't work)
>>> 
>>> Hadley
>>> 
>>> On Thu, Mar 7, 2019 at 11:03 AM Hadley Wickham 
>>> wrote:
>>>> 
>>>> It appears that the code was added by BDR on 2 Sep 2018:
>>>> 
>>> https://github.com/wch/r-source/commit/d839b1e04e173f90b51ad809ef0bdb18095abe6f
>>>> 
>>>> I assume we are seeing failing R CMD check results because
>>>> http://worldclockapi.com/api/json/utc/now has recently died.
>>>> 
>>>> It would be appreciated if someone from R-core could look into this as
>>>> it's currently causing all R-devel builds on travis to fail.
>>>> 
>>>> Hadley
>>>> 
>>>> On Thu, Mar 7, 2019 at 9:32 AM Bob Rudis  wrote:
>>>>> 
>>>>> (a) that's gd news (#ty)
>>>>> (b) genuine apologies for my confusion
>>>>> (c) why was the introduction of reliance on a third-party site even
>>> under consideration?
>>>>> 
>>>>>> On Mar 7, 2019, at 09:32, peter dalgaard  wrote:
>>>>>> 
>>>>>> It's not "stealth fixed"! It was never there... (on the release
>>> branch)
>>>>>> 
>>>>>> The timestamp checking code is still present in R-devel. I presume
>>> something needs to be done about the breakage.
>>>>>> 
>>>>>> - pd
>>>>>> 
>>>>>>> On 7 Mar 2019, at 14:38 , Bob Rudis  wrote:
>>>>>>> 
>>>>>>> It's fixed in the RC that's GA on the 11th.
>>>>>>> 
>>>>>>> I think perhaps "stealth fixed" may be more appropro since it's not
>>> in SVN logs, Bugzilla nor noted prominently in any of the various NEWS*
>>> files.
>>>>>>> 
>>>>>>> Then there's the "why was the core R installation using a third
>>> party, non-HTTPS site for this to begin with".
>>>>>>> 
>>>>>>> And, in other news, there are tests in the R source that rely on a
>>> check of `foo.bar` for connectivity. `.bar` is a valid domain and `foo.bar`
>>> is registered. Thankfully there's no current IP address associated with it.
>>> Anything under `*.invalid` (https://en.wikipedia.org/wiki/.invalid) might
>>> be a better choice as well since that won't break the reason for the
>>> connectivity checks and won't arbitrarily send telemetry pings to third
>>> parties in the even anyone outside of R Core decides to run the tests (say,
>>> when patching something in R).
>>>>>>> 
>>>>>>> -boB
>>>>>>> 
>>>>>>>> On Mar 7, 2019, at 07:54, Rainer M Krug  wrote:
>>>>>>>> 
>>>>>>>> I can confirm the same when checking on travis with r-devel.
>>>>>>>> 
>>>>>>>> And thanks for the tip with
>>>>>>>> 
>>>>>>>> env:
>>>>>>>> - _R_CHECK_SYSTEM_CLOCK_=0
>>>>>>>> 
>>>>>>>> In .travis.yml
>>>>>>>> 
>>>>>>

Re: [R-pkg-devel] Checking for future file timestamps - warning with worldclockapi HTTP status 403 Site Disabled

2019-03-07 Thread Rainer M Krug
I can confirm the same when checking on travis with r-devel.

And thanks for the tip with 

env:
  - _R_CHECK_SYSTEM_CLOCK_=0

In .travis.yml

Seems to be working now

Rainer



> On 7 Mar 2019, at 12:48, Ralf Herold  wrote:
> 
> Dear All, 
> 
> Checking a new package under development produces a warning in a local 
> R-devel MS Windows environment (output below). 
> 
> Building it with R-devel on Travis fails (because warnings are changed to 
> errors), but is successful when setting environment variable 
> _R_CHECK_SYSTEM_CLOCK_ to zero. 
> 
> No issue occurs when checking and building with R-stable and R-oldrel on 
> Travis, or with any R version on win-builder.r-project.org. 
> 
> The warning concerns using http://worldclockapi.com/, which however seems out 
> of service ("The web app you have attempted to reach is currently stopped and 
> does not accept any requests."). This is referenced in the main function for 
> R CMD check (https://svn.r-project.org/R/trunk/src/library/tools/R/check.R) 
> and may concern more R-devel than R-package-devel. I am posting here to check 
> if the issue was noticed by other package developers and to check the impact. 
> 
> Thanks for any suggestions. 
> Best regards,
> Ralf
> 
> 
> PS C:\Users\username> & 'C:\Program Files\R\R-devel\bin\R.exe' CMD check 
> E:\mypackage_0.1.2.3.tar.gz --as-cran
> * using log directory 'C:/Users/username/ctrdata.Rcheck'
> * using R Under development (unstable) (2019-03-05 r76200)
> * using platform: x86_64-w64-mingw32 (64-bit)
> * using session charset: ISO8859-1
> * using option '--as-cran'
> [...]
> * checking package directory ... OK
> * checking for future file timestamps ...Warning in file(con, "r") :
>  cannot open URL 'http://worldclockapi.com/api/json/utc/now': HTTP status was 
> '403 Site Disabled'
> WARNING
> unable to verify current time
> * checking 'build' directory … OK
> [...]
> 
> 
> 
> ## Ralf Herold 
> ## mailto: ralf.her...@mailbox.org [S/MIME]
> ## https://paediatricdata.eu/
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel




--
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


[[alternative HTML version deleted]]

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


Re: [Rd] Runnable R packages

2019-02-08 Thread Rainer M Krug
Sounds interesting. Do you have it on GitHub or similar?

Rainer

> On 8 Feb 2019, at 09:09, David Lindelof  wrote:
> 
> Yesterday I wrote and submitted to CRAN a package `run`, which implements
> the ideas discussed in this thread. Given a package tarball
> foo_0.1.0.tar.gz, users will be able to run
> 
> Rscript -e "run::run('foo_0.1.0.tar.gz')"
> 
> which will pull all the dependencies of package `foo`, lookup a function
> `main` in that package's namespace, and call it.
> 
> It's an early draft but I'd appreciate any feedback (once its submission is
> accepted, of course).
> 
> Thanks all for your help and advice,
> 
> David
> 
> On Sat, Feb 2, 2019 at 3:37 PM Duncan Murdoch 
> wrote:
> 
>> On 02/02/2019 8:27 a.m., Barry Rowlingson wrote:
>>> I don't think anyone denies that you *could* make an EXE to do all
>>> that. The discussion is on *how easy* it should be to create a single
>>> file that contains an initial "main" function plus a set of bundled
>>> code (potentially as a package) and which when run will install its
>>> package code (which is contained in itself, its not in a repo),
>>> install dependencies, and run the main() function.
>>> 
>>> Now, I could build a self-executable shar file that bundled a package
>>> together with a script to do all the above. But if there was a "RUN"
>>> command in R, and a convention that a function called "foo::main"
>>> would be run by `R CMD RUN foo_1.1.1.tar.gz` then it would be so much
>>> easier to develop and test.
>> 
>> I don't believe the "so much easier" argument that this requires a
>> change to base R.  If you put that functionality into a package, then
>> the only extra effort the user would require is to install that other
>> package.  After that, they could run
>> 
>> Rscript -e "yourpackage::run_main('foo_1.1.1.tar.gz')"
>> 
>> as I suggested before.  This is no harder than running
>> 
>> R CMD RUN foo_1.1.1.tar.gz
>> 
>> The advantage of this from R Core's perspective is that you would be
>> developing and maintaining "yourpackage", you wouldn't be passing the
>> burden on to them.  The advantage from your perspective is that you
>> could work with whatever packages you liked.  The "remotes" package has
>> almost everything you need so that "yourpackage" could be nearly
>> trivial.  You wouldn't need to duplicate it within base R.
>> 
>> Duncan Murdoch
>> 
>>> 
>>> If people think this adds value, then if they want to offer that value
>>> to me as $ or £, I'd consider writing it if their total value was more
>>> than my cost
>>> 
>>> Barry
>>> 
>>> 
>>> On Sat, Feb 2, 2019 at 12:54 AM Abs Spurdle  wrote:
>>>> 
>>>> Further to my previous post,
>>>> it would be possible to create an .exe file, say:
>>>> 
>>>> my_r_application.exe
>>>> 
>>>> That starts R, loads your R package(s), calls the R function of your
>> choice
>>>> and does whatever else you want.
>>>> 
>>>> However, I don't think that it would add much value.
>>>> But feel free to correct me if you think that I'm wrong.
>>>> 
>>>> [[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
>>> 
>> 
>> __
>> 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

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Department of Evolutionary Biology and Environmental Studies
University of Zürich
Office Y34-J-74
Winterthurerstrasse 190
8075 Zürich
Switzerland

Office: +41 (0)44 635 47 64
Cell:   +41 (0)78 630 66 57
email:  rainer.k...@uzh.ch
rai...@krugs.de
Skype: RMkrug

PGP: 0x0F52F982




[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)

2018-09-11 Thread Rainer M Krug
Hi Josh,


> On 8 Sep 2018, at 21:02, Joshua Ulrich  wrote:
> 
> Hi Rainer,
> 
> On Wed, Sep 5, 2018 at 2:28 AM, Rainer Krug  wrote:
>> Hi
>> 
>> I have a package at GitHub (https://github.com/rkrug/ROriginStamp) which I am
>> pre[paring for CRAN.
>> 
>> It creates a trusted timestamp using the API fro OriginStamp
>> (https://originstamp.org/home) which requires an API key. Now this API should
>> not be made public, as to much traffic through one API key will lead to it’s
>> blocking.
>> 
>> I have stored the key encrypted in the travis.yml, and the package passes all
>> tests.
>> 
>> But if I send it to CRAN, it would fail the tests, as the api key is not in
>> the package itself.
>> 
>> I could disable all tests for CRAN which need the API key, but I think it
>> would be better tu run the tests there as well (as an additional check to
>> travis).
>> 
>> My question:
>> 
>> Is there a way of storing the API key encrypted, so that only the CRAN test
>> servers can decrypt it, or is there another way can steal with this?
>> 
> I have a similar issue with quantmod.  I need API keys to test some
> functionality and I would like the tests run regularly, so I can know
> when something breaks without having to wait for a user to report the
> change.

Same motivation here.

> 
> I store the API keys in encrypted environment variable in TravisCI,
> and I check for those environment variables before running the tests
> that require them.

I am using the same approach for TravisCI and it works perfectly.

> 
> Then I added a cron job on TravisCI to run the build if there hasn't
> been a build in the past 24 hours.  That solves the problem adequately
> for my purposes without adding any burden to CRAN.  Hopefully it works
> for your purposes too.

I haven’t thought about the CRON job for TravisCI - good point. I will activate 
it straight away.

Thanks,

Rainer

> 
> Best,
> Josh
> 
>> Thanks,
>> 
>> Rainer
>> 
>> 
>> 
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN),
>> MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
>> 
>> University of Zürich
>> 
>> Cell:   +41 (0)78 630 66 57
>> email:  rai...@krugs.de
>> Skype:  RMkrug
>> 
>> PGP: 0x0F52F982
>> 
>> 
>> 
>> 
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>> 
> 
> 
> 
> --
> Joshua Ulrich  |  about.me/joshuaulrich
> FOSS Trading  |  www.fosstrading.com
> R/Finance 2018 | www.rinfinance.com

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

University of Zürich

Cell:   +41 (0)78 630 66 57
email:  rai...@krugs.de
Skype:  RMkrug

PGP: 0x0F52F982





signature.asc
Description: Message signed with OpenPGP
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)

2018-09-06 Thread Rainer M Krug


> On 5 Sep 2018, at 20:20, Henrik Bengtsson  <mailto:henrik.bengts...@gmail.com>> wrote:
> 
> I take a complementary approach; I condition on, my home-made,
> R_TEST_ALL variable.  Effectively, I do:
> 
> if (as.logical(Sys.getenv("R_TEST_ALL", "FALSE"))) {
>   ...
> }
> 
> and set R_TEST_ALL=TRUE when I want to run that part of the test.  You
> can also imagine refined versions of this, e.g. R_TEST_SETS=foo,bar
> and test scripts with:
> 
> if ("foo" %in% strsplit(Sys.getenv("R_TEST_SETS"), split="[, ]+")[[1]]) {
>   ...makes no assumption
> }
> 
> That avoids making assumptions on where the tests are submitted/run,
> may it be CRAN, Bioconductor, Travis CI, …

Thanks Henrik - that sounds like a good idea. At the moment, I am checking for 
the name of my machine, which is obviously not to robust.

I will implement this before submission to CRAN.

Thanks,

Rainer

> 
> /Henrik
> 
> On Wed, Sep 5, 2018 at 11:08 AM Spencer Graves
>  <mailto:spencer.gra...@effectivedefense.org>> wrote:
>> 
>> 
>> 
>> On 2018-09-05 12:52, Gábor Csárdi wrote:
>>> On Wed, Sep 5, 2018 at 6:34 PM Spencer Graves
>>> >> <mailto:spencer.gra...@effectivedefense.org>> wrote:
>>>> The fda package disables some tests on CRAN using:
>>>> 
>>>> 
>>>> if(!fda::CRAN()){
>>>>  test you don't want run on CRAN
>>>> }
>>> Seemingly this just checks for a couple of (5 by default) environment
>>> variables that match "^_R_":
>>> https://github.com/cran/fda/blob/0549e6a86aa144d8c2aade2d8704a269fb8a94ed/R/CRAN.R#L14
>>>  
>>> <https://github.com/cran/fda/blob/0549e6a86aa144d8c2aade2d8704a269fb8a94ed/R/CRAN.R#L14>
>>> 
>>> I am not sure if this is a good indication of the machine being a CRAN
>>> machine, I do set  some of these
>>> occasionally on my machine.  It would be great if CRAN machines could
>>> set a specific environment
>>> variable globally, e.g. ON_CRAN, or _R_ON_CRAN_, so people could skip
>>> these tests and examples
>>> easily.
>> 
>> 
>> Agreed.  Before I wrote that function, I asked this list for
>> suggestions.  The suggestion I got was, "Don't do it."  I felt that was
>> not acceptable so wrote what I did.  I think we need a better solution.
>> Spencer
>>> 
>>> Gabor
>>> 
>>>> 
>>>>    I've used this in other contexts with tests that are too long to
>>>> run on CRAN but that I want to run otherwise during "R CMD check".
>>>> 
>>>> 
>>>>Spencer Graves
>>>> 
>>>> 
>>>> On 2018-09-05 12:13, Peter Meissner wrote:
>>>>> Hey,
>>>>> 
>>>>> Maybe webmockr (or something alike) can help:
>>>>> https://cran.r-project.org/web/packages/webmockr/index.html 
>>>>> <https://cran.r-project.org/web/packages/webmockr/index.html>
>>>>> 
>>>>> Best, Peter
>>>>> 
>>>>> Rainer M Krug  schrieb am Mi., 5. Sep. 2018, 15:38:
>>>>> 
>>>>>> OK - thanks. I will than disable the checks for CRAN.
>>>>>> 
>>>>>> Thanks,
>>>>>> 
>>>>>> Rainer
>>>>>> 
>>>>>> 
>>>>>>> On 5 Sep 2018, at 15:37, Uwe Ligges 
>>>>>> wrote:
>>>>>>> You should not run on CRAN. Note that the checks are done almost daily
>>>>>> oin several platforms, hence the API key is used for about 10 check runs 
>>>>>> a
>>>>>> day.
>>>>>>> Best,
>>>>>>> Uwe Ligges
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On 05.09.2018 09:28, Rainer Krug wrote:
>>>>>>>> Hi
>>>>>>>> I have a package at GitHub (https://github.com/rkrug/ROriginStamp)
>>>>>> which I am pre[paring for CRAN.
>>>>>>>> It creates a trusted timestamp using the API fro OriginStamp (
>>>>>> https://originstamp.org/home) which requires an API key. Now this API
>>>>>> should not be made public, as to much traffic through one API key will 
>>>>>> lead
>>>>>> to it’s blocking.
>>>>>>>> I have stored the key encrypted in the travis.yml, and the packag

Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)

2018-09-05 Thread Rainer M Krug
OK - thanks. I will than disable the checks for CRAN.

Thanks,

Rainer


> On 5 Sep 2018, at 15:37, Uwe Ligges  wrote:
> 
> You should not run on CRAN. Note that the checks are done almost daily oin 
> several platforms, hence the API key is used for about 10 check runs a day.
> 
> Best,
> Uwe Ligges
> 
> 
> 
> On 05.09.2018 09:28, Rainer Krug wrote:
>> Hi
>> I have a package at GitHub (https://github.com/rkrug/ROriginStamp) which I 
>> am pre[paring for CRAN.
>> It creates a trusted timestamp using the API fro OriginStamp 
>> (https://originstamp.org/home) which requires an API key. Now this API 
>> should not be made public, as to much traffic through one API key will lead 
>> to it’s blocking.
>> I have stored the key encrypted in the travis.yml, and the package passes 
>> all tests.
>> But if I send it to CRAN, it would fail the tests, as the api key is not in 
>> the package itself.
>> I could disable all tests for CRAN which need the API key, but I think it 
>> would be better tu run the tests there as well (as an additional check to 
>> travis).
>> My question:
>> Is there a way of storing the API key encrypted, so that only the CRAN test 
>> servers can decrypt it, or is there another way can steal with this?
>> Thanks,
>> Rainer
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys. (Germany)
>> University of Zürich
>> Cell:   +41 (0)78 630 66 57
>> email:  rai...@krugs.de
>> Skype:  RMkrug
>> PGP: 0x0F52F982
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

University of Zürich

Cell:   +41 (0)78 630 66 57
email:  rai...@krugs.de
Skype:  RMkrug

PGP: 0x0F52F982





signature.asc
Description: Message signed with OpenPGP
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Building my R package: issue when importing two functions with the same name

2018-08-07 Thread Rainer M Krug
Probably discussed already, but what is the difference between using “::” and 
“ImportFrom”? I usually use ImportFrom and “::” just to make clear, where the 
function is coming from - is this a problem?

Rainer


> On 7 Aug 2018, at 11:14, Uwe Ligges  wrote:
> 
> ... and even if you are importing from several packages, you should import 
> selective via importFrom directoves.
> 
> If you need two functions with identical names, import at most one of them 
> and rather use pkg::foo syntax to access them.
> 
> Best,
> Uwe Ligges
> 
> 
> 
> 
> 
> On 07.08.2018 10:14, Iñaki Úcar wrote:
>> El mar., 7 ago. 2018 a las 9:32, Gianmarco Alberti
>> () escribió:
>>> 
>>> I am building a R package, and I am facing an issue caused (as far as I 
>>> understand) by the fact that some functions out of my package rely on two 
>>> fuctions having the same name and coming from 2 different packages:
>>> 
>>> pROC::roc
>>> spatstat::roc
>>> 
>>> When checking the package via devtools::check(), I get the following 
>>> warning:
>>> 
>>> Warning: replacing previous import ‘spatstat::roc’ by ‘pROC::roc’ when 
>>> loading ‘GmAMisc’
>>> 
>>> Note that both packages are listed among the Imports in my package's 
>>> DESCRIPTION file, and that (within my functions) I have actually used 
>>> spatstat::roc and pROC::roc where needed.
>> I see:
>> Depends: R (>= 3.4.0), ggplot2, ggrepel, rgdal, rgeos, raster, sp,
>> spatstat, maptools, spatialEco, dismo, pROC, kimisc, corrplot,
>> InPosition, lsr, gridExtra, caTools, plyr, classInt, coin, DescTools,
>> rWind, shape, rworldmap, cluster, RcmdrMisc, gdistance, Hmisc
>> In general, it is not a good idea to depend on so many packages,
>> because what "Depends" do is to load and attach packages. Among other
>> issues, there is one that you are already experimenting: "roc" is
>> exported both by "spatstat" and "pROC", so one masks the other.
>> The solution is to list them under "Imports" instead of "Depends". In
>> fact, my advice is to put as many packages as possible under
>> "Imports". Keep in "Depends" only those you would load and attach
>> anyway when working with your package, because you need all the
>> functions along with the ones your package exports. For the rest of
>> them, just use them as package::function to avoid this kind of
>> problem, and reexport functions selectively if needed.
>> Iñaki
>> PS: I'm taking a look at other packages and I see that you always use
>> "Depends" and never "Imports". My general advice is against this
>> practice. Moreover, from the "Writing R Extensions" manual:
>> "Field ‘Depends’ should nowadays be used rarely, only for packages
>> which are intended to be put on the search path to make their
>> facilities available to the end user (and not to the package itself):
>> for example it makes sense that a user of package 'latticeExtra' would
>> want the functions of package 'lattice' made available."
>>> 
>>> I have done some web-search but I could not locate any workaround that 
>>> actually fixes my issue.
>>> 
>>> Do you have any suggestion on the matter?
>>> 
>>> **
>>> Dr Gianmarco Alberti (PhD)
>>> (currently)
>>> Research Support Officer II
>>> Department of Classics and Archaeology
>>> Faculty of Arts
>>> University of Malta
>>> 
>>> (starting from 3rd September 2018)
>>> Lecturer in Spatial Forensics
>>> Department of Criminology
>>> Faculty for Social Wellbeing
>>> University of Malta
>>> https://www.researchgate.net/profile/Gianmarco_Alberti4
>>> http://cainarchaeology.weebly.com/
>>> **
>>> 
>>> 
>>> [[alternative HTML version deleted]]
>>> 
>>> __
>>> 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
>> 
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

University of Zürich

Cell:   +41 (0)78 630 66 57
email:  rai...@krugs.de
Skype:  RMkrug

PGP: 0x0F52F982





signature.asc
Description: Message signed with OpenPGP
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] plot graph (png, svg, eps, pdf, vdx, ok tikz) to device

2018-05-15 Thread Rainer M. Krug


Von meinem iPhone gesendet

> Am 15.05.2018 um 13:54 schrieb Johannes Ranke <johannes.ra...@jrwb.de>:
> 
> Hi,
> 
> have a look at the grImport package. It can import eps, so at least you get a 
> vector based graph. 

Sounds interesting- I’ll check it out tomorrow and report back if it works 
well. 

> 
> Alternatively, you may want to check grImport2 which imports svg.
> 
> Kind regards,
> 
> Johannes
> 
> Am Dienstag, 15. Mai 2018, 13:22:16 CEST schrieb Rainer Krug:
>> Hi
>> 
>> I asked the question at stack exchange yesterday (
>> https://stackoverflow.com/q/50325139/632423 ) and did not get a response so
>> far, so I repost it here:
>> 
>> 
>> 
>> I have the following situation: I use an external command (plantuml -
>> http://plantuml.com/ ) to create a graph. This is done via R by using a
>> (my) package ( https://github.com/rkrug/plantuml ). The resulting graph can
>> be a file (png, svg, eps, pdf, vdx or LaTeX/Tikz with or without preamble)
>> or I can send the image to stdout, using the same formats.
>> 
>> Now I want to plot this graph as R-like as possible, i.e. in a graphic
>> device. At the moment I am using a temporary file, which I display using
>> readPNG() and grid::grid.raster() which works, but I am not that happy with
>> this approach as
>> 
>>• I have to use a temporary file which I would like to avoid, and
>>• it is a raster format and I would prefer a vector format.
>> 
>> My question is therefore:
>> 
>>• Is there a way to display any of the vector formats in a graphics device
>> in R? • Can I pipe stdout (the result from the call to plantuml) directly
>> into the device (or through any function) without having to create an
>> intermediate file?
>> 
>> 
>> 
>> Thanks for any [pointers,
>> 
>> Rainer
>> 
>> 
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
>> UCT), Dipl. Phys. (Germany)
>> 
>> University of Zürich
>> 
>> Cell:   +41 (0)78 630 66 57
>> email:  rai...@krugs.de
>> Skype:  RMkrug
>> 
>> PGP: 0x0F52F982
> 
> 
> -- 
> Johannes Ranke
> Wissenschaftlicher Berater
> https://jrwb.de/contact

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


Re: [R-pkg-devel] plot graph (png, svg, eps, pdf, vdx, ok tikz) to device

2018-05-15 Thread Rainer M Krug
Hi Stefan,

> On 15 May 2018, at 13:31, Stefan McKinnon Høj-Edwards <s...@iysik.com> wrote:
> 
> Hi Rainer,
> 
> You are currently using a java library to create the plot. Your package is 
> basically a wrapper around the java file.

Correct - that why I am limited to using the specified output formats.

> The only way to make it more "R-like" would be to re-implement the rendering 
> in R (or Rcpp or using the grid package).

Yes - I want to render the generated graphs in a graphics device in R, as if I 
would use a plot(1,1) command.

> 
> To get a vector based image, your code suggests you can use the SVG format. 
> But again, that does not have anything to do with R.

As vector I have sag, eps, and tikz formats - and the R part is: can I render 
these in an R device. I am not interested in R-like coded in the package, I am 
simply looking for a way to display this in an R device.

Cheers,

Rainer


> 
> Kindly,
> Stefan McKinnon Høj-Edwards
> 
> Stefan McKinnon Høj-Edwards
> ph.d. Genetics
> +44 (0)776 231 2464
> +45 2888 6598
> Skype: stefan_edwards
> 
> 2018-05-15 13:22 GMT+02:00 Rainer Krug <rai...@krugs.de 
> <mailto:rai...@krugs.de>>:
> Hi
> 
> I asked the question at stack exchange yesterday ( 
> https://stackoverflow.com/q/50325139/632423 
> <https://stackoverflow.com/q/50325139/632423> ) and did not get a response so 
> far, so I repost it here:
> 
> 
> 
> I have the following situation: I use an external command (plantuml - 
> http://plantuml.com/ <http://plantuml.com/> ) to create a graph. This is done 
> via R by using a (my) package ( https://github.com/rkrug/plantuml 
> <https://github.com/rkrug/plantuml> ). The resulting graph can be a file 
> (png, svg, eps, pdf, vdx or LaTeX/Tikz with or without preamble) or I can 
> send the image to stdout, using the same formats.
> 
> Now I want to plot this graph as R-like as possible, i.e. in a graphic 
> device. At the moment I am using a temporary file, which I display using 
> readPNG() and grid::grid.raster() which works, but I am not that happy with 
> this approach as
> 
> • I have to use a temporary file which I would like to avoid, and
> • it is a raster format and I would prefer a vector format.
> 
> My question is therefore:
> 
> • Is there a way to display any of the vector formats in a graphics 
> device in R?
> • Can I pipe stdout (the result from the call to plantuml) directly 
> into the device (or through any function) without having to create an 
> intermediate file?
> 
> 
> 
> Thanks for any [pointers,
> 
> Rainer
> 
> 
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
> UCT), Dipl. Phys. (Germany)
> 
> University of Zürich
> 
> Cell:   +41 (0)78 630 66 57
> email:  rai...@krugs.de <mailto:rai...@krugs.de>
> Skype:  RMkrug
> 
> PGP: 0x0F52F982
> 
> 
> 
> 
> __
> R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing 
> list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel 
> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>
> 
> 

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

University of Zürich

Cell:   +41 (0)78 630 66 57
email:  rai...@krugs.de
Skype:  RMkrug

PGP: 0x0F52F982





signature.asc
Description: Message signed with OpenPGP
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [Rd] Warn on partial matches in R CMD check

2016-01-21 Thread Rainer M Krug
Hadley Wickham <h.wick...@gmail.com> writes:

> Hi all (but especially Kurt),
>
> Would it be possible to have a flag to R CMD check that warned on
> partial all matches, i.e. turning on:
>
> options(
>   warnPartialMatchDollar = TRUE,
>   warnPartialMatchArgs = TRUE,
>   warnPartialMatchAttr = TRUE
> )
>
> I think this is good practice for package code.

+1

I think that would be brilliant because I already spend a few days
chasing down an error because of an unintended partial match.

>
> I don't think it can currently be made part of the default (because
> sometimes the warnings come from other packages), but it would be
> really convenient to have as a switch.

and also possibly to enable this for normal running of code outside of packages.


Cheers,

Rainer

>
> Hadley

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


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

[R-pkg-devel] Adding non-exported functions in an extra environment in new S4 object

2016-01-21 Thread Rainer M Krug
Hi

I have a package named asm which contains many non-exported functions
which are all starting with "for.eq.".

I also have an S4 class ASM which, when a new object asm of class ASM is
created by using the function newASM() (in the package asm) contains
among other slots one sot with an environment called "equations"
(including the definition of the function"equations" and "equations<-").

Now in this function newASM() I want to copy all functions starting with
"for.eq." into this environment.

I have the following code:

--8<---cut here---start->8---
ASM@equations <- new.env()
funs <- apropos("^for\\.eq\\.", mode="function")
for (fun in funs) {
assign(
gsub("for.eq.", "", fun),
get(fun),
ASM@equations
)
}
--8<---cut here---end--->8---

outside the package I call it as follow:

--8<---cut here---start->8---
asm <- newASM()
--8<---cut here---end--->8---

This worked fine when the functions "for.eq.*" were exported, but does
not work anymore now that I don't export them anymore.

This is a bit surprising to me, as the function newASM() is in the
package and I assumed that inside of a package, all exported and
non-exported functions are seen.

My question:

how can I add all functions starting with "for.eq." into the
environment, irrespective if they are exported or not?

Why I want to do this: I want to be able to have the functions
encapsulated in the environment of the object asm as they are used in a
simulation executed by the sim() function, which attaches the equations
environment at the beginning and detaches it at the end.

This enables me to have different simulation objects with different
functions.

Thanks,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


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

Re: [R-pkg-devel] Build fails on Mavericks

2015-11-19 Thread Rainer M Krug
Duncan Murdoch <murdoch.dun...@gmail.com> writes:

> On 19/11/2015 9:05 AM, Daniel Marcelino wrote:
>> Hi, I'm having this error when building C functions from a package:
>>
>>   clang: error: no such file or directory: '/usr/local/lib/libreadline.a'
>>
>> Apparently, it's a path issue caused by xcode/gfortran, but I couldn't 
>> figure out how to solve it.
>> "which gcc" points to "/usr/bin/gcc"
>> Does someone have any idea on how on this?
>
> You didn't say what system you're on, but the message is coming from
> clang, not gcc, so it looks like OSX, and "which gcc" is irrelevant.
> If so, you probably want to ask on the R-sig-mac group.  If not, give
> more details.

Also: did you use the official R installer or installed it using homebrew?

The path looks very much like homebrew. If yes, try installing readline
From homebrew.

Cheers,

Rainer

>
> Duncan Murdoch
>
> ______
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


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

Re: [Rd] R CMD BATCH vs R CMD batch

2015-10-29 Thread Rainer M Krug
Dirk Eddelbuettel <e...@debian.org> writes:

> On 28 October 2015 at 21:39, Marius Hofert wrote:
> | Out of laziness I just used "R CMD batch" instead of "R CMD BATCH". I
> | didn't get an error so didn't think about the consequences... One
> | consequence is (at least on Mac OS X 10.11 but probably in more
> | generality) that R_BATCH_OPTIONS are ignored, which was kind of fatal
> | in my case... I am thus wondering whether it makes sense to either a)
> | have R_BATCH_OPTIONS also be respected for "R CMD batch" or b) simply
> | not allow "R CMD batch" as a valid command (so requiring to use "R CMD
> | BATCH"). Both approaches might be delicate... just wanted to point
> | this issue out...
>
> Same reason we have 'R CMD INSTALL' as there often is /usr/bin/install with
> different options ...
>
> In general 'R CMD foo' will run for any 'foo' in the path:
>
>edd@max:~$ R CMD date
>Wed Oct 28 21:05:01 CDT 2015
>edd@max:~$ 

So what is R CMD exactly doing in this example? The output is the same if
I say only the command (using pwd as otherwise the time has changed...): 

,
| 09:35:03 ~$ R CMD pwd
| /Users/rainerkrug
| 09:35:37 ~$ R CMD pwd
| /Users/rainerkrug
| 09:37:44 ~$ pwd
| /Users/rainerkrug
| 09:37:49 ~$
`

And this happens, except in cases where the foo is defined as a CMD in R 
(build, ...):

,
| Commands:
|   BATCH   Run R in batch mode
|   COMPILE Compile files for use with R
|   SHLIB   Build shared library for dynamic loading
|   INSTALL Install add-on packages
|   REMOVE  Remove add-on packages
|   build   Build add-on packages
|   check   Check add-on packages
|   LINKFront-end for creating executable programs
|   Rprof   Post-process R profiling files
|   Rdconv  Convert Rd format to various other formats
|   Rd2pdf  Convert Rd format to PDF
|   Rd2txt  Convert Rd format to pretty text
|   Stangle Extract S/R code from Sweave documentation
|   Sweave  Process Sweave documentation
|   Rdiff   Diff R output ignoring headers etc
|   config  Obtain configuration information about R
|   javareconf  Update the Java configuration variables
|   rtags Create Emacs-style tag files from C, R, and Rd files
`

Unless I miss something, is this is an inconsistency in R?

Rainer


>
> Dirk

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


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

Re: [Rd] R CMD BATCH vs R CMD batch

2015-10-29 Thread Rainer M Krug
Deepayan Sarkar <deepayan.sar...@gmail.com> writes:

> On Thu, Oct 29, 2015 at 2:09 PM, Rainer M Krug <rai...@krugs.de> wrote:
>> Dirk Eddelbuettel <e...@debian.org> writes:
>>
>>> On 28 October 2015 at 21:39, Marius Hofert wrote:
>>> | Out of laziness I just used "R CMD batch" instead of "R CMD BATCH". I
>>> | didn't get an error so didn't think about the consequences... One
>>> | consequence is (at least on Mac OS X 10.11 but probably in more
>>> | generality) that R_BATCH_OPTIONS are ignored, which was kind of fatal
>>> | in my case... I am thus wondering whether it makes sense to either a)
>>> | have R_BATCH_OPTIONS also be respected for "R CMD batch" or b) simply
>>> | not allow "R CMD batch" as a valid command (so requiring to use "R CMD
>>> | BATCH"). Both approaches might be delicate... just wanted to point
>>> | this issue out...
>>>
>>> Same reason we have 'R CMD INSTALL' as there often is /usr/bin/install with
>>> different options ...
>>>
>>> In general 'R CMD foo' will run for any 'foo' in the path:
>>>
>>>edd@max:~$ R CMD date
>>>Wed Oct 28 21:05:01 CDT 2015
>>>edd@max:~$
>>
>> So what is R CMD exactly doing in this example? The output is the same if
>> I say only the command (using pwd as otherwise the time has changed...):
>>
>> ,
>> | 09:35:03 ~$ R CMD pwd
>> | /Users/rainerkrug
>> | 09:35:37 ~$ R CMD pwd
>> | /Users/rainerkrug
>> | 09:37:44 ~$ pwd
>> | /Users/rainerkrug
>> | 09:37:49 ~$
>> `
>>
>> And this happens, except in cases where the foo is defined as a CMD in R 
>> (build, ...):
>>
>> ,
>> | Commands:
>> |   BATCH   Run R in batch mode
>> |   COMPILE Compile files for use with R
>> |   SHLIB   Build shared library for dynamic loading
>> |   INSTALL Install add-on packages
>> |   REMOVE  Remove add-on packages
>> |   build   Build add-on packages
>> |   check   Check add-on packages
>> |   LINKFront-end for creating executable programs
>> |   Rprof   Post-process R profiling files
>> |   Rdconv  Convert Rd format to various other formats
>> |   Rd2pdf  Convert Rd format to PDF
>> |   Rd2txt  Convert Rd format to pretty text
>> |   Stangle Extract S/R code from Sweave documentation
>> |   Sweave  Process Sweave documentation
>> |   Rdiff   Diff R output ignoring headers etc
>> |   config  Obtain configuration information about R
>> |   javareconf  Update the Java configuration variables
>> |   rtags Create Emacs-style tag files from C, R, and Rd 
>> files
>> `
>>
>> Unless I miss something, is this is an inconsistency in R?
>
> One important difference (not sure if the only one) is that R CMD
> defines more environment variables. Compare
>
> env | grep -i tex
> R CMD env | grep -i tex
>
> So for example
>
> R CMD pdflatex
>
> will behave differently from plain pdflatex.

Reading Dirk's email again, I think I get the picture of what ~R CMD foo~ is
doing: running ~foo~ after doing some initial magic.

Out of interest: What is the magic ~R CMD~ is doing? Is it documented
anywhere?

Rainer

>
> -Deepayan

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


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

Re: [Rd] R CMD BATCH vs R CMD batch

2015-10-29 Thread Rainer M Krug
peter dalgaard <pda...@gmail.com> writes:

> On 29 Oct 2015, at 10:44 , Rainer M Krug <rai...@krugs.de> wrote:
>
>> Out of interest: What is the magic ~R CMD~ is doing? Is it documented
>> anywhere?
>
>
> R is open source (and shell scripts are considered self-documenting by 
> some)

True - should have looked in the sources...

>
> On Unix-alikes, R is a shell script which, if called with 1st argument
> CMD, calls ${R_HOME}/bin/Rcmd, which is another shell script that ends
> with
>
> case "${1}" in
> ## this was a separate command prior to 2.10.0
>   Rd2txt)
> cmd="${R_HOME}/bin/Rdconv"
> extra="-t txt"
> ;;
> ## removed in 2.15.0
>   Rd2dvi)
> echo "R CMD Rd2dvi is defunct: use Rd2pdf instead"
> exit 1
> ;;
>   *)
> if test -x "${R_HOME}/bin/${1}"; then
>   cmd="${R_HOME}/bin/${1}"
> else
>   cmd="${1}"
> fi
> ;;
> esac
> shift
>
> exec "${cmd}" ${extra} "${@}"
>
> I.e., except for setting up variables and such, R CMD ${foo}
> essentially looks for ${R_HOME}/bin/${foo} and executes it if it
> exists and is executable, otherwise it just executes ${foo}.

Thanks for that detailed explanation of the mechanism - it is much
clearer now. And as usual, if one knows how something is happening, it's
not "magical" anymore. 

>
> Notice that, somewhat contrary to what Dirk said, this logic works at
> the mercy of the file system when it comes to case sensitivity. On OSX
> with the default case-insensitive setup we get
>
> Peters-iMac:IBP pd$ R CMD install
> Error: ERROR: no packages specified
>
> which comes from R's package installer, whereas a case-sensitive FS
> would pick up /usr/bin/install instead. That is just how the "test"
> shell built-in works:
>
> Peters-iMac:~ pd$ test -x `R RHOME`/bin/INSTALL ; echo $?
> 0
> Peters-iMac:~ pd$ test -x `R RHOME`/bin/UNSTALL ; echo $?
> 1
> Peters-iMac:~ pd$ test -x `R RHOME`/bin/install ; echo $?
> 0

Yeah - true. I was already starting to wonder as I always was using ~R
CMD install~ and it always worked on my Mac.

Thanks again,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


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

Re: [Rd] MetaCran website v1.0.0-alpha

2015-05-24 Thread Rainer M Krug
Gábor Csárdi csardi.ga...@gmail.com writes:

 Dear All,

 [ I was wondering if this should have gone to the new mailing list. Maybe. ]

 As some of you maybe know from my earlier posts, I am building a simple
 search engine for R packages. Now the search engine has a proper web site,
 where you can also browse CRAN packages.

 http://www.r-pkg.org/

 As I see the value is in
 1. package search (search box on top right)
 2. APIs, see http://www.r-pkg.org/services

 It is in alpha version, meaning that things seem to work, some pages are a
 bit slow and there are a lot of glitches to fix.

I had a quick peek, and it looks really nice! I particularly think the
github integration for diff-ing versions can be very use full!

It might be an idea, to also add R itself to the github repo for
diff-ing?

Thanks a lot,

Rainer


 Please tell me what you think.

 Best,
 Gabor

   [[alternative HTML version deleted]]


-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


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


Re: [Rd] update.packages with ask = FALSE will sometimes ask about updates

2015-02-11 Thread Rainer M Krug
Richard Cotton richiero...@gmail.com writes:

 Today while running update.packages(ask = FALSE), R stopped to ask me
 a question:

   There are binary versions available but the source versions are later:
 binary  source needs_compilation
 KernSmooth 2.23-13 2.23-14  TRUE
 mixture1.2 1.3  TRUE

 Do you want to install from sources the packages which need compilation?
 y/n:


 update.packages calls install.packages which calls getDependencies,
 which was where there question originated.

 It seems to me that if I've set ask = FALSE, stopping to ask questions
 is a bug.  There are a few possible interpretations of the best
 behaviour though, so I thought I'd put it up for discussion here
 before (maybe) submitting as a bug.

 1. The existing behaviour is correct: the case of out-of-date binaries
 causes a special situation, and R is right to ask.

 2. ask = FALSE means I want all updates, so don't ask me any
 questions, just install all possible updates.

 3. ask = FALSE means that I don't want any interactivity, but
 out-of-date binaries is a special case, so R should just fail to
 update these packages, with an error message stating that they need to
 be manually updated.

 4. There should be an extra argument that decides between the some or
 all of the behaviours described in 1, 2 and 3.

 Which of these options is best?  (Or have I missed an option?)

I am with R (and youre first option). If I ask for binaries, I want
binaries (because I can not install from source, because I want them
fast, because I have locally different compilers, ...). So to silently
try to install sources instead of binaries could be completely
wrong. Although unlikely, the same applies the other way round, when I
ask for source.

THe other possible option would be 4, but instead of failing (the
binaries might still be newer then the installed versions) to give a
warning - as it is not more: For the settings asked for, these are, the
newest versions are installed - but be warned that there are newer
versions from source.

Thinking about it now, option 4 with warning should be the way to go.

Cheers,

Rainer


-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


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


[Rd] Access variable in attached but removed object

2014-05-09 Thread Rainer M Krug

How can I access an object in an attached but deleted environment, when
the object also exists in the .GolbalEnv?

I hope the example below makes the question clear:

--8---cut here---start-8---
tmp - attach(what=NULL, name=org:variables)
tmp$test = 13
rm(tmp)
test
#  13
test - 24
test
#  24
ls(all=TRUE)
#  character(0)
# 
# how can I access the variable test in the object org:variables in the
# search path?
#
rm(test)
test
#  13
--8---cut here---end---8---

Any suggestions?

Thanks,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpGXsRAdJ4qT.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Access variable in attached but removed object

2014-05-09 Thread Rainer M Krug
Duncan Murdoch murdoch.dun...@gmail.com writes:

 On 09/05/2014, 6:54 AM, Rainer M Krug wrote:

 How can I access an object in an attached but deleted environment, when
 the object also exists in the .GolbalEnv?

 Attaching a variable to the search list generally makes a copy of it,
 so it can't be attached but deleted.  However, making a copy of an
 environment just copies the reference to it, so your environment still
 exists on the search list, it just doesn't have a name in the global
 environment.

I was aware that my wording was not the best - your explanation makes
the whole process much clearer - thanks.



 I hope the example below makes the question clear:

 --8---cut here---start-8---
 tmp - attach(what=NULL, name=org:variables)
 tmp$test = 13
 rm(tmp)
 test
 #  13
 test - 24
 test
 #  24
 ls(all=TRUE)
 #  character(0)

 I don't know why you would have seen character(0) here.  You should
 have seen test in the list, because you created it a couple of lines
 earlier.

You are right. Wrong copy - paste. My fault.


 #
 # how can I access the variable test in the object org:variables in the
 # search path?
 #
 rm(test)
 test
 #  13
 --8---cut here---end---8---

 Any suggestions?

 You can use assign, or get a reference to the environment using
 as.environment(org:variables), and access it within that.  For
 example,

 assign(test, 24, pos=org:variables)

 or

 e - as.environment(org:variables)
 e$test - 24

Perfect - that is what I was looking for.
Both will work perfectly in my case.

Thanks  lot,

Rainer


 Duncan Murdoch

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpwlcZ10K4Mk.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] creating namespaces outside packages

2014-03-28 Thread Rainer M Krug
Hi

I would like to use namespaces outside packages, but I could not find
any references on how to do it (only a thread [1] which says use a
package). Using a package is not possible in my case, as I am passing
variables from org-mode / emacs to R and would like to avoid name
clashes. This is a dynamic process, and each time the code is evaluated,
the variable can be different.

I am putting them at the moment into an environment which is locked, but
I would like to avoid name clashes, so the idea of using environments.

So: is there a way to create a namespace and populate it as I can do
with an environment?

Thanks,

Rainer


Footnotes: 
[1]  
http://r.789695.n4.nabble.com/create-namespace-without-creating-a-package-td3485968.html

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpSpia44kJmE.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] SOLVED: creating namespaces outside packages

2014-03-28 Thread Rainer M Krug
Duncan Murdoch murdoch.dun...@gmail.com writes:

 On 28/03/2014, 7:01 AM, Rainer M Krug wrote:
 Hi

 I would like to use namespaces outside packages, but I could not find
 any references on how to do it (only a thread [1] which says use a
 package). Using a package is not possible in my case, as I am passing
 variables from org-mode / emacs to R and would like to avoid name
 clashes. This is a dynamic process, and each time the code is evaluated,
 the variable can be different.

 I am putting them at the moment into an environment which is locked, but
 I would like to avoid name clashes, so the idea of using environments.

 So: is there a way to create a namespace and populate it as I can do
 with an environment?

 I don't know what you think is the difference between a namespace and
 an environment.  I would say a namespace is one of the environments
 associated with a package, i.e. it's just an environment in a
 particular context.

 So depending on what you are trying to accomplish, it may be fine to
 just set up an environment.  Why do you think that won't work?

An environment is what I use at the moment, but there is one aspect I
was not happy with: accessing the original value in the environment when
it is overwritten in a higher environment in the search path. But then I
discovered then notation of using $:

,
| env - new.env()
| assign(value, 99, env)
| attach(env)
| value - FALSE
| value
| env$value
`

So I can access the original value. I only thought initially about
the :: (or is it :::) to access the objects in a namespace, which do not
work for an environment.

So: Different solution and works perfectly.

Thanks,

Rainer





 Duncan Murdoch


-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgplciMLn7RLU.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Docker versus Vagrant for reproducability - was: The case for freezing CRAN

2014-03-24 Thread Rainer M Krug
Thanks everybody for their input - interesting suggestions and useful
information - thanks.

But I am still struggling to use this information. What I got so far:

1) I have decided to try docker [1]
2) Installed docker and boot2docker on a Mac via homebrew and it works
3) I found some Dockerfiles to create an image with R and ssh
4) The dockerfile runs and creates the image
5) I can interactively connect to the image by using bash and R is
running there
5) As I am using emacs /  ess, I want to use ssh do R stuff (other
suggestions welcome)

Problems:
1) I don't manage to connect to the running docker image following [2] -
I even managed to freeze my computer while trying.
2) Even if I could, I understand that the ssh port would be different each
time - not very nice. Is there a way of setting the port?

Questions:

1) Am I right in saying, that I have to use ssh to access the running
image, or is there a (faster?) alternative? I mean - I am working
locally and I don't need any encryption.

2) Would Vagrant make the process easier?

And finally:

I think it would be great if this information could be collected in a
wiki page, as I did not find anything about the usage scenario of docker
/ vagrant discussed here - I will certainly see that I blog about my
tries.

Cheers,

Rainer

Kirill Müller kirill.muel...@ivt.baug.ethz.ch writes:

 On 03/22/2014 02:10 PM, Nathaniel Smith wrote:
 On 22 Mar 2014 12:38, Philippe GROSJEAN philippe.grosj...@umons.ac.be
 wrote:
 On 21 Mar 2014, at 20:21, Gábor Csárdi csardi.ga...@gmail.com wrote:
 In my opinion it is somewhat cumbersome to use this for everyday work,
 although good virtualization software definitely helps.

 Gabor

 Additional info: you access R into the VM from within the host by ssh.
 You can enable x11 forwarding there and you also got GUI stuff. It works
 like a charm, but there are still some problems on my side when I try to
 disconnect and reconnect to the same R process. I can solve this with, say,
 screen. However, if any X11 window is displayed while I disconnect, R
 crashes immediately on reconnection.

 You might find the program 'xpra' useful. It's like screen, but for x11
 programs.

 -n
 I second that. However, by default, xpra and GNU Screen are not aware
 of each other. To connect to xpra from within GNU Screen, you usually
 need to set the DISPLAY environment variable manually. I have
 described a solution that automates this, so that GUI applications
 just work from within GNU Screen and also survive a disconnect:
 http://krlmlr.github.io/integrating-xpra-with-screen/ .


 -Kirill



Footnotes: 
[1]  https://www.docker.io

[2]  http://docs.docker.io/en/latest/examples/running_ssh_service/

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpECO52k0Gfp.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Docker versus Vagrant for reproducability - was: The case for freezing CRAN

2014-03-24 Thread Rainer M Krug

Forgot: My Dockerfiloe is on github:

https://github.com/rkrug/R-docker

Rainer M Krug rai...@krugs.de writes:

 Thanks everybody for their input - interesting suggestions and useful
 information - thanks.

 But I am still struggling to use this information. What I got so far:

 1) I have decided to try docker [1]
 2) Installed docker and boot2docker on a Mac via homebrew and it works
 3) I found some Dockerfiles to create an image with R and ssh
 4) The dockerfile runs and creates the image
 5) I can interactively connect to the image by using bash and R is
 running there
 5) As I am using emacs /  ess, I want to use ssh do R stuff (other
 suggestions welcome)

 Problems:
 1) I don't manage to connect to the running docker image following [2] -
 I even managed to freeze my computer while trying.
 2) Even if I could, I understand that the ssh port would be different each
 time - not very nice. Is there a way of setting the port?

 Questions:

 1) Am I right in saying, that I have to use ssh to access the running
 image, or is there a (faster?) alternative? I mean - I am working
 locally and I don't need any encryption.

 2) Would Vagrant make the process easier?

 And finally:

 I think it would be great if this information could be collected in a
 wiki page, as I did not find anything about the usage scenario of docker
 / vagrant discussed here - I will certainly see that I blog about my
 tries.

 Cheers,

 Rainer

 Kirill Müller kirill.muel...@ivt.baug.ethz.ch writes:

 On 03/22/2014 02:10 PM, Nathaniel Smith wrote:
 On 22 Mar 2014 12:38, Philippe GROSJEAN philippe.grosj...@umons.ac.be
 wrote:
 On 21 Mar 2014, at 20:21, Gábor Csárdi csardi.ga...@gmail.com wrote:
 In my opinion it is somewhat cumbersome to use this for everyday work,
 although good virtualization software definitely helps.

 Gabor

 Additional info: you access R into the VM from within the host by ssh.
 You can enable x11 forwarding there and you also got GUI stuff. It works
 like a charm, but there are still some problems on my side when I try to
 disconnect and reconnect to the same R process. I can solve this with, say,
 screen. However, if any X11 window is displayed while I disconnect, R
 crashes immediately on reconnection.

 You might find the program 'xpra' useful. It's like screen, but for x11
 programs.

 -n
 I second that. However, by default, xpra and GNU Screen are not aware
 of each other. To connect to xpra from within GNU Screen, you usually
 need to set the DISPLAY environment variable manually. I have
 described a solution that automates this, so that GUI applications
 just work from within GNU Screen and also survive a disconnect:
 http://krlmlr.github.io/integrating-xpra-with-screen/ .


 -Kirill



 Footnotes: 
 [1]  https://www.docker.io

 [2]  http://docs.docker.io/en/latest/examples/running_ssh_service/

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpotOzBykSRL.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [RFC] A case for freezing CRAN

2014-03-21 Thread Rainer M Krug


This is a long and (mainly) interesting discussion, which is fanning out
in many different directions, and I think many are not that relevant to
the OP's suggestion. 

I see the advantages of having such a dynamic CRAN, but also of having a
more stable CRAN. I prefer CRAN as it is now, but ion many cases a more
stable CRAN might b an advantage. So having releases of CRAN might make
sense. But then there is the archiving issue of CRAN.

The suggestion was made to move the responsibility away from CRAN and
the R infrastructure to the user / researcher to guarantee that the
results can be re-run years later. It would be nice to have this build
in CRAN, but let's stick at the scenario that the user should care for
reproducability.

Leaving the issue of compilation out, a package which is creating a
custom installation of the R version which includes the source of the R
version used and the sources of the packages in a on Linux compilable
format, given that the relevant dependencies are installed, would be a
huge step forward. 

I know - compilation on Windows (and sometimes Mac) is a serious
problem), but to archive *all* binaries and to re-compile all older
versions of R and all packages would be an impossible task.

Apart from that - doing your analysis in a Virtual Machine and then
simply archiving this Virtual Machine, would also be an option, but only
for the more tech savy users.

In a nutshell: I think a package would be able to provide the solution
for a local archiving to make it possible to re-run the simulation with
the same tools at a later stage - although guarantees would not be
possible.

Cheers,

Rainer
-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982

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


Re: [Rd] [RFC] A case for freezing CRAN

2014-03-21 Thread Rainer M Krug
Jari Oksanen jari.oksa...@oulu.fi writes:

 Freezing CRAN solves no problem of reproducibility. If you know the
 sessionInfo() or the version of R, the packages used and their
 versions, you can reproduce that set up. If you do not know, then you
 cannot. You can try guess: source code of old release versions of R
 and old packages are in CRAN archive, and these files have dates. So
 you can collect a snapshot of R and packages for a given date. This is
 not an ideal solution, but it is the same level of reproducibility
 that you get with strictly frozen CRAN. CRAN is no the sole source of
 packages, and even with strictly frozen CRAN the users may have used
 packages from other source. I am sure that if CRAN would be frozen
 (but I assume it happens the same day hell freezes), people would
 increasingly often use other package sources than CRAN. The choice is
 easy if the alternatives are to wait for the next year for the bug fix
 release, or do the analysis now and use package versions in R-Forge or
 github. Then you could not assume that frozen CRAN packages were used.

Agree completely here - the solution would be a package, which is
packaging the source (or even binaries?) of your local R setup including
R and packages used. The solution is local - not on a server.


 CRAN policy is not made in this mailing list, and CRAN maintainers are
 so silent that it hurts ears. 

+1

 However, I hope they won't freeze CRAN.

Yes and no - if they do, we need a devel branch which acts like the
current CRAN.


 Strict reproduction seems to be harder than I first imagined:
 ./configure  make really failed for R 2.14.1 and older in my office
 desktop. To reproduce older analysis, I would also need to install
 older tool sets (I suspect gfortran and cairo libraries).

Absolutely - let's not go there. And then there is also the hardware
issue.


 CRAN is one source of R packages, and certainly its policy does not
 suit all developers. There is no policy that suits all.  Frozen CRAN
 would suit some, but certainly would deter some others.

 There seems to a common sentiment here that the only reason anybody
 would use R older than 3.0.3 is to reproduce old results. My
 experience form the Real Life(™) is that many of us use computers that
 we do not own, but they are the property of our employer. This may
 mean that we are not allowed to install there any software or we have
 to pay, or the Department of project has to pay, to the computer
 administration for installing new versions of software (our
 case).  

 This is often called security. Personally I avoid this by using
 Mac laptop and Linux desktop: these are not supported by the
 University computer administration and I can do what I please with
 these, but poor Windows users are stuck. 

Nicely put.

 Computer classes are also
 maintained by centralized computer administration. This January they
 had new R, but last year it was still two years old. However, users
 can install packages in their personal folders so that they can use
 current packages even with older R. Therefore I want to take care that
 the packages I maintain also run in older R. Therefore I also applaud
 the current CRAN policy where new versions of packages are
 backported to previous R release: Even if you are stuck with stale
 R, you need not be stuck with stale packages. Currently I cannot test
 with older R than 2.14.2, though, but I do that regularly and
 certainly before CRAN releases.  If somebody wants to prevent this,
 they can set their package to unnecessarily depend on the current
 version of R. I would regard this as antisocial, but nobody would ask
 what I think about this so it does not matter.

 The development branch of my package is in R-Forge, and only bug fixes
 and (hopefully) non-breaking enhancements (isolated so that they do
 not influence other functions, safe so that API does not change or
 format of the output does not change) are merged to the CRAN release
 branch. This policy was adopted because it fits the current CRAN
 policy, and probably would need to change if CRAN policy changes.

 Cheers, Jari Oksanen

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgp00NlNd0VYd.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Docker versus Vagrant for reproducability - was: The case for freezing CRAN

2014-03-21 Thread Rainer M Krug
Dirk Eddelbuettel e...@debian.org writes:

  o Roger correctly notes that R scripts and packages are just one issue.
Compilers, libraries and the OS matter.  To me, the natural approach these
days would be to think of something based on Docker or Vagrant or (if you
must, VirtualBox).  The newer alternatives make snapshotting very cheap
(eg by using Linux LXC).  That approach reproduces a full environemnt as
best as we can while still ignoring the hardware layer (and some readers
may recall the infamous Pentium bug of two decades ago).

These two tools look very interesting - but I have, even after reading a
few discussions of their differences, no idea which one is better suited
to be used for what has been discussed here: Making it possible to run
the analysis later to reproduce results using the same versions used in
the initial analysis.

Am I right in saying:

- Vagrant uses VMs to emulate the hardware
- Docker does not

wherefore
- Vagrant is slower and requires more space
- Docker is faster and requires less space

Therefore, could one say that Vagrant is more robust in the long run?

How do they compare in relation to different platforms? Vagrant seems to
be platform agnostic, I can develop and run on Linux, Mac and Windows -
how does it work with Docker? 

I just followed [1] and setup Docker on OSX - loos promising - it also
uses an underlying VM. SO both should be equal in regards to
reproducability in the long run?

Please note: I see these questions in the light of this discussion of
reproducability and not in regards to deployment of applications what
the discussions on the web are.

Any comments, thoughts, remarks?

Rainer


Footnotes: 
[1]  http://docs.docker.io/en/latest/installation/mac/

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpCqWmH1aUM1.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [RFC] A case for freezing CRAN

2014-03-21 Thread Rainer M Krug
Jari Oksanen jari.oksa...@oulu.fi writes:

 On 21/03/2014, at 10:40 AM, Rainer M Krug wrote:

 
 
 This is a long and (mainly) interesting discussion, which is fanning out
 in many different directions, and I think many are not that relevant to
 the OP's suggestion. 
 
 I see the advantages of having such a dynamic CRAN, but also of having a
 more stable CRAN. I prefer CRAN as it is now, but ion many cases a more
 stable CRAN might b an advantage. So having releases of CRAN might make
 sense. But then there is the archiving issue of CRAN.
 
 The suggestion was made to move the responsibility away from CRAN and
 the R infrastructure to the user / researcher to guarantee that the
 results can be re-run years later. It would be nice to have this build
 in CRAN, but let's stick at the scenario that the user should care for
 reproducability.

 There are two different problems that alternate in the discussion:
 reproducibility and breakage of CRAN dependencies. Frozen CRAN could
 make *approximate* reproducibility easier to achieve, but real
 reproducibility needs stricter solutions. Actual sessionInfo() is
 minimal information, but re-building a spitting image of old
 environment may still be demanding (but in many cases this does not
 matter).

 Another problem is that CRAN is so volatile that new versions of
 packages break other packages or old scripts. Here the main problem is
 how package developers work. Freezing CRAN would not change that: if
 package maintainers release breaking code, that would be frozen. I
 think that most packages do not make distinction between development
 and release branches, and CRAN policy won't change that.

 I can sympathize with package maintainers having 150 reverse
 dependencies. My main package only has ~50, and it is sure that I
 won't test them all with new release. I sometimes tried, but I could
 not even get all those built because they had other dependencies on
 packages that failed. Even those that I could test failed to detect
 problems (in one case all examples were \dontrun and passed nicely
 tests). I only wish that if people *really* depend on my package, they
 test it against R-Forge version and alert me before CRAN releases, but
 that is not very likely (I guess many dependencies are not *really*
 necessary, but only concern marginal features of the package, but CRAN
 forces to declare those).

Breakage of CRAN packages is a problem, to which I can not comment
much. I have no idea how this could be saved unless one introduces more
checks, which nobody wants. CRAN is a (more or less) open repository for
packages written by engineers / programmers but also scientists of other
fields - and that is the strength of CRAN - a central repository to find
packages which conform to a minimal standard and format. 


 Still a few words about reproducibility of scripts: this can be hardly
 achieved with good coverage, because many scripts are so very ad
 hoc. When I edit and review manuscripts for journals, I very often get
 Sweave or knitr scripts that just work, where just means just so
 and so. Often they do not work at all, because they had some
 undeclared private functionalities or stray files in the author
 workspace that did not travel with the Sweave document. 

One reason why I *always* start my R sessions --vanilla and ave a local
initialization script which I call manually. 

 I think these
 -- published scientific papers -- are the main field where the code
 really should be reproducible, but they often are the hardest to
 reproduce. 

And this is completely ouyt of the hands of R / CRAN / ... and in the
hand of Journals and Authors. But R could provide a framework to make
this more easy in form of a package which provides functions to make
this a one-command approach.

 Nothing CRAN people do can help with sloppy code scientists
 write for publications. You know, they are scientists -- not
 engineers.

Absolutely - and I am also a sloppy scientists - I put my code online,
but hope that not many people ask me later about it.

Cheers,

Rainer


 Cheers, Jari Oksanen
 
 Leaving the issue of compilation out, a package which is creating a
 custom installation of the R version which includes the source of the R
 version used and the sources of the packages in a on Linux compilable
 format, given that the relevant dependencies are installed, would be a
 huge step forward. 
 
 I know - compilation on Windows (and sometimes Mac) is a serious
 problem), but to archive *all* binaries and to re-compile all older
 versions of R and all packages would be an impossible task.
 
 Apart from that - doing your analysis in a Virtual Machine and then
 simply archiving this Virtual Machine, would also be an option, but only
 for the more tech savy users.
 
 In a nutshell: I think a package would be able to provide the solution
 for a local archiving to make it possible to re-run the simulation with
 the same tools at a later stage - although guarantees would not be
 possible

Re: [Rd] Docker versus Vagrant for reproducability - was: The case for freezing CRAN

2014-03-21 Thread Rainer M Krug
Gábor Csárdi csardi.ga...@gmail.com writes:

 You might want to look at packer as well, which can build virtual machines
 from an ISO, without any user intaraction. I successfully used it to build
 VMs with Linux, OSX and Windows. It can also create vagrant boxes. You can
 specify provisioners, e.g. to install R, or a set of R packages, etc. It is
 under heavy development, by the same team as vagrant.

I think I am getting lost in these - I looked ad Docker, and it looks
promising, but I actually didn't even manage to sh into the running
container. Is there somewhere an howto on how one can use these in R, to
the purpose discussed in this thread? If not, I really think this would
be needed. It is extremely difficult for me to translate what I want to
do into the deployment / management / development scenarios discussed in
the blogs I have found.

Cheers, 

(a confused)
Rainer



 Gabor

 On Fri, Mar 21, 2014 at 9:03 AM, Philippe GROSJEAN 
 philippe.grosj...@umons.ac.be wrote:


 ..}))
  ) ) ) ) )
 ( ( ( ( (Prof. Philippe Grosjean
  ) ) ) ) )
 ( ( ( ( (Numerical Ecology of Aquatic Systems
  ) ) ) ) )   Mons University, Belgium
 ( ( ( ( (
 ..

 On 21 Mar 2014, at 10:59, Rainer M Krug rai...@krugs.de wrote:

  Dirk Eddelbuettel e...@debian.org writes:
 
  o Roger correctly notes that R scripts and packages are just one issue.
Compilers, libraries and the OS matter.  To me, the natural approach
 these
days would be to think of something based on Docker or Vagrant or (if
 you
must, VirtualBox).  The newer alternatives make snapshotting very
 cheap
(eg by using Linux LXC).  That approach reproduces a full environemnt
 as
best as we can while still ignoring the hardware layer (and some
 readers
may recall the infamous Pentium bug of two decades ago).
 
  These two tools look very interesting - but I have, even after reading a
  few discussions of their differences, no idea which one is better suited
  to be used for what has been discussed here: Making it possible to run
  the analysis later to reproduce results using the same versions used in
  the initial analysis.
 
  Am I right in saying:
 
  - Vagrant uses VMs to emulate the hardware
  - Docker does not
 
 Yes.


  wherefore
  - Vagrant is slower and requires more space
  - Docker is faster and requires less space
 
 It depends. For instance, if you run R in VirtualBox under Windows, it may
 run faster depending on the code you run and, say, the Lapack library used.
 On Linux, you typically got R code run in the VM 2-3% slower than natively,
 but In a Windows host, most of my R code runs faster in the VM... But yes,
 you need more RAM.

 With Vagrant, you do not need to keep you VM once you don't use it any
 more. Then, disk space is shrunk down to a few kB, corresponding to the
 Vagrant configuration file. I guess the same is true for Docker?

 A big advantage of Vagrant + VirtualBox is that you got a very similar
 virtual hardware, no matter if your host system is Linux, Windows or Mac OS
 X. I see this as a good point for better reproducibility.


  Therefore, could one say that Vagrant is more robust in the long run?
 
 May be,... but it depends almost entirely how VirtualBox will support old
 VMs in the future!

 PhG

  How do they compare in relation to different platforms? Vagrant seems to
  be platform agnostic, I can develop and run on Linux, Mac and Windows -
  how does it work with Docker?
 
  I just followed [1] and setup Docker on OSX - loos promising - it also
  uses an underlying VM. SO both should be equal in regards to
  reproducability in the long run?
 
  Please note: I see these questions in the light of this discussion of
  reproducability and not in regards to deployment of applications what
  the discussions on the web are.
 
  Any comments, thoughts, remarks?
 
  Rainer
 
 
  Footnotes:
  [1]  http://docs.docker.io/en/latest/installation/mac/
 
  --
  Rainer M. Krug
  email: Raineratkrugsdotde
  PGP: 0x0F52F982
  __
  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]]


-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpiXFN9ZrFux.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [RFC] A case for freezing CRAN

2014-03-20 Thread Rainer M Krug
 of the core packages) to store snapshots of installed
package and R version information as a human readable text file, but
which can be parsed by a second command to re-create this setup.

Cheers, and thanks for this important discussion (could have been a GSoC
project?),

Rainer




 Gavin
 A scientist, very much interested in reproducibility of my work and others.

 Michael
 In finance, where we call it Auditability and care very much as well :-)


   [[alternative HTML version deleted]]


-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgp0EotWauDSe.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [RFC] A case for freezing CRAN

2014-03-20 Thread Rainer M Krug
Hadley Wickham h.wick...@gmail.com writes:

 What would be more useful in terms of reproducibility is the capability of
 installing a specific version of a package from a repository using
 install.packages(), which would require archiving older versions in a
 coordinated fashion. I know CRAN archives old versions, but I am not aware
 if we can programmatically query the repository about this.

 See devtools::install_version().

 The main caveat is that you also need to be able to build the package,
 and ensure you have dependencies that work with that version.

The compiling will always be the problem when using older source
packages, whatever is done.

But for the dependencies: an automatic parsing of the dependencies
(DEPENDS, IMPORTS, ...) would help a lot. 

Together with a command which scans the installed package in the session
and stores them in a parsable human readable format so that all packages
(with the specified version) required can be installed with one command,
and I think the problem would be much closer to be solved.

Rainer


 Hadley

-- 
Rainer M. Krug
email: Raineratkrugsdotde
PGP: 0x0F52F982


pgpfAhwo1bQBT.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Question re: NA, NaNs in R

2014-02-10 Thread Rainer M Krug
;
  }
 
  IIUC, there is only one bit pattern used to encode R NA values, so
  this should be safe. But I would like to be sure:
 
  Is there any guarantee that the different functions in R would return
  NA as identical to the bit pattern defined for NA_REAL, for a given
  architecture? Similarly for NaN value(s) and R_NaN?
 
  My guess is that it is possible some functions used internally by R
  might encode NaN values differently; ie, setting the lower word to a
  value different than 1954 (hence being NaN, but potentially not
  identical to R_NaN), or perhaps this is architecture-dependent.
  However, NA should be one specific bit pattern (?). And, I wonder if
  there is any guarantee that the different functions used in R would
  return an NaN value as identical to R_NaN (which appears to be the
  'IEEE NaN')?
 
  (interested parties can see + run a simple benchmark from the gist at
  https://gist.github.com/kevinushey/8911432)
 
  Thanks,
  Kevin
 
  __
  R-devel@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-devel
 
 
 
 --
 Brian D. Ripley,  rip...@stats.ox.ac.uk
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

 __
 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

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug



signature.asc
Description: OpenPGP digital signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Creating Namespace and locking it during runtime?

2014-01-23 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thanks - looks very promising.

Rainer


On 01/23/14, 09:23 , Prof Brian Ripley wrote:
 See ?lockEnvironment, which ??lock shows as ?bindenv .
 
 On 22/01/2014 20:52, Rainer M Krug wrote: Hi
 
 I would like to create a Namespace during runtime, and not during 
 loading a package.
 
 My reasoning is that I want to be able to store a number of
 variables and to protect them from the user (might be even
 myself). The code will not be in a package, but will be
 source()ed.
 
 Next step: pass variables from org mode / emacs to R and to
 protect these variables from accidental change / removal.
 
 Any suggestions on how to do this?
 
 Cheers,
 
 Rainer
 
 
 
 __ 
 R-devel@r-project.org mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-devel
 
 
 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS4NyLAAoJENvXNx4PUvmCXyIH/2+SzGPuvHqBcWBrnRbZV1sV
nLa/NUKCgKq74fvDFbkCocOlVo6Cxkd5+r/FCQXpibiMUmgMyJTsABO1VkuPzNeT
ACXIwRKaci7/91el5OrvL1HBXcAWVdrYBXV6hO7mRqgp/Ait0G49L5rHekDjOhh0
9EJCi81pyzclnXpiu0IEjD2USVq3+VFKBxIiFTcMX6j8Lnzjud5cfVAhH0AOCqN0
asN+BCzNe43moKv1fxyYnSbXTflx56a6/cCWF+XEPpGTvJGhuaZ/WouvA8AledBt
/ViEraWKzvNIcWZAyCbV4aDK83Xu2EJel8cfiXuUUbp2dCZSce3pbifpYUQXqyg=
=FT1o
-END PGP SIGNATURE-

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


[Rd] Creating Namespace and locking it during runtime?

2014-01-22 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

I would like to create a Namespace during runtime, and not during
loading a package.

My reasoning is that I want to be able to store a number of variables
and to protect them from the user (might be even myself). The code
will not be in a package, but will be source()ed.

Next step: pass variables from org mode / emacs to R and to protect
these variables from accidental change / removal.

Any suggestions on how to do this?

Cheers,

Rainer


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS4C+KAAoJENvXNx4PUvmCVZUIALEi/MfHuGEioPbSpw2TOmcx
lw5WCeGlsfQoWFPuX8XZOvc+bE0iv/qz5IuTjHbHrrgdV1Oz0k3ufvukPNhFKr51
r7k3dKJCC5xF0KMXV5sRZYgKc8VL6yGHkrZJw+JrZhmiHnDXiQ41LiPhcd920IU9
68eHMOQKeloiWADPPPseJ7VlWwtMTKOzDem3AdBVL5U3fOFPe8qWy/F/uwuuf6+B
NMEYA7z/JxK80Ud6X8sO/1gAiXZsNdzV4Q8i018LUE5mlO1NiAaB0VNKUCSEzAeM
FM3+9P99ijjaUhmAl58JYNMkYTcwxHFCOuDPaTvRG0h0JBvg3873AZTY4uLF1p0=
=GSUq
-END PGP SIGNATURE-

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


[Rd] SOLVED: check warning with .onLoad() and setClass()

2013-10-07 Thread Rainer M Krug
Thanks John and Dirk for your input.

I solved the problem by importing the package simecol which defines
the superclass simEcol in the NAMESPACE file with import(simEcol) and to
leave it in the DESCRIPTION file in the Depends section (as the
functions have to be available for the end user).

I reverted back to the .onLoad() function:

,
| .onLoad - function(libname, pkgname) {
| setClass(
| inDrak,
| representation(
| init = SpatialGridDataFrame
| ),
| contains = simObj
| )
| }
`

and it works and does not give an error on R CMD check.

Thanks a lot,

Rainer



John Chambers j...@r-project.org writes:

 The basic tool is setLoadActions(), which takes a function definition,
 with the package's namespace as its argument.  Read ?setLoadActions

 There is no such thing as setLoadFunction, as far as the standard code in R.

 While you haven't defined didn't work, an off-the-top-of-the-head
 idea would be something like:

setLoadActions(function(ns) {setClass(., where = ns)})


 On Oct 4, 2013, at 7:07 AM, Rainer M Krug rai...@krugs.de wrote:

 Dirk Eddelbuettel e...@debian.org writes:
 
 On 4 October 2013 at 14:15, Rainer M Krug wrote:
 | Hm. loadModule is Rcpp function, but I am only interested in using the
 | setClass() function, which has nothing to do with Rcpp. I don't even use
 | Rcpp in the package, only in one which is imported.
 
 Sorry, assumed Reference Class created via Modules. My bad, and never mind.
 
 But as John said, .onLoad() can be replaces since he made those changes in R
 (and also in Rcpp). See ?setLoadAction, evalOnLoad(), ...
 
 Ok - theat far I folow you. But how do I implement this?
 
 I have now the following .onLoad() function:
 
 ,
 | .onLoad - function(libname, pkgname) {
 | setClass(
 | inDrak,
 | representation(
 | init = SpatialGridDataFrame
 | ),
 | contains = simObj
 | )
 | }
 `
 
 in the file ./R/onLoad.R in my package.
 
 Now how can I now use the setLoadFunction()? I tried to simply put the
 setClass in the setLoadFunction() as follow into the ./R/onLoad.R file:
 
 ,
 | setLoadFunction( function(libname, pkgname) {
 | setClass(
 | inDrak,
 | representation(
 | init = SpatialGridDataFrame
 | ),
 | contains = simObj
 | )
 | }
 `
 
 but this did not work. 
 
 So what do I have to do with it? I only find very few examples using
 setLoadFunction().
 
 Rainer
 
 
 
 Dirk
 
 
 -- 
 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
 UCT), Dipl. Phys. (Germany)
 
 Centre of Excellence for Invasion Biology
 Stellenbosch University
 South Africa
 
 Tel :   +33 - (0)9 53 10 27 44
 Cell:   +33 - (0)6 85 62 59 98
 Fax :   +33 - (0)9 58 10 27 44
 
 Fax (D):+49 - (0)3 21 21 25 22 44
 
 email:  rai...@krugs.de
 
 Skype:  RMkrug
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel

#secure method=pgpmime mode=sign

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

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


[Rd] search for variable in package in .GlobalEnv first

2013-10-07 Thread Rainer M Krug
Hi

First, sorry if I get the terminology wrong, I am still quite new to the
concept of using environments and workspaces.

Say I have a statement in a package SIM like

sim - TYPE

where the variable TYPE is initialized in the package to
e.g. exponential (SIM::TYPE == exponential).

Now, I want to give the user the option of specifying the variable TYPE,
but to the effect, that if the user does not define a variable TYPE in
the user workspace (.GobalEnv), the one in the namespace from the
package is used.

In other words, I want to look first in the workspace, and then in SIM::
for the variable TYPE. How can do this?

Thanks,

Rainer

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom


pgpFvdLZpRyLG.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] SOLVED: search for variable in package in .GlobalEnv first

2013-10-07 Thread Rainer M Krug
Duncan Murdoch murdoch.dun...@gmail.com writes:

 On 07/10/2013 10:29 AM, Rainer M Krug wrote:
 Hi

 First, sorry if I get the terminology wrong, I am still quite new to the
 concept of using environments and workspaces.

 Say I have a statement in a package SIM like

 sim - TYPE

 where the variable TYPE is initialized in the package to
 e.g. exponential (SIM::TYPE == exponential).

 Now, I want to give the user the option of specifying the variable TYPE,
 but to the effect, that if the user does not define a variable TYPE in
 the user workspace (.GobalEnv), the one in the namespace from the
 package is used.

 In other words, I want to look first in the workspace, and then in SIM::
 for the variable TYPE. How can do this?

 The rgl package does this when looking for defaults for
 graphics. Here's the code:


 getr3dDefaults - function()
 tryCatch(get(r3dDefaults, envir=.GlobalEnv),
  error = function(e) r3dDefaults)

 This will find the variable r3dDefaults if it is in the global
 environment or in a package on the search path; if that fails, it
 returns the local one.  Since that function is defined in the package,
 it can see the local r3dDefaults variable.  You might not want to
 accept anything except what is in .GlobalEnv; in that case, use
 inherits = FALSE in the call to get().

Thanks a lot - works like a charm.

I actually like the ide of searching the searchpath down.

Thanks,

Rainer


 Duncan Murdoch

#secure method=pgpmime mode=sign

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom

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


Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread Rainer M Krug
Thanks John

that is likely the solution to my problem, but I don't understand how I
can use it and I can't find the example in the Rcpp package (I did grep
for setLoadAtion on the whole source package of Rcpp, but nothing came up with 
). Could you
please provide me a link (or the filename) where I can see how to use
this function?

Thanks,

Rainer

John Chambers j...@r-project.org writes:

 Don't use .onLoad() to set class (or other nontrivial) information at
 load time.  Use setLoadActions(), which was created exactly to get
 around the limitations of .onLoad().

 For an example, see the Rcpp package, which uses this to set up load-time C++ 
 linkages.

 John Chambers

 On Oct 3, 2013, at 3:22 AM, Rainer M Krug rai...@krugs.de wrote:

 Hi
 
 I am writing a package in which I define a new class in the .onLoad()
 hook:
 
 ,
 | .onLoad - function(libname, pkgname) {
 | setClass(
 | inDrak,
 | representation(
 | init = SpatialGridDataFrame
 | ),
 | contains = simObj
 | )
 | }
 `
 
 The class simObj is defined in the package, which is in the depends
 section in the DESCRIPTION file:
 
 ,
 | Package: InDrak
 | Type: Package
 | Title: Alien spread management simulation model for the Drakensberg
 | Version: 0.1-0
 | Date: 2013-10-03_11-55
 | Author: Rainer M. Krug
 | Maintainer: Rainer M Krug rai...@krugs.de
 | Description: Simulate the spread of three Invasive Alien Plants under 
 different
 | management and budget scenarios
 | License: GPL-3
 | LazyLoad: yes
 | Depends:
 | RSQLite,
 | simecol
 | Imports:
 | methods,
 | sp,
 | spgrass6,
 | DBI,
 | logger,
 | fireSim,
 | seedProd,
 | seedGerm,
 | seedDisp
 | LinkingTo: Rcpp
 | Collate:
 | 'beginYear.R'
 | 'clearAliens.R'
 | 'competition.R'
 | 'cumulativeDc.R'
 | 'dcToIndLayer.R'
 | 'dispProb2D.R'
 | 'endYear.R'
 | 'fireAliens.R'
 | 'germEst.R'
 | 'initfunc.R'
 | 'layerIO.R'
 | 'layerNames.R'
 | 'main.R'
 | 'newInDrak.R'
 | 'onLoad.R'
 | 'package.R'
 | 'parameter.R'
 | 'parmsAcacia.R'
 | 'parmsBudget.R'
 | 'parmsFire.R'
 | 'parmsPinus.R'
 | 'parmsRubus.R'
 | 'resetOptions.R'
 | 'seedDispersal.R'
 | 'seedProduction.R'
 | 'stats.R'
 `
 
 If important, the NAMESPACE file is here:
 
 ,
 | export(depRateName)
 | export(exportRaster)
 | export(fireLayerName)
 | export(ignitionRiskName)
 | export(importAliens)
 | export(importClearingHistory)
 | export(importFireHistory)
 | export(importIgnitionRisk)
 | export(importSpecies)
 | export(importVegetation)
 | export(layerExists)
 | export(layerName)
 | export(newInDrak)
 | export(parameter)
 | export(parmsAcacia)
 | export(parmsBudget)
 | export(parmsFire)
 | export(parmsPinus)
 | export(parmsRubus)
 | export(resetOptions)
 | export(statDistName)
 | export(suitName)
 | import(DBI)
 | import(fireSim)
 | import(logger)
 | import(methods)
 | import(seedDisp)
 | import(seedGerm)
 | import(seedProd)
 | import(sp)
 | import(spgrass6)
 `
 
 The package builds fine, it installs without problems and works as
 expected, but when checking it, I get the following error:
 
 ,
 | $ R CMD check ./InDrak_0.1-0.tar.gz 
 | * using log directory 
 ‘/Users/rainerkrug/Documents/Projects/R-Packages/inDrak/InDrak.Rcheck’
 | * using R version 3.0.1 (2013-05-16)
 | * using platform: x86_64-apple-darwin10.8.0 (64-bit)
 | * using session charset: UTF-8
 | * checking for file ‘InDrak/DESCRIPTION’ ... OK
 | * checking extension type ... Package
 | * this is package ‘InDrak’ version ‘0.1-0’
 | * checking package namespace information ... OK
 | * checking package dependencies ... OK
 | * checking if this is a source package ... OK
 | * checking if there is a namespace ... OK
 | * checking for executable files ... OK
 | * checking for hidden files and directories ... OK
 | * checking for portable file names ... OK
 | * checking for sufficient/correct file permissions ... OK
 | * checking whether package ‘InDrak’ can be installed ... OK
 | * checking installed package size ... OK
 | * checking package directory ... OK
 | * checking DESCRIPTION meta-information ... OK
 | * checking top-level files ... OK
 | * checking for left-over files ... OK
 | * checking index information ... OK
 | * checking package subdirectories ... OK
 | * checking R files for non-ASCII characters ... OK
 | * checking R files for syntax errors ... OK
 | * checking whether the package can be loaded ... OK
 | * checking whether the package can be loaded with stated dependencies ... 
 OK
 | * checking whether the package can be unloaded cleanly ... OK
 | * checking whether the namespace can be loaded with stated dependencies 
 ... WARNING
 | Error: .onLoad failed in loadNamespace() for ‘InDrak’, details:
 |   call: reconcilePropertiesAndPrototype(name, slots, prototype, 
 superClasses, 
 |   error: no definition was found for superclass “simObj

Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread Rainer M Krug
Dirk Eddelbuettel e...@debian.org writes:

 On 4 October 2013 at 12:59, Rainer M Krug wrote:
 | Thanks John
 | 
 | that is likely the solution to my problem, but I don't understand
 | how I
 | can use it and I can't find the example in the Rcpp package (I did
 | grep
 | for setLoadAtion on the whole source package of Rcpp, but nothing
 | came up with ). Could you
 | please provide me a link (or the filename) where I can see how to
 | use
 | this function?

 Alternatively just call

loadModules(simObj, TRUE)

Hm. loadModule is Rcpp function, but I am only interested in using the
setClass() function, which has nothing to do with Rcpp. I don't even use
Rcpp in the package, only in one which is imported.


 in one of the R/*R files, eg in RcppCNPy I load the module from
 R/cnpy.R --
 and it's the sole R statement in that package as everything happens in
 the
 Modules declaration over in in the src/ directory:

edd@max:~$ cat svn/rcpp/pkg/RcppCNPy/R/*

loadModule(cnpy, TRUE)


edd@max:~$ 

 If you had several modules, you'd need to issue a loadModules(...) for
 each.
 Oh, and rcpp-devel is still ready, willing and able for Rcpp
 questions. ;-)

Thanks - but unless I am missing something here, this has nothing to do
with Rcpp and only concerns basic package writing. John Chambers only
referred me to an example in Rcpp which I can not find.

And I am definitely going to ask Rcpp questions there.


 Hth, Dirk

I guess not much this time - sorry Dirk.

Rainer

#secure method=pgpmime mode=sign

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

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


Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread Rainer M Krug
Dirk Eddelbuettel e...@debian.org writes:

 On 4 October 2013 at 14:15, Rainer M Krug wrote:
 | Hm. loadModule is Rcpp function, but I am only interested in using the
 | setClass() function, which has nothing to do with Rcpp. I don't even use
 | Rcpp in the package, only in one which is imported.

 Sorry, assumed Reference Class created via Modules. My bad, and never mind.

 But as John said, .onLoad() can be replaces since he made those changes in R
 (and also in Rcpp). See ?setLoadAction, evalOnLoad(), ...

Ok - theat far I folow you. But how do I implement this?

I have now the following .onLoad() function:

,
| .onLoad - function(libname, pkgname) {
| setClass(
| inDrak,
| representation(
| init = SpatialGridDataFrame
| ),
| contains = simObj
| )
| }
`

in the file ./R/onLoad.R in my package.

Now how can I now use the setLoadFunction()? I tried to simply put the
setClass in the setLoadFunction() as follow into the ./R/onLoad.R file:

,
| setLoadFunction( function(libname, pkgname) {
| setClass(
| inDrak,
| representation(
| init = SpatialGridDataFrame
| ),
| contains = simObj
| )
| }
`

but this did not work. 

So what do I have to do with it? I only find very few examples using
setLoadFunction().

Rainer



 Dirk


-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

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


[Rd] check warning with .onLoad() and setClass()

2013-10-03 Thread Rainer M Krug
Hi

I am writing a package in which I define a new class in the .onLoad()
hook:

,
| .onLoad - function(libname, pkgname) {
| setClass(
| inDrak,
| representation(
| init = SpatialGridDataFrame
| ),
| contains = simObj
| )
| }
`

The class simObj is defined in the package, which is in the depends
section in the DESCRIPTION file:

,
| Package: InDrak
| Type: Package
| Title: Alien spread management simulation model for the Drakensberg
| Version: 0.1-0
| Date: 2013-10-03_11-55
| Author: Rainer M. Krug
| Maintainer: Rainer M Krug rai...@krugs.de
| Description: Simulate the spread of three Invasive Alien Plants under 
different
| management and budget scenarios
| License: GPL-3
| LazyLoad: yes
| Depends:
| RSQLite,
| simecol
| Imports:
| methods,
| sp,
| spgrass6,
| DBI,
| logger,
| fireSim,
| seedProd,
| seedGerm,
| seedDisp
| LinkingTo: Rcpp
| Collate:
| 'beginYear.R'
| 'clearAliens.R'
| 'competition.R'
| 'cumulativeDc.R'
| 'dcToIndLayer.R'
| 'dispProb2D.R'
| 'endYear.R'
| 'fireAliens.R'
| 'germEst.R'
| 'initfunc.R'
| 'layerIO.R'
| 'layerNames.R'
| 'main.R'
| 'newInDrak.R'
| 'onLoad.R'
| 'package.R'
| 'parameter.R'
| 'parmsAcacia.R'
| 'parmsBudget.R'
| 'parmsFire.R'
| 'parmsPinus.R'
| 'parmsRubus.R'
| 'resetOptions.R'
| 'seedDispersal.R'
| 'seedProduction.R'
| 'stats.R'
`

If important, the NAMESPACE file is here:

,
| export(depRateName)
| export(exportRaster)
| export(fireLayerName)
| export(ignitionRiskName)
| export(importAliens)
| export(importClearingHistory)
| export(importFireHistory)
| export(importIgnitionRisk)
| export(importSpecies)
| export(importVegetation)
| export(layerExists)
| export(layerName)
| export(newInDrak)
| export(parameter)
| export(parmsAcacia)
| export(parmsBudget)
| export(parmsFire)
| export(parmsPinus)
| export(parmsRubus)
| export(resetOptions)
| export(statDistName)
| export(suitName)
| import(DBI)
| import(fireSim)
| import(logger)
| import(methods)
| import(seedDisp)
| import(seedGerm)
| import(seedProd)
| import(sp)
| import(spgrass6)
`

The package builds fine, it installs without problems and works as
expected, but when checking it, I get the following error:

,
| $ R CMD check ./InDrak_0.1-0.tar.gz 
| * using log directory 
‘/Users/rainerkrug/Documents/Projects/R-Packages/inDrak/InDrak.Rcheck’
| * using R version 3.0.1 (2013-05-16)
| * using platform: x86_64-apple-darwin10.8.0 (64-bit)
| * using session charset: UTF-8
| * checking for file ‘InDrak/DESCRIPTION’ ... OK
| * checking extension type ... Package
| * this is package ‘InDrak’ version ‘0.1-0’
| * checking package namespace information ... OK
| * checking package dependencies ... OK
| * checking if this is a source package ... OK
| * checking if there is a namespace ... OK
| * checking for executable files ... OK
| * checking for hidden files and directories ... OK
| * checking for portable file names ... OK
| * checking for sufficient/correct file permissions ... OK
| * checking whether package ‘InDrak’ can be installed ... OK
| * checking installed package size ... OK
| * checking package directory ... OK
| * checking DESCRIPTION meta-information ... OK
| * checking top-level files ... OK
| * checking for left-over files ... OK
| * checking index information ... OK
| * checking package subdirectories ... OK
| * checking R files for non-ASCII characters ... OK
| * checking R files for syntax errors ... OK
| * checking whether the package can be loaded ... OK
| * checking whether the package can be loaded with stated dependencies ... OK
| * checking whether the package can be unloaded cleanly ... OK
| * checking whether the namespace can be loaded with stated dependencies ... 
WARNING
| Error: .onLoad failed in loadNamespace() for ‘InDrak’, details:
|   call: reconcilePropertiesAndPrototype(name, slots, prototype, superClasses, 
|   error: no definition was found for superclass “simObj” in the specification 
of class “inDrak”
| Execution halted
| 
| A namespace must be able to be loaded with just the base namespace
| loaded: otherwise if the namespace gets loaded by a saved object, the
| session will be unable to start.
| 
| Probably some imports need to be declared in the NAMESPACE file.
| * checking whether the namespace can be unloaded cleanly ... WARNING
| Error: .onLoad failed in loadNamespace() for ‘InDrak’, details:
|   call: reconcilePropertiesAndPrototype(name, slots, prototype, superClasses, 
|   error: no definition was found for superclass “simObj” in the specification 
of class “inDrak”
| Execution halted
| * checking loading without being on the library search path ... OK
| * checking for unstated dependencies in R code ... OK
| * checking S3 generic/method consistency ... OK
| * checking replacement functions ... OK
| * checking foreign function calls ... OK

Re: [Rd] ASCII art in function documentation - difference html and text output?

2013-09-05 Thread Rainer M Krug
Found a solution.

putting \cr at the end of each line inserts a carriage return, but no
additional empty line. So

,
| \code{+--+--+--+} \cr
| \code{| 1/16 | 1/16 | 1/16 |} \cr
| \code{+--+--+--+} \cr
| \code{| 1/16 | 8/16 | 1/16 |} \cr
| \code{+--+--+--+} \cr
| \code{| 1/16 | 1/16 | 1/16 |} \cr
| \code{+--+--+--+} \cr
`

produces the desired output.


But interestingly,

,
| \code{
| +--+--+--+ \cr
| | 1/16 | 1/16 | 1/16 | \cr
| +--+--+--+ \cr
| | 1/16 | 8/16 | 1/16 | \cr
| +--+--+--+ \cr
| | 1/16 | 1/16 | 1/16 | \cr
| +--+--+--+ \cr
| }
`

produces the correct output in html, 

,
| /p
| pcode +--+--+--+ br | 1/16 | 1/16 | 1/16 |
|   br +--+--+--+ br | 1/16 | 8/16 | 1/16 | br
|   +--+--+--+ br | 1/16 | 1/16 | 1/16 | br
|   +--+--+--+ br /code
| /p
`

but

,
|  ' +--+--+--+
|  | 1/16 | 1/16 | 1/16 |
| 
|  +--+--+--+
|  | 1/16 | 8/16 | 1/16 |
|  +--+--+--+
|  | 1/16 | 1/16 | 1/16 |
|  +--+--+--+
`

in the text version - is there a bug somewhere?

Thanks,

Rainer



Rainer M Krug rai...@krugs.de writes:

 Sarah Goslee sarah.gos...@gmail.com writes:

 Untested, but did you try wrapping the whole thing in a single code block:

 Nope - also in one line.

 Rainer


 \code{
 all
 the
 things
 }

 Sarah

 On Thu, Sep 5, 2013 at 10:10 AM, Rainer M Krug rai...@krugs.de wrote:
 Hi

 I want to include ascii art in a function documentation which should
 look as follow:

 ,
 | +--+--+--+
 | | 1/16 | 1/16 | 1/16 |
 | +--+--+--+
 | | 1/16 | 8/16 | 1/16 |
 | +--+--+--+
 | | 1/16 | 1/16 | 1/16 |
 | +--+--+--+
 `


 to keep the monospaced font even in html, I decided to use \code{}:

 ,
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 1/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 8/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 1/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 `

 But the result was an empty line between each text:

 ,
 |  '+--+--+--+'
 |
 |  '| 1/16 | 1/16 | 1/16 |'
 |
 |  '+--+--+--+'
 |
 |  '| 1/16 | 8/16 | 1/16 |'
 |
 |  '+--+--+--+'
 |
 |  '| 1/16 | 1/16 | 1/16 |'
 |
 |  '+--+--+--+'
 `

 and when no empty lines were included obviously put everything behind
 each other.

 My question:

 Is there a way that I can achieve the ASCII art as shown above? Is there
 a way of having a \linebreak which does not insert a new line?

 Thanks,

 Rainer


 --
 #secure method=pgpmime mode=sign

#secure method=pgpmime mode=sign

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom

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


[Rd] ASCII art in function documentation?

2013-09-05 Thread Rainer M Krug
Hi

I want to include ascii art in a function documentation which should
look as follow:

,
| +--+--+--+
| | 1/16 | 1/16 | 1/16 |
| +--+--+--+
| | 1/16 | 8/16 | 1/16 |
| +--+--+--+
| | 1/16 | 1/16 | 1/16 |
| +--+--+--+
`


to keep the monospaced font even in html, I decided to use \code{}:

,
| \code{+--+--+--+}
| 
| \code{| 1/16 | 1/16 | 1/16 |}
| 
| \code{+--+--+--+}
| 
| \code{| 1/16 | 8/16 | 1/16 |}
| 
| \code{+--+--+--+}
| 
| \code{| 1/16 | 1/16 | 1/16 |}
| 
| \code{+--+--+--+}
`

But the result was an empty line between each text:

,
|  '+--+--+--+'
| 
|  '| 1/16 | 1/16 | 1/16 |'
| 
|  '+--+--+--+'
| 
|  '| 1/16 | 8/16 | 1/16 |'
| 
|  '+--+--+--+'
| 
|  '| 1/16 | 1/16 | 1/16 |'
| 
|  '+--+--+--+'
`

and when no empty lines were included obviously put everything behind
each other.

My question:

Is there a way that I can achieve the ASCII art as shown above? Is there
a way of having a \linebreak which does not insert a new line?

Thanks,

Rainer


-- 
Rainer M. Krug

email: RMKrugatgmaildotcom

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


Re: [Rd] ASCII art in function documentation?

2013-09-05 Thread Rainer M Krug
OK - it boils down to an roxygen problem.

I will send a separate email for it.
Thanks,

Rainer


Sarah Goslee sarah.gos...@gmail.com writes:

 Now that I'm at the computer with my R code, I've used both
 \preformatted{}
 and \cr to force line breaks.

 Some combination of those may work for you.

 Sarah


 On Thu, Sep 5, 2013 at 11:10 AM, Rainer M Krug rai...@krugs.de wrote:
 Sarah Goslee sarah.gos...@gmail.com writes:

 Untested, but did you try wrapping the whole thing in a single code block:

 Nope - also in one line.

 Rainer


 \code{
 all
 the
 things
 }

 Sarah

 On Thu, Sep 5, 2013 at 10:10 AM, Rainer M Krug rai...@krugs.de wrote:
 Hi

 I want to include ascii art in a function documentation which should
 look as follow:

 ,
 | +--+--+--+
 | | 1/16 | 1/16 | 1/16 |
 | +--+--+--+
 | | 1/16 | 8/16 | 1/16 |
 | +--+--+--+
 | | 1/16 | 1/16 | 1/16 |
 | +--+--+--+
 `


 to keep the monospaced font even in html, I decided to use \code{}:

 ,
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 1/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 8/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 1/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 `

 But the result was an empty line between each text:

 ,
 |  '+--+--+--+'
 |
 |  '| 1/16 | 1/16 | 1/16 |'
 |
 |  '+--+--+--+'
 |
 |  '| 1/16 | 8/16 | 1/16 |'
 |
 |  '+--+--+--+'
 |
 |  '| 1/16 | 1/16 | 1/16 |'
 |
 |  '+--+--+--+'
 `

 and when no empty lines were included obviously put everything behind
 each other.

 My question:

 Is there a way that I can achieve the ASCII art as shown above? Is there
 a way of having a \linebreak which does not insert a new line?

 Thanks,

 Rainer


 --
 #secure method=pgpmime mode=sign

 --
 Rainer M. Krug

 email: RMKrugatgmaildotcom


#secure method=pgpmime mode=sign

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom

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


Re: [Rd] ASCII art in function documentation?

2013-09-05 Thread Rainer M Krug
Sarah Goslee sarah.gos...@gmail.com writes:

 Untested, but did you try wrapping the whole thing in a single code block:

Nope - also in one line.

Rainer


 \code{
 all
 the
 things
 }

 Sarah

 On Thu, Sep 5, 2013 at 10:10 AM, Rainer M Krug rai...@krugs.de wrote:
 Hi

 I want to include ascii art in a function documentation which should
 look as follow:

 ,
 | +--+--+--+
 | | 1/16 | 1/16 | 1/16 |
 | +--+--+--+
 | | 1/16 | 8/16 | 1/16 |
 | +--+--+--+
 | | 1/16 | 1/16 | 1/16 |
 | +--+--+--+
 `


 to keep the monospaced font even in html, I decided to use \code{}:

 ,
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 1/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 8/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 |
 | \code{| 1/16 | 1/16 | 1/16 |}
 |
 | \code{+--+--+--+}
 `

 But the result was an empty line between each text:

 ,
 |  '+--+--+--+'
 |
 |  '| 1/16 | 1/16 | 1/16 |'
 |
 |  '+--+--+--+'
 |
 |  '| 1/16 | 8/16 | 1/16 |'
 |
 |  '+--+--+--+'
 |
 |  '| 1/16 | 1/16 | 1/16 |'
 |
 |  '+--+--+--+'
 `

 and when no empty lines were included obviously put everything behind
 each other.

 My question:

 Is there a way that I can achieve the ASCII art as shown above? Is there
 a way of having a \linebreak which does not insert a new line?

 Thanks,

 Rainer


 --
#secure method=pgpmime mode=sign

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom

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


Re: [Rd] ASCII art in function documentation?

2013-09-05 Thread Rainer M Krug
Brian G. Peterson br...@braverock.com writes:

 On 09/05/2013 09:10 AM, Rainer M Krug wrote:
   want to include ascii art in a function documentation which should
 look as follow:

 ,
 | +--+--+--+
 | | 1/16 | 1/16 | 1/16 |
 | +--+--+--+
 | | 1/16 | 8/16 | 1/16 |
 | +--+--+--+
 | | 1/16 | 1/16 | 1/16 |
 | +--+--+--+
 `


 to keep the monospaced font even in html, I decided to use \code{}:

 Wouldn't it be best to use the relatively new \figure markup with
 alternate text?

 http://cran.r-project.org/doc/manuals/R-exts.html#Figures

Thanks - mus't have overlooked it.

This would definitely work, but in this case I think ASCII art would be
the better solution.

Thanks,

Rainer


 Regards,

 Brian
#secure method=pgpmime mode=sign

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom

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


[Rd] Perplexed with environment

2013-06-25 Thread Rainer M Krug
Hi

I migrated from Linux to Mac, but I don't this has anything to do with
it, but I am not sure.

I am writing a small logger package, in which I have a file 

aaa.R:
,
|  .logData - new.env()
|   assign(loggingThreshold, 10, envir = .logData)
|   assign(logToFile, FALSE, envir = .logData)
|   assign(logFileName, NULL, envir = .logData)
| 
|   assign(logToConsole, TRUE, envir = .logData)
|   ##
|   assign(logHeaderLevel, 0, envir = .logData)
|   assign(logHeader, , envir = .logData)
|   assign(logHeaderClock, , envir = .logData)
|   assign(timeFormat, , envir = .logData)
`
to initialize some logging parameter.
 
When I load my package, everything looks fine, only that the environment
logger:::.logData is (nearly) empty:

,
|  library(logger)
|  ls(envir=logger:::.logData, all.names=TRUE)
| [1] .logHeader  .logHeaderClock .logHeaderLevel
`

I assume I am doing something really basic wrong?

A copy of the package is available at:

https://www.dropbox.com/s/hv6abepcczrljum/logger_0.0-1.tar.gz

Thanks,

Rainer

PS: I am planning to making it available when it is working (again)

-- 
Rainer M. Krug

email: RMKrugatgmaildotcom


pgp_a9eqrII9M.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] ess completion

2013-03-22 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 22/03/13 13:30, Terry Therneau wrote:
 The thread is strange to me as well, since completion is logically impossible 
 for my Sweave
 files. - an emacs buffer is open working on an .Rnw file - there is no copy 
 of R running
 anywhere on the machine - the code chunk in the .Rnw file refers to a R data 
 object saved
 somewhere else Of course it cannot do name completion on a bit of code I'm 
 writing, lacking
 omniscient powers. Emacs is good but not that good :-)
 
 The ESS manual section 12.1 states that for .R files it has completion of 
 object names and
 file names.  I'm puzzled by exactly what this means, since it is logically 
 impossible (without
 a running R session) to do this in general. Linking an .Rnw file to an 
 inferior R process
 doesn't make sense to me.
 
 However, I think it's time to move this sub-thread off of R-devel.  Respond 
 to me privately
 about the answer or the proper list for this discussion.

If anybody wants to continue this ESS discussion:

The proper list is the ESS mailing list: 
https://stat.ethz.ch/mailman/listinfo/ess-help

See you there,

Rainer

 
 Terry T
 
 On 03/22/2013 06:00 AM, r-devel-requ...@r-project.org wrote:
 This thread is strange for me to read as I've been getting completion of 
 object names,
 function arguments names, and whatnot in ESS buffers for as long as I can 
 have been using it.
 And I'm only on ESS 12.09.
 
 Perhaps you need to set `ess-use-R-completion` to non-nil. Or check the 
 value of
 `completion-at-point-functions`. Mine is '(ess-roxy-tag-completion 
 ess-filename-completion
 ess-object-completion t)
 
 Peter
 
 __ R-devel@r-project.org mailing 
 list 
 https://stat.ethz.ch/mailman/listinfo/r-devel


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRTF8CAAoJENvXNx4PUvmCrSQH/inP6c5JT+YEJYDEGOkLQOiA
8GLGzgCdO+iekF1EMrKVvcPjim14gRu+y2HcryxMO44w1gIutcY2wpq6m7OYvCXI
BV40TjKut6nLzopx0IWVr0vX+mA5IybKiziup+lSS86gb5E8QNRVlBFIw3Xp2TXP
rMlS6kkNiQR6y94lwdnUJTy/FerqsV9sQNnNUNipTPt9coL4qISyl1TDoDImrtgM
kCG/kSoUnazzldH39qHgfEJb4rhgCLISNFKbPmtCuCbKh+iF0bHJF4rlEXrSkiRu
GsmfV1Ln3hWmYijtOygHUlmeSiiVTZVVtfXA5oXrW/GXVvDCYEkSTDuu3JbIj7o=
=DJwz
-END PGP SIGNATURE-

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


Re: [Rd] Deprecating partial matching in $.data.frame

2013-03-21 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 20/03/13 17:58, Hadley Wickham wrote:
 On Wed, Mar 20, 2013 at 11:26 AM, peter dalgaard pda...@gmail.com wrote:
 
 On Mar 20, 2013, at 16:59 , William Dunlap wrote:
 
 Will you be doing the same for attribute names?
 
 Not at this point.
 
 It would be really nice to have consistent behaviour across argument names, 
 attributes, lists 
 and data frames, at least for R CMD check.

I agree with Hadley that consistency is quite important. This is especially 
true for data.frames
and lists, as this concerns the data itself, and not names or attributes of the 
data.

I would very much like to see at least at the level of R CMD check warnings for 
*all* partial
matching so that they can be ironed out before in the next stage warnings are 
give to the user (as
mentioned by Milan).

I was bitten at least once by a bug, which cost me quite some time to figure 
out, caused by
partial completion and would very much like to see it go (or at least have the 
option to show
warnings if it occurs).

Cheers,

Rainer



 
 Hadley
 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRSsQOAAoJENvXNx4PUvmC7zkH/Rp0yFMmgQD9D2Z2EpWm5vGR
T0ojk8WKCeqoGY4IKpCPP0rSKJqPI0HxjdAplOclFSdfBaCDrHdALLaxzqJWG6TJ
346A/lAgdgbJWNTTWMXiXcq2vqDKAvoOVhZ/A1YDo7CzjZsgpcBPzmUZREFNSDKu
TeFNM29GgLIaQ2JqV6wRPQee/j36+iLpcCfACTdsXs0H/kRkcogV96g75OTGsxJr
9pZRzOQpH0fv9DsdLGkOCO1twZ+XtWOKSCmTTcOJ97wBWcYk80jrwJObKFG7qMz7
VVoz38hWjgLKj9RRKSLtEtIfUhNogvT5bayPO3ZBD1jDx8qRfm8BtNV+ofEvnd0=
=akLx
-END PGP SIGNATURE-

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


Re: [Rd] requesting a new SIG mailing list

2012-02-14 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 13/02/12 17:30, Mauricio Zambrano-Bigiarini wrote:
 Dear R developers,
 
 Due to the increasing use R in hydrology and other close-related 
 environmental sciences, I would like to ask if it would be possible
 to create a new Special Interest Group mailing list, called
 'R-sig-hydro', specially devoted those topics. If possible to do
 so, I'd offer myself to maintain such mailing list (if needed).

I think it would be more useful to use the R-sig-geo for that, as
hydrology (please correct me if I am wrong - I am not an expert in
hydrology) is mainly spatial.

A fragmentation of the lists would need to duplicate effort by members.

Cheers,

Rainer


 
 
 Thanks in advance,
 
 Mauricio Zambrano-Bigiarini
 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk86HRQACgkQoYgNqgF2egp1pwCfXrUJEBhQ8+50iwv7iYEZXa1C
7l4Anj9EmGCL3QE61VGZ/bw+/3r8n5b4
=bVRp
-END PGP SIGNATURE-

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


Re: [Rd] [R] Version control (git, mercurial) for R packages

2012-02-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/02/12 22:05, Davor Cubranic wrote:
 On February 10, 2012 09:11:35 AM Rainer M Krug wrote:
 But what I was thinking about (in my other post as well) is to
 include github (or any other git repo provider) into r-forge for
 the automatic creation of packages.
 
 So is there an easy way to kind of push a certain revision up to 
 r-forge to have the automatic builds? One could do it manualy,
 but automatic would be so much nicer.
 
 With Git, it is possible to add a remote branch that points to a
 Subversion repository. That way, you do your work on Github, and
 when you're ready to release, just push your changes to R-Forge
 SVN.
 
 Details: http://cameron.bracken.bz/git-with-r-forge
 
 Davor

Thanks - then I'll look into it again - hope I'll understand it this time.

Cheers,

Rainer


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk84ynEACgkQoYgNqgF2egqsOgCeOUeo0asKMn59eDaO0l/gzZyU
Nd0AoIGo96eBbV+01ymBmrxN3s5I2we0
=kaBh
-END PGP SIGNATURE-

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


Re: [Rd] [R] Version control (git, mercurial) for R packages

2012-02-10 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

CCd to r-devel as suggested by Peter.

On 09/02/12 19:28, Hadley Wickham wrote:
 I'm exploring using a version control system to keep better
 track of changes to the packages I maintain. I'm leaning
 towards git (although mercurial also looks good) but am not
 sure what is the best way to set up the repository. It seems I
 can't set the repository directly within the R package main
 directory, since it will be incompatible with the standard
 package structure. I can set the repository in the directory
 that contains my R packages, but then I have a single
 repository for all of my packages, which is not ideal.
 
 Git is nice - but if you ar looking for simplicity in usage for
 R packages, I guess r-forge and rforge are the easiest to use.
 
 I think git + github is substantially easier to use, especially if
 you want to incorporate patches from the community.
 
 But I would be interested in the workflow when using github as
 the main VCS.
 
 The thing that has made this really successful for me is the 
 install_github function in devtools.  Then it's easy for people to
 try out development versions:
 
 install.packages(devtools) library(devtools) 
 install_github(myrepo, myusername)

Thanks Hadley - I should definitely look closer into the devtools
package - there really seem to be some gems in there.
One example is this function - sounds perfect for small scale usages
and for developers.

But what I was thinking about (in my other post as well) is to include
github (or any other git repo provider) into r-forge for the automatic
creation of packages.

So is there an easy way to kind of push a certain revision up to
r-forge to have the automatic builds?
One could do it manualy, but automatic would be so much nicer.

 
 This requires a working R development environment but thanks to
 the hard work of Simon Urbanek, Duncan Murdoch, Brian Ripley and
 others, this is a one-install process on all major platforms.

True - no problem for developers.

Cheers,

Rainer

 
 Hadley
 
 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk800TcACgkQoYgNqgF2ego0QgCfcDIpUlxmVHfYMHi/IlCNKSJ3
1sIAnjQEmBYoTXIE5SlvRUqs/eAioibC
=38uA
-END PGP SIGNATURE-

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


Re: [Rd] bug in rank(), order(), is.unsorted() on character vector

2011-12-07 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/12/11 15:48, Joris Meys wrote:
 @Barry : regardless of whether '_' comes before or after '1' , it 
 should be consistent. Adding an 'a' shouldn't shift '_' from
 before '1' to between '1' and '2', that's clearly an error. The
 help files are not stating anything about that. The only thing I
 can imagine, is that '_' gets ignored (in that case 19a would rank
 before 1a).
 
 This said, I can't reproduce.

I can:

 x - c(_1_, 1_9, 2_9) xa - paste(x,'a',sep='') rank(x)
[1] 1 2 3
 rank(xa)
[1] 2 1 3
 sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: i686-pc-linux-gnu (32-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_GB.UTF-8LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=en_GB.UTF-8LC_MESSAGES=en_GB.UTF-8
 [7] LC_PAPER=C LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base
 version
   _
platform   i686-pc-linux-gnu
arch   i686
os linux-gnu
system i686, linux-gnu
status
major  2
minor  14.0
year   2011
month  10
day31
svn rev57496
language   R
version.string R version 2.14.0 (2011-10-31)
 

Interesting.

Rainer


 
 x - c(_1_, 1_9, 2_9) xa - paste(x,'a',sep='') rank(x)
 [1] 1 2 3
 rank(xa)
 [1] 1 2 3
 
 sessionInfo()
 R version 2.14.0 Patched (2006-00-00 r0) Platform:
 i386-pc-mingw32/i386 (32-bit)
 
 locale: [1] LC_COLLATE=English_United States.1252
 LC_CTYPE=English_United States.1252LC_MONETARY=English_United
 States.1252 [4] LC_NUMERIC=C
 LC_TIME=English_United States.1252
 
 attached base packages: [1] grDevices datasets  splines   graphics
 stats tcltk utils methods   base
 
 other attached packages: [1] svSocket_0.9-51 TinnR_1.0.3
 R2HTML_2.2  Hmisc_3.8-3 survival_2.36-9
 
 loaded via a namespace (and not attached): [1] cluster_1.14.1
 grid_2.14.0 lattice_0.19-33 svMisc_0.9-63 tools_2.14.0
 
 
 2011/12/7 Hervé Pagès hpa...@fhcrc.org:
 Hi,
 
 This looks OK:
 
 x - c(_1_, 1_9, 2_9) rank(x)
 [1] 1 2 3
 
 But this does not:
 
 xa - paste(x, a, sep=) xa
 [1] _1_a 1_9a 2_9a
 rank(xa)
 [1] 2 1 3
 
 Cheers, H.
 
 sessionInfo()
 R version 2.14.0 (2011-10-31) Platform: x86_64-unknown-linux-gnu
 (64-bit)
 
 locale: [1] LC_CTYPE=en_CA.UTF-8   LC_NUMERIC=C [3]
 LC_TIME=en_CA.UTF-8LC_COLLATE=en_CA.UTF-8 [5]
 LC_MONETARY=en_CA.UTF-8LC_MESSAGES=en_CA.UTF-8 [7] LC_PAPER=C
 LC_NAME=C [9] LC_ADDRESS=C   LC_TELEPHONE=C [11]
 LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C
 
 attached base packages: [1] stats graphics  grDevices utils
 datasets  methods   base
 
 loaded via a namespace (and not attached): [1] tools_2.14.0
 
 
 -- Hervé Pagès
 
 Program in Computational Biology Division of Public Health
 Sciences Fred Hutchinson Cancer Research Center 1100 Fairview
 Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024
 
 E-mail: hpa...@fhcrc.org Phone:  (206) 667-5791 Fax:(206)
 667-1319
 
 __ 
 R-devel@r-project.org mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-devel
 
 
 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7fgQMACgkQoYgNqgF2egrjvACffUhSUEriYGSQY8MstwVbvAj6
+w8An1FrwX0YXqDUqDoRq/zW31FW7WOj
=zQr1
-END PGP SIGNATURE-

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


Re: [Rd] Case: package removed from CRAN, but not orphaned

2011-11-25 Thread Rainer M Krug
2011/11/25 Uwe Ligges lig...@statistik.tu-dortmund.de

 On 25.11.2011 11:56, Pfaff, Bernhard Dr. wrote:

 Dear R-Devel subscriber,

 I would like to raise a topic and ask for your advice, guidance.
 Today on R-help an issue with a certain package popped up that has been
 removed from CRAN, because it failed the checks and/or the dependencies are
 not any longer available. The package maintainer has been alerted to this
 issue a couple of times and kindly asked to fix the code, such that it
 fullfills the CRAN requirements. However, neither a fix is applied, nor has
 the package been orphaned such that someone else could take over the
 ownership and rectify the package.
 In principal, and if I am not mistaken, one could simply take the code,
 fix it and release it (the package is under GPL-2). However, I would
 consider this as a rather rude approach. Hence, my question would be, if
 the R Core team can take the initiative, to declare the package as being
 orphaned after a 'warning period' has been elapsed in which the current
 maintainer is kindly asked to fix his package. Would it be feasible to ask
 R Core to orphan a package?

 Best,
 Bernhard

 ps: Incidentally, I am aware of the new 'orphaned package rules', in
 particular under the rubrique 'Possible reasons for orphanizing a package',
 point 2). In the case of the package in question, the maintainer does
 respond to emails, but either seems to lack action and/or has a different
 time scale and awareness of time.



 As Duncan wrote already, CRAN is not run by R-core - as you probably know,
 I have already maintained parts of CRAN for quite some time before I became
 core member.

 Let me as one of the CRAN maintainers add:

 We know that orphaning would be a nice hint to the community, but it takes
 some work and given we have  3000 packages, many of them not well
 maintained, we have to archive or orphan many packages a year nowadays. Due
 the already huge amount of work CRAN maintenance generates, we simply
 cannot invest more time given the time constraints.

 Note that we archive packages if a maintainer asks us to do so or if the
 maintainer is unresponsive on our requests to fix the package. Since we as
 CRAN maintainers were unsuccessful to contact or convince the maintainer to
 fix, we typically won't invest more time/work on such a package.

 Of course, if someone wants to take over an archived package and cannot
 get a response from the maintainer (but first try to do so yourself!) then
 a request to take over as maintainer can be sent to CRAN.

 Currently we are working on a new CRAN policy document that will soon be
 published. This document may clarify some further questions and establishes
 some stricter policies to reduce the workload of CRAN maintainers.


Just as an idea to make sure that CRAN only contains maintained packages
with a maintainer who feels responsible: Would it be feasible to introduce
a system, so that each year (or for each release of a new version of R) the
maintainers are automatically contacted via email and must reply to have
their packages included in the new spring cleaned version of CRAN? This
process could be automated, including the email confirmations (like mailing
list subscriptions) and the non-maintained packages could be relocated to a
second CRAN or marked as will be removed at next springclean? This would
make sure that CRAN contains only active packages.

Cheers,

Rainer



 Best wishes,
 Uwe Ligges






 *
 Confidentiality Note: The information contained in this ...{{dropped:10}}

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


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




-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

[[alternative HTML version deleted]]

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


[Rd] Error in documentation of merge

2011-11-04 Thread Rainer M Krug
Hi

there seems to be an error in the documentation of the merge function:

Arguments:

x, y: data frames, or objects to be coerced to one.

  by, by.x, by.y: specifications of the common columns.  See ‘Details’.

 all: logical; ‘all = L’ is shorthand for ‘all.x = L’ and ‘all.y =
  L’.


The L should be a T or a TRUE.

Cheers,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

[[alternative HTML version deleted]]

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


Re: [Rd] Error in documentation of merge

2011-11-04 Thread Rainer M Krug
On Fri, Nov 4, 2011 at 1:20 PM, peter dalgaard pda...@gmail.com wrote:


 On Nov 4, 2011, at 13:11 , Rainer M Krug wrote:

  Hi
 
  there seems to be an error in the documentation of the merge function:
 
  Arguments:
 
 x, y: data frames, or objects to be coerced to one.
 
   by, by.x, by.y: specifications of the common columns.  See ŒDetails‚.
 
  all: logical; Œall = L‚ is shorthand for Œall.x = L‚ and Œall.y =
   L‚.
 
 
  The L should be a T or a TRUE.


 I think it's on purpose: L indicates a logical value, TRUE _or_ FALSE.


Makes sense - In this case, I would suggest to add, where L is either TRUE
or FALSE or similar to clarify.



 -pd
 --
 Peter Dalgaard, Professor
 Center for Statistics, Copenhagen Business School
 Solbjerg Plads 3, 2000 Frederiksberg, Denmark
 Phone: (+45)38153501
 Email: pd@cbs.dk  Priv: pda...@gmail.com




-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

[[alternative HTML version deleted]]

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


Re: [Rd] RFC: 'igraph' package update and backward compatibility

2011-10-20 Thread Rainer M Krug
On Wed, Oct 19, 2011 at 8:05 PM, Gábor Csárdi csa...@rmki.kfki.hu wrote:

 Dear R developers,

 I am seeking advice on some $subject matter.

 My package will have an update soon, that is not backward compatible
 with the current version. It will likely break much of the existing
 code. Many (~50) packages depend on 'igraph' and they, too,  will most
 probably break with the new version.


Don't forget the indirect dependencies - might be many more.

One approach used by e.g. ggplot and roxygen, is to call the new package
ggplot2 or roxygen2. This would not break old packages.


 My intended solution is, that I create a snapshot of the current
 package, under another name (igraph0), and ask package maintainers to
 depend on that version. Then, after a short time, I'll update the
 current igraph version.


I would rather give the new one a a new name by appending the 2


 Do you see any drawbacks of this solution? Is there some existing
 practice for situations like this? Suggestions are greatly
 appreciated.


Well - they require immediate action by the package maintainers. Yo could
put a warning in the original iplot package, that the package is not updated
any more and that a switch to iplot 2 is suggested. So no immediate action
by the package maintainers is required.

Cheers,

Rainer


 Btw. an alternative would be to ask them to depend on the exact
 current version of the package. This is an easier solution, but it
 won't give people the opportunity to load both versions of the package
 at the same time, if they want to run their old code.

 Thank You, Best Regards,
 Gabor

 --
 Gabor Csardi csardi.ga...@gmail.com Dept. Statistics, Harvard University

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




-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

[[alternative HTML version deleted]]

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


Re: [Rd] RFC: 'igraph' package update and backward compatibility

2011-10-20 Thread Rainer M Krug
Sorry - not iplot, but igraph.

On Thu, Oct 20, 2011 at 9:21 AM, Rainer M Krug r.m.k...@gmail.com wrote:



 On Wed, Oct 19, 2011 at 8:05 PM, Gábor Csárdi csa...@rmki.kfki.hu wrote:

 Dear R developers,

 I am seeking advice on some $subject matter.

 My package will have an update soon, that is not backward compatible
 with the current version. It will likely break much of the existing
 code. Many (~50) packages depend on 'igraph' and they, too,  will most
 probably break with the new version.


 Don't forget the indirect dependencies - might be many more.

 One approach used by e.g. ggplot and roxygen, is to call the new package
 ggplot2 or roxygen2. This would not break old packages.


 My intended solution is, that I create a snapshot of the current
 package, under another name (igraph0), and ask package maintainers to
 depend on that version. Then, after a short time, I'll update the
 current igraph version.


 I would rather give the new one a a new name by appending the 2


 Do you see any drawbacks of this solution? Is there some existing
 practice for situations like this? Suggestions are greatly
 appreciated.


 Well - they require immediate action by the package maintainers. Yo could
 put a warning in the original iplot package, that the package is not updated
 any more and that a switch to iplot 2 is suggested. So no immediate action
 by the package maintainers is required.

 Cheers,

 Rainer


 Btw. an alternative would be to ask them to depend on the exact
 current version of the package. This is an easier solution, but it
 won't give people the opportunity to load both versions of the package
 at the same time, if they want to run their old code.

 Thank You, Best Regards,
 Gabor

 --
 Gabor Csardi csardi.ga...@gmail.com Dept. Statistics, Harvard
 University

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




 --
 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
 UCT), Dipl. Phys. (Germany)

 Centre of Excellence for Invasion Biology
 Stellenbosch University
 South Africa

 Tel :   +33 - (0)9 53 10 27 44
 Cell:   +33 - (0)6 85 62 59 98
 Fax (F):   +33 - (0)9 58 10 27 44

 Fax (D):+49 - (0)3 21 21 25 22 44

 email:  rai...@krugs.de

 Skype:  RMkrug




-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

[[alternative HTML version deleted]]

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


Re: [Rd] Finding inter-function dependencies within a package

2011-09-29 Thread Rainer M Krug
On Thu, Sep 29, 2011 at 1:11 PM, Keith Jewell k.jew...@campden.co.ukwrote:

 Hi,

 I'd like to know which functions in a package call one specific function.
 I think I've seen a tool for identifying such dependencies, but now I can't
 find it :-(


Roxygen had the functionality to draw dependency graphs - but I think it has
been excluded in Roxygen2?

Rainer



 Searches of help and R site search for keywords like function, call, tree,
 depend haven't helped :-(

 Can anyone point me in the right direction?

 Thanks in advance,

 Keith Jewell

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




-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

[[alternative HTML version deleted]]

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


[Rd] Usage of options() for user defined options

2011-08-05 Thread Rainer M Krug
Hi

I want to use options() to store session wide options - is that a reasonable
approach, or should options() be reserved for core options?

Thanks

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax (F):   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

[[alternative HTML version deleted]]

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


Re: [Rd] Rf_errorcall - translate to Pascal

2006-02-16 Thread Rainer M Krug
Hans-Peter wrote:
 Hello!
 
 I (try to) convert the external R header files to Pascal (Delphi). At
 one place I stumbled over a macro that uses a method that is not
.
.
.
Sounds interesting - Could you keep me updated about your progress? I 
would be interested in the header files to use them in the analysis of 
simulations from Delphi.

Rainer


-- 
--
Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT)

Department of Conservation Ecology
University of Stellenbosch
Matieland 7602
South Africa

email:[EMAIL PROTECTED]

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


[Rd] How to uninstall R when installed with make install

2005-10-25 Thread Rainer M. Krug
Hi

How can I uninstall R when I installed it with make install?

Thanks,

Rainer


-- 
NEW TELEPHONE NUMBER
Tel:+27 - (0)72 808 2975 (w)

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Department of Conservation Ecology
University of Stellenbosch
Matieland 7602
South Africa

Tel:+27 - (0)72 808 2975 (w)
Fax:+27 - (0)21 808 3304
Cell:   +27 - (0)83 9479 042

email:  [EMAIL PROTECTED]
[EMAIL PROTECTED]

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


Re: [Rd] Socks under R

2005-10-20 Thread Rainer M. Krug
That's brilliant!

Thanks a lot for your help,

Rainer

Simon Urbanek wrote:
 Rainer,
 
 On Oct 19, 2005, at 3:29 PM, Rainer M. Krug wrote:
 
 when I use

 con1 - socketConnection(...)

 in R and want to send text from another application written in  Delphi 
 to  R, do I just have to send the text or do I have to  implement more 
 control characters and so on?
 
 Sockets are just reliable bi-directional communication channels (in  the 
 default mode), so their use is entirely up to you (both on R side  and 
 other application's side).
 
 Is

 con1 - socketConnection(port=6011, server=TRUE)
 writeLines(plot(rnorm(100)), con1)

 just sending the text in plot(rnorm(100)) to the socket or is it  
 doing more (R specific protocoll for socks comminication)?
 
 It basically equivalent to using send on the socket API level [i.e.  
 the above effectively does send(s, plot(rnorm(100))\n, 17, 0)], so  
 it's up to the other side to receive it properly. There is no R  
 specific protocol - socket connections in R use regular TCP (neither  
 red nor white socks ;)), so the literature on socket programming is  
 your friend (e.g. using readLines(con1) for incoming traffic in your  
 example would be a bad idea).
 
 Cheers,
 Simon
 



-- 
NEW TELEPHONE NUMBER
Tel:+27 - (0)72 808 2975 (w)

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Department of Conservation Ecology
University of Stellenbosch
Matieland 7602
South Africa

Tel:+27 - (0)72 808 2975 (w)
Fax:+27 - (0)21 808 3304
Cell:   +27 - (0)83 9479 042

email:  [EMAIL PROTECTED]
[EMAIL PROTECTED]

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


[Rd] Control R from another program (written in Delphi)

2005-10-17 Thread Rainer M. Krug
Hi

I want to analysis data (generatet in a simulation written in Delphi) in 
R and the user interface will also written in Delpni -0 i.e. I want to 
control R from another program which is written in Delphi.
At the moment I am using the (D)COM interface but as I would like to run 
R on a Linux Cluster, thits is not an option any more.
What is the easiest way of copntrolluing R over the network? I thought 
about sockets, but I am a little bit stuck.

Any tips welcome,

Rainer


-- 
NEW TELEPHONE NUMBER
Tel:+27 - (0)72 808 2975 (w)

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Department of Conservation Ecology
University of Stellenbosch
Matieland 7602
South Africa

Tel:+27 - (0)72 808 2975 (w)
Fax:+27 - (0)21 808 3304
Cell:   +27 - (0)83 9479 042

email:  [EMAIL PROTECTED]
[EMAIL PROTECTED]

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


Re: [Rd] Compilation of R-2.2.0 under SUSE 10

2005-10-14 Thread Rainer M Krug
Could you give me a hint what I should look for? I am quite new to Linux.

Rainer


On Friday 14 October 2005 14:19, Peter Dalgaard wrote:
 Rainer M Krug [EMAIL PROTECTED] writes:
  Hi
 
  I hope this is the right list for the question.
  I want to install R from source under SUSE 10. When executing
  ./Configure, I get the following error message:
 
  checking for xmkmf... /usr/X11R6/bin/xmkmf
  configure: WARNING: I could not determine FPICFLAGS.
  configure: error: See the file INSTALL for more information.
 
  and it taborts. Consequently, make does not work.
 
  Any ideas?

 You probably want to look into config.log and see what caused the
 FPICFLAGS message. It could be an oblique way of telling you that you
 haven't installed a Fortran compiler.

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


Re: [Rd] Compilation of R-2.2.0 under SUSE 10

2005-10-14 Thread Rainer M Krug
Hi

I solved the problem.

I hd a fortran compuiler installed and it is found:

configure:5331: g77 --version /dev/null 5
GNU Fortran (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
Copyright (C) 2002 Free Software Foundation, Inc.

butr it was not working. I installed another fortran compiler (gccfortran) and 
it worked.

Thanks a lot for your help Peter

Rainer


On Friday 14 October 2005 15:30, Peter Dalgaard wrote:
 Rainer M Krug [EMAIL PROTECTED] writes:
  Could you give me a hint what I should look for? I am quite new to Linux.
 
  Rainer

 As long as you can see where it goes wrong, just ask again, citing the
 relevant bit of the log. Finding this is a bit convoluted for the
 FPICFLAGS issue because the failing test is just for whether the
 variable was set earlier, which AFAICS should happen here:


 ## Step 2.  GNU compilers.
 if test ${GCC} = yes; then
   cpicflags=-fPIC
   shlib_ldflags=-shared
 fi
 if test ${G77} = yes; then
   fpicflags=-fPIC
 fi
 if test ${GXX} = yes; then
   cxxpicflags=-fPIC
   shlib_cxxldflags=-shared
 fi

 Now, the natural guess is that ${G77} wasn't set earlier on, so look
 for the place where it figures out the Fortran compiler.

  On Friday 14 October 2005 14:19, Peter Dalgaard wrote:
   Rainer M Krug [EMAIL PROTECTED] writes:
Hi
   
I hope this is the right list for the question.
I want to install R from source under SUSE 10. When executing
./Configure, I get the following error message:
   
checking for xmkmf... /usr/X11R6/bin/xmkmf
configure: WARNING: I could not determine FPICFLAGS.
configure: error: See the file INSTALL for more information.
   
and it taborts. Consequently, make does not work.
   
Any ideas?
  
   You probably want to look into config.log and see what caused the
   FPICFLAGS message. It could be an oblique way of telling you that you
   haven't installed a Fortran compiler.
 
  __
  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


  1   2   >