Re: [R-pkg-devel] Macros in Rd files --- supplementary question.

2017-11-10 Thread Rolf Turner

On 10/11/17 09:29, Rolf Turner wrote:


On 09/11/17 23:40, Duncan Murdoch wrote:

On 09/11/2017 5:06 AM, Uwe Ligges wrote:

Note the % may be a comment?



Yes, and the body should be written in Rd markup, not R.  Working out 
the appropriate number of escapes is painful; I recommend trial and 
error.


This worked for me:

  \newcommand{\today}{\Sexpr{format(Sys.Date(),"\\\%d/\\\%m/\\\%Y")}}


Did that, and it worked like a charm.  However when I do the "R CMD 
build" thing, when it comes to the "* building the PDF package manual"
step it says "Hmm ... looks like a package" (no shit, Sherlock!) and 
emits a huge amount of verbose LaTeX diagnostics.


"Normally" one just gets the line "* building the PDF package manual"
and nothing else, and "R CMD build" just carries on cruising.

Evidently defining a macro in the *.Rd file triggers the extra elaboration.

It's no big deal of course, but I just thought I'd ask:

(a) Is there anything to worry about in this respect?

(b) Is there anything different that I should be doing?

(c) Is there anyway of suppressing the (ever-so-slightly annoying)
extra screen output?

I guess that's really three supplementary questions 


Following up a suggestion that I got from Adrian Baddeley I did

   R CMD build --help

(I guess this is a case of RTFM) and I got:



Usage: R CMD build [options] pkgdirs

Build R packages from package sources in the directories specified by
‘pkgdirs’

Options:
  -h, --helpprint short help message and exit
  -v, --versionprint version info and exit

  --force   force removal of INDEX file
  --keep-empty-dirs do not remove empty dirs
  --no-build-vignettes  do not (re)build package vignettes
  --no-manual   do not build the PDF manual even if \Sexprs are present
...
...
... 



So:  What's triggering the building of the manual is the presence of 
\Sexpr in my macro, and I can suppress this and get rid of all the 
unwanted LaTeX bumff by using the --no-manual flag.


I must say that I don't see why the presence of a \Sexpr (WTF ever that 
is) should trigger the building of the manual.


May I humbly suggest to R Core that this behaviour be modified; perhaps 
there could be a --manual flag asking that the manual be built (whether 
or not there are \Sexpr expressions in the *.Rd files).


cheers,

Rolf

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

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

Re: [R-pkg-devel] R package with Java issue, out of mem heap error

2017-11-10 Thread MTurgeon

Hello,

This sounds like a problem you should discuss with/report to the 
maintainer of the particular package you are using, and you can get 
their email address from the DESCRIPTION file.


Cheers,

Max


On 2017-11-10 07:23 AM, Cho, In-Ho [CCE E] wrote:

Dear R developers:

My group are facing a problem while using an R package of extream random trees.

Using a slightly large data set (13000 rows×27 columns), the R package, specifically at 
the prediction task, aborts with error message like "Java outofmem .. heap...". 
I tested this on both Macpro and Window os.

Any advice as to this issue will be really appreciated.

Warm regards,

In Ho

___
In Ho Cho, Ph.D.
Assistant Professor
Dept. Civil, Construction and Environmental Engineering
Iowa State University
326 Town Engineering
Ames, Iowa 50011-3232, USA
office: 1-515-294-3241

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


--
-

Maxime Turgeon, PhD candidate

Department of Epidemiology, Biostatistics and Occupational Health
McGill University

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

[R-pkg-devel] R package with Java issue, out of mem heap error

2017-11-10 Thread Cho, In-Ho [CCE E]
Dear R developers:

My group are facing a problem while using an R package of extream random trees. 

Using a slightly large data set (13000 rows×27 columns), the R package, 
specifically at the prediction task, aborts with error message like "Java 
outofmem .. heap...". I tested this on both Macpro and Window os. 

Any advice as to this issue will be really appreciated. 

Warm regards,

In Ho

___
In Ho Cho, Ph.D.
Assistant Professor
Dept. Civil, Construction and Environmental Engineering
Iowa State University
326 Town Engineering
Ames, Iowa 50011-3232, USA
office: 1-515-294-3241

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


Re: [R-pkg-devel] issues with SOfun - package upload

2017-11-10 Thread LUCA BELMONTE
Hi Dason,

I wrote it from scratch.

Thank you for the suggestion though,

Luca

2017-11-09 17:17 GMT+01:00 Dason Kurkiewicz :

