[R-pkg-devel] import with except(ion)

2020-10-30 Thread Göran Broström
My CRAN package eha depends on the survival package, and that creates 
problems with innocent users: It is about the 'frailty' function 
(mainly). While (after 'library(eha)')


f1 <- coxph(Surv(time, status) ~ age + frailty(inst), data = lung)

produces what you would expect (a frailty survival analysis), the use of 
the coxreg function from eha


f2 <- coxreg(Surv(time, status) ~ age + frailty(inst), data = lung)

produces (almost) nonsense. That's because the survival::frailty 
function essentially returns its input and coxreg is happy with that, 
treats it as an ordinary numeric (or factor) covariate, and nonsense is 
produced, but some users think otherwise. (Maybe it would be better to 
introduce frailty in a separate argument?)


I want to prevent this to happen, but I do not understand how to do it 
in the best way. I tried to move survival from Depends: to Imports: and 
adding import(survival, except = c(frailty, cluster)) to NAMESPACE. This 
had the side effect that a user must qualify the Surv function by 
survival::Surv, not satisfactory (similarly for other popular functions 
in survival).


Another option I thought of was to define my own Surv function as
Surv <- survival::Surv in my package, but it doesn't feel right.
It seems to work, though.

As you may understand from this, I am not very familiar with these 
issues. I have used Depends: survival for a long time and been happy 
with that.


Any help on this is highly appreciated.

Göran

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


Re: [R-pkg-devel] checking PDF version of manual without hyperrefs or index ... ERROR

2020-10-30 Thread Lluís Revilla
Hi Anthony,

I stumbled with the same issue for a package I submitted recently, the
problem seems to be that LaTex doesn't know how to map this unicode
character to a typesetting.

My unicode character was \u2229 and I tried several ways to avoid this warning.
On the vignette built with knitr I declared the unicode character the
following way:
%\DeclareUnicodeCharacter{2229}{$\cap$}
On the man pages I had to use a bit of code to print the right symbol:
\ifelse{latex}{\out{$\cup$}}{\ifelse{html}{\out{}}{}}.}

This way it passes the CRAN checks on all the machines and I didn't
get any comment from the reviewer.
In your case a similar changing the symbol might work, if there isn't
any symbol you'll probably need to map the ligature in latex:
tex.stackexchange.com/a/230140/178206.
Not sure how to include that map with the package tho.

Hope this helps,

Lluís

On Thu, 29 Oct 2020 at 15:35, Anthony Hammond  wrote:
>
> Hello,
> I'm attempting to upload a package to CRAN and although it passes the R CMD
> checks that I run, it doesn't pass the CRAN check and the response I get is
> pasted below. I've looked online and found numerous solutions; some made no
> sense to me & others didn't work.
> I tried downloading and putting upquote.sty and inconsolata.sty files into
> the latex folder. I also tried typing --no-manual in the project options
> under R CMD check options.
> Still the CRAN submission email response provided the below error.
> What can I do to make this go away and have my package accepted?
> It probably doesn't help that I know next to nothing about LaTeX.
> Incidentally I don't mind not having a pdf manual, so if there is a simple
> way to avoid the check by requesting not to have one, that'll do.
> Any assistance would be greatly appreciated.
>
> Kind Regards
> Anthony
>
> * checking PDF version of manual ... WARNING
> LaTeX errors when creating PDF version.
> This typically indicates Rd problems.
> LaTeX errors found:
> ! Package inputenc Error: Unicode char fl (U+FB02)
> (inputenc)not set up for use with LaTeX.
>
> See the inputenc package documentation for explanation.
> Type  H   for immediate help.
> * checking PDF version of manual without hyperrefs or index ... ERROR
> * checking for detritus in the temp directory ... OK
> * DONE
> Status: 1 ERROR, 1 WARNING, 3 NOTEs
>
> [[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