> Did you write it from scratch or modify the function from the package
> you were referencing?  There may be some licensing issues you need to
> consider either way.
>
> -Dason
>
> On Thu, Nov 9, 2017 at 3:53 AM, LUCA BELMONTE 
> wrote:
> > Dear Brian,
> > Dear Uwe,
> >
> > Thank you for your replies.
> >
> > I wrote a function that does the same stuff that the suggested package
> > does.
> > Now there are no reference to suggested packages.
> >
> > Best,
> > Luca
> >
> > 2017-11-08 18:03 GMT+01:00 Uwe Ligges :
> >
> >> And even this cannot work for strong dependencies, as sztrong
> deendencies
> >> must be available from mainstream repositoreis.
> >>
> >> Best,
> >> Uwe Ligges
> >>
> >>
> >>
> >>
> >>
> >> On 08.11.2017 17:59, Brian G. Peterson wrote:
> >>
> >>> I think you should be using:
> >>>
> >>> Additional_repositories: https://github.com/mrdwab/SOfun
> >>>
> >>> since that is the actual repository.
> >>>
> >>> Regards,
> >>>
> >>> Brian
> >>>
> >>> On Wed, 2017-11-08 at 17:01 +0100, LUCA BELMONTE wrote:
> >>>
>  Good evening,
> 
>  I am trying to upload my package, called PdPDB 2.0.
>  When building and checking the package with R-studio with --as-cran
>  option
>  selected, everything looks ok but, once I tried to upload the package
>  to
>  CRAN I had the following reply:
> 
>  *"Strong dependencies not in mainstream repositories:*
>  *  SOfun*
>  ** checking package namespace information ... OK*
>  ** checking package dependencies ... ERROR*
>  *Package required but not available: 'SOfun'"*
> 
>  I understand the issue it with SOfun that is a package I downloaded
>  and
>  installed from this github url: https://github.com/mrdwab/SOfun
> 
>  I came back to CARN policies and I have read:
> 
> 
>  *"Packages on which a CRAN package depends should be available from a
>  mainstream repository: if any mentioned in ‘Suggests’ or ‘Enhances’
>  fields
>  are not from such a repository, where to obtain them at a repository
>  should
>  be specified in an ‘Additional_repositories’ field of the DESCRIPTION
>  file
>  (as a comma-separated list of repository URLs) or for other means of
>  access, described in the ‘Description’ field."*
> 
>  So, I updated the DESCRIPTION file as follows:
>  Additional_repositories: http://news.mrdwab.com/install_github.R
> 
>  Before to proceed to submission, I would like to know if this is the
>  right
>  way to proceed or I misinterpreted the submission procedure.
> 
>  Thank you for reading this email,
>  Best,
> 
> 
> >>> __
> >>> R-package-devel@r-project.org mailing list
> >>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >>>
> >>>
> >
> >
> > --
> > Luca Belmonte, PhD
> >
> > Dept. Life Sciences,
> > University of Modena and Reggio Emilia
> >
> > Mobile: +39 328 45 81 762
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
>



-- 
Luca Belmonte, PhD

Dept. Life Sciences,
University of Modena and Reggio Emilia

Mobile: +39 328 45 81 762

[[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] Using another package's method that isn't exported

2017-11-10 Thread Georgi Boshnakov
Hi,

Presumably, you have imported 'confint' from 'stats'.
Just import something from MASS, e.g 'ginv':

importFrom(MASS,ginv)

or choose something else by studying the output of  ls(asNamespace("MASS")).

Similarly  import something from xml2.

Note that "IMPORTS" in DESCRIPTION ensures that the packages listed there are 
loaded.
Imports in NAMESPACE specify the functions and other objects that  the 
functions in your package
will 'see' without '::' qualifiers. For generics, your package needs only to 
'see' the generics, so it is sufficient to import the relevant generics 
('confint' in your case).  You don't need to import methods, unless you 
explicitly call them. It doesn't matter if the functions implementing them are 
exported or not. (Actually, there are further nuances in the terminology here - 
an S3 method is 'registered' if the generic knows about it. The function 
implementing it may or may not have been exported).

The message you got is a quality control message potentially letting you know 
that you don't need a package you have declared. 

Thanks,
Georgi

-Original Message-
From: R-package-devel [mailto:r-package-devel-boun...@r-project.org] On Behalf 
Of Stuart Lacy
Sent: 10 November 2017 09:42
To: r-package-devel@r-project.org
Subject: [R-pkg-devel] Using another package's method that isn't exported

Hi,

Yesterday I released the initial submission of my package 'epitab' to CRAN 
https://cran.r-project.org/web/packages/epitab/index.html. On my PC and on 
win_builder it passed CMD CHECK without any notes, warnings, or submissions. 
However,  the built version has a note on some architectures, that I have some 
namespaces in Imports in my DESCRIPTION that are not actually imported from. 
https://cran.r-project.org/web/checks/check_results_epitab.html

This is because my code uses the confint.glm method from MASS, so I add MASS to 
my Imports. However, the actual confint.glm method is not an exported function 
from MASS, and so in the code I never actually run MASS::confint.glm(mod), I 
just run the generic stats::confint(mod) on a glm object. I understand that to 
fix this note I need to explicitly use the imported MASS package, but I can't 
see how if I can't manually call the function that I'm using.

The other package that I've Imported without explicitly using is `xml2`, as 
win-builder threw up an error with "undefined exports" for various xml 
functions, that adding xml2 to the Imports fixed. 
https://win-builder.r-project.org/G6RKiYtBQqaH/00check.log I didn't have any 
issue with xml2 on Linux.

Thanks,
Stuart

--
Stuart Lacy
Research Fellow
Epidemiology and Cancer Statistics Group University of York
01904 321118
Disclaimer: http://www.york.ac.uk/docs/disclaimer/email.htm

__
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-pkg-devel] Using another package's method that isn't exported

2017-11-10 Thread Stuart Lacy

Hi,

Yesterday I released the initial submission of my package 'epitab' to 
CRAN https://cran.r-project.org/web/packages/epitab/index.html. On my PC 
and on win_builder it passed CMD CHECK without any notes, warnings, or 
submissions. However,  the built version has a note on some 
architectures, that I have some namespaces in Imports in my DESCRIPTION 
that are not actually imported from. 
https://cran.r-project.org/web/checks/check_results_epitab.html


This is because my code uses the confint.glm method from MASS, so I add 
MASS to my Imports. However, the actual confint.glm method is not an 
exported function from MASS, and so in the code I never actually run 
MASS::confint.glm(mod), I just run the generic stats::confint(mod) on a 
glm object. I understand that to fix this note I need to explicitly use 
the imported MASS package, but I can't see how if I can't manually call 
the function that I'm using.


The other package that I've Imported without explicitly using is `xml2`, 
as win-builder threw up an error with "undefined exports" for various 
xml functions, that adding xml2 to the Imports fixed. 
https://win-builder.r-project.org/G6RKiYtBQqaH/00check.log I didn't have 
any issue with xml2 on Linux.


Thanks,
Stuart

--
Stuart Lacy
Research Fellow
Epidemiology and Cancer Statistics Group
University of York
01904 321118
Disclaimer: http://www.york.ac.uk/docs/disclaimer/email.htm

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

Re: [R-pkg-devel] Macros in Rd files.

2017-11-10 Thread Georgi Boshnakov
>http://developer.r-project.org/parseRd.pdf

I would add that it is best to think of "Rd markup" as a subset of TeX/LaTeX 
markup (with some extentions) defined in 
"Writing R Extensions" and Duncan's reference above. 

The "subset" is important - if a feature is not mentioned in these references, 
it is not available.
 I once inadvertently used a modifier in the tabular environment (maybe 
something like {l|l|l} which was fine for 'R CMD check', the pdf manual and 
CRAN but the package failed to install on a system setup for static 
installation of html documentation.

Georgi Boshnakov

-Original Message-
From: R-package-devel [mailto:r-package-devel-boun...@r-project.org] On Behalf 
Of Duncan Murdoch
Sent: 09 November 2017 23:08
To: Rolf Turner
Cc: r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] Macros in Rd files.

On 09/11/2017 3:05 PM, Rolf Turner wrote:
> On 09/11/17 23:40, Duncan Murdoch wrote:
>> On 09/11/2017 5:06 AM, Uwe Ligges wrote:
>>> Note the % may be a comment?
>>>
>>
>> Yes, and the body should be written in Rd markup, not R.  Working out 
>> the appropriate number of escapes is painful; I recommend trial and error.
>>
>> This worked for me:
>>
>>    
>> \newcommand{\today}{\Sexpr{format(Sys.Date(),"\\\%d/\\\%m/\\\%Y")}}
> 
> Now that is a bit more subtle!  I don't understand what "written in Rd 
> markup" really means, and I don't understand the "\Sexpr" construction.
> I'd seen it when looking at the example macros in
> 
>  /usr/local/lib64/R/share/Rd/macros/system.Rd
> 
> but I figured if you know nothing about it, don't mess with it.
> 
> Is there anywhere that I could read up about writing "in Rd markup"?

Not sure this would be helpful, but there's

http://developer.r-project.org/parseRd.pdf

The short summary is this:

Rd files are a mess.  There are several different modes of parsing that
apply:  at the top level you have Rd code, and in different contexts you may 
have R code (or something close to it), or verbatim code (just kidding!  There 
are ways to signal you want out).  Table 1 in that document says what syntax is 
expected within what macro.  In \newcommand, it says it wants "verbatim" input, 
but really it's going to interpret that as Rd input, i.e. LaTeX-like.

Regret asking yet?

Duncan Murdoch

> 
> Anyway, thanks for giving me the recipe, which is what I really need.
> 
> cheers,
> 
> Rolf
>

__
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

Re: [R-pkg-devel] Macros in Rd files --- supplementary question ...

2017-11-10 Thread Ege Rubak

Hi Rolf,
Another place to look for macros in Rd files would be in the spatstat 
package which I know you are quite familiary with ;-)
However, I think our macros are plain LaTeX without calls to \Sexpr so 
it may behave differently than the case at hand.

Cheers,
Ege

On 11/10/2017 02:00 AM, Rolf Turner wrote:

On 10/11/17 13:10, François Michonneau wrote:
A github search might be helpful to identify packages that define 
macros in their Rd files:
https://github.com/search?utf8=%E2%9C%93=user%3Acran+extension%3Ard+newcommand=Code 



Thanks.  Looking into it.

cheers,

Rolf



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