[R-pkg-devel] Functions requiring packages listed on Suggests

2025-05-08 Thread Juan Antonio Garcia Martin
Dear mantainers,

I have a question, since one of my packages currently does not pass the 
onSuggest special check.

Two functions of my package require some of the suggested packages 
either in CRAN (DiagrammeR, DiagrammeRsvg and rsvg) or Bioconductor ( 
rtracklayer and GenomicRanges), also listed in the suggest section.

The functions detect whether the suggested packages are installed and 
available, and return an error message indicating that the packages 
required to use the function.

In fact DiagrammeR uses the same approach, the function export_graph 
requires both DiagrammeRsvg and rsvg, but they are not listed in the 
imports, it just returns a message when they are not installed.

I have the option of removing the examples, or printing the same 
messages but returning from the functions instead of using stop. What is 
the preferred behavior in these cases?

Best regards,
Juan Antonio











[[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] Functions requiring packages listed on Suggests

2025-05-08 Thread Michael Chirico
Just don't run those examples on machines lacking the Suggests packages.

With roxygen2 it's as easy as @examplesIf requireNamespace(p, quietly=TRUE).

On Thu, May 8, 2025, 8:19 AM Juan Antonio Garcia Martin <
ja.gar...@cnb.csic.es> wrote:

> Dear mantainers,
>
> I have a question, since one of my packages currently does not pass the
> onSuggest special check.
>
> Two functions of my package require some of the suggested packages
> either in CRAN (DiagrammeR, DiagrammeRsvg and rsvg) or Bioconductor (
> rtracklayer and GenomicRanges), also listed in the suggest section.
>
> The functions detect whether the suggested packages are installed and
> available, and return an error message indicating that the packages
> required to use the function.
>
> In fact DiagrammeR uses the same approach, the function export_graph
> requires both DiagrammeRsvg and rsvg, but they are not listed in the
> imports, it just returns a message when they are not installed.
>
> I have the option of removing the examples, or printing the same
> messages but returning from the functions instead of using stop. What is
> the preferred behavior in these cases?
>
> Best regards,
> Juan Antonio
>
>
>
>
>
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[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] Functions requiring packages listed on Suggests

2025-05-08 Thread Uwe Ligges

Simply only run  the function conditionally in test, examples, vignettes:

if(requireNamespace(packageName)){

example / vignette / test code

}




On 08.05.2025 15:37, Juan Antonio Garcia Martin wrote:

Dear mantainers,

I have a question, since one of my packages currently does not pass the
onSuggest special check.

Two functions of my package require some of the suggested packages
either in CRAN (DiagrammeR, DiagrammeRsvg and rsvg) or Bioconductor (
rtracklayer and GenomicRanges), also listed in the suggest section.

The functions detect whether the suggested packages are installed and
available, and return an error message indicating that the packages
required to use the function.

In fact DiagrammeR uses the same approach, the function export_graph
requires both DiagrammeRsvg and rsvg, but they are not listed in the
imports, it just returns a message when they are not installed.

I have the option of removing the examples, or printing the same
messages but returning from the functions instead of using stop. What is
the preferred behavior in these cases?

Best regards,
Juan Antonio











[[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


Re: [R-pkg-devel] Run Examples Not Found

2025-05-08 Thread Ivan Krylov via R-package-devel
В Wed, 7 May 2025 20:10:50 + (UTC)
Mat Fok via R-package-devel  пишет:

> I want to be able to click "Run Examples" in my Help documentation
> but I get the error /Example/olr not found. 

> I have searched online for this but the most relevant thing I have
> found was
> stackoverflow.com/questions/76365640/r-roxygen-examples-example-foo-bar-not-found,
> but no one answered and it is over a year old.

Are you using load_all()? According to the documentation (see
?pkgload::load_all), example() is not one of the functions emulated by
load_all(). Without emulation, it needs an installed package with a
table of help pages and their aliases.

Does it also not work if you use R CMD build and R CMD INSTALL?

-- 
Best regards,
Ivan

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


[R-pkg-devel] Secondary Issues getting a package on cran

2025-05-08 Thread Tracy Morrison Sweet
Hi all,

I’m not sure how to fix the following issues with a package. When I run checks 
on my own computer, I only see a note that the package was previously removed 
from cran. 

So both of the checks have the same note: 
New submission 
Package was archived on CRAN

I’m not sure how to do anything to remove this note. I’m also not sure if this 
note is causing issues, but it seems like it is.

Then, they ran additional checks and a gave me link with a file directory 
clang-san, in which there are 4 files: “outputs.txt”, “package”, “process.txt”, 
“summary.txt”.  

In outputs.txt, there were 24 warnings in the  These are functions in other 
packages I’m guessing, but I don’t call them in my package. 
In the package link, I can see the install log and there are no errors.
In process.txt and summary.txt, it says 
"File: HLSM-Ex.Rout
vendor/cigraph/src/constructors/adjacency.c:87:34: runtime error: nan is 
outside the range of representable values of type ‘long’"

I’m not sure how to fix any of these. When I check it on my computer, the file 
HLSM-Ex.Rout doesn’t have this information. 

The email from cran is copied below. 

Thanks for any suggestions,
Tracy



Dear maintainer,

package HLSM_0.9.1.tar.gz does not pass the incoming checks automatically, 
please see the following pre-tests (additional issue checks):
Windows: 

Status: 1 NOTE
Debian: 

Status: 1 NOTE

Additional issues checked: 

clang-san: Status: WARNING

Last released version's CRAN status: OK: 12
See: 


Last released version's additional issues:
clang-UBSAN 

Please fix all problems and resubmit a fixed version via the webform.
If you are not sure how to fix the problems shown, please ask for help on the 
R-package-devel mailing list:

If you are fairly certain the rejection is a false positive, please reply-all 
to this message and explain.

More details are given in the directory:

The files will be removed after roughly 7 days.

No strong reverse dependencies to be checked.

Best regards,
CRAN teams' auto-check service
Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64
Check: CRAN incoming feasibility, Result: NOTE
Maintainer: 'Tracy Sweet mailto:tsw...@umd.edu> 
>'

New submission

Package was archived on CRAN

CRAN repository db overrides:
  X-CRAN-Comment: Archived on 2024-01-19 as issues were not corrected
in time.

Flavor: r-devel-linux-x86_64-debian-special-clang-san
Check: *, Result: NA


Flavor: r-devel-linux-x86_64-debian-special-clang-san
Check: Post-processing issues found for clang-san, Result: WARNING
File: HLSM-Ex.Rout
vendor/cigraph/src/constructors/adjacency.c:87:34: runtime error: nan is 
outside the range of representable values of type 'long'






[[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] Functions requiring packages listed on Suggests

2025-05-08 Thread Juan Antonio García Martín
Thank you for answering so soon, Michael and Uwe.

I think I will follow Uwe's approach, it is simple and will work on all cases. 

Best regards, 
Juan Antonio 



On May 8, 2025 6:24:34 PM GMT+02:00, Uwe Ligges 
 wrote:
>Simply only run  the function conditionally in test, examples, vignettes:
>
>if(requireNamespace(packageName)){
>
>example / vignette / test code
>
>}
>
>
>
>
>On 08.05.2025 15:37, Juan Antonio Garcia Martin wrote:
>> Dear mantainers,
>> 
>> I have a question, since one of my packages currently does not pass the
>> onSuggest special check.
>> 
>> Two functions of my package require some of the suggested packages
>> either in CRAN (DiagrammeR, DiagrammeRsvg and rsvg) or Bioconductor (
>> rtracklayer and GenomicRanges), also listed in the suggest section.
>> 
>> The functions detect whether the suggested packages are installed and
>> available, and return an error message indicating that the packages
>> required to use the function.
>> 
>> In fact DiagrammeR uses the same approach, the function export_graph
>> requires both DiagrammeRsvg and rsvg, but they are not listed in the
>> imports, it just returns a message when they are not installed.
>> 
>> I have the option of removing the examples, or printing the same
>> messages but returning from the functions instead of using stop. What is
>> the preferred behavior in these cases?
>> 
>> Best regards,
>> Juan Antonio
>> 
>> 
>> 
>>  
>> 
>>  
>> 
>>  
>> 
>>  
>> 
>>  [[alternative HTML version deleted]]
>> 
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[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] Secondary Issues getting a package on cran

2025-05-08 Thread Ivan Krylov via R-package-devel
В Thu, 8 May 2025 12:01:47 -0400
Tracy Morrison Sweet  пишет:

> New submission 
> Package was archived on CRAN
> 
> I’m not sure how to do anything to remove this note.

This note is to be expected.

> In process.txt and summary.txt, it says "File: HLSM-Ex.Rout
> vendor/cigraph/src/constructors/adjacency.c:87:34: runtime error: nan
> is outside the range of representable values of type ‘long’"

The link to the original issue that got your package archived is more
informative because it contains the backtrace and shows the place in
your examples where the problem happens:

https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-UBSAN/HLSM/HLSM-Ex.Rout

> > fixed.fit = HLSMfixedEF(Y = ps.advice.mat, senderCov=ps.node.df,
> + initialVals = initialVals,priors = priors,
> + tune = tune,tuneIn = FALSE,dd = 2,niter = niter)
> core/constructors/adjacency.c:47:26: runtime error: nan is outside
> the range of representable values of type 'long' #0 0x7f09504c6e4b in
> igraph_i_adjacency_directed
> /tmp/Rtmp9HF8V2/R.INSTALL659cd504fd46b/igraph/src/core/constructors/adjacency.c:47:26
> #1 0x7f09504c5715 in igraph_adjacency
> /tmp/Rtmp9HF8V2/R.INSTALL659cd504fd46b/igraph/src/core/constructors/adjacency.c:212:9
> #2 0x7f0950c654a3 in R_igraph_graph_adjacency
> /tmp/Rtmp9HF8V2/R.INSTALL659cd504fd46b/igraph/src/rinterface_extra.c:4861:3

The file path is now different, but the issue is most likely the same.
During a call to HLSMfixedEF(), a matrix containing a NaN value is
passed to the 'igraph' package, where the NaN is converted to an
integer:

https://github.com/igraph/rigraph/blob/9a2816248eb837077b5af28bad7b1b9c0713b128/src/vendor/cigraph/src/constructors/adjacency.c#L87

Unfortunately, converting a NaN into an integer is undefined behaviour
according to the C standard. The program is allowed to do literally
anything, so it caused your package to be archived.

Ideally, 'igraph' could produce an informative error message upon
detecting a NaN, but you can avoid the problem on your end by making
sure that all values in your adjacency matrices are finite before
calling igraph::graph.adjacency().

To see the problem for yourself, you'll need a "sanitized" build of R:
https://cran.r-project.org/doc/manuals/R-exts.html#Using-Undefined-Behaviour-Sanitizer

Sanitizers are somewhat finicky to use. The container images
docker.io/rocker/r-devel-ubsan-clang and
ghcr.io/r-hub/containers/clang-ubsan, or the R-hub service may help.

Good luck! If this wasn't detailed enough, don't hesitate to ask
follow-up questions.

-- 
Best regards,
Ivan

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


Re: [R-pkg-devel] CRAN Submission xgboost 1.7.11.1

2025-05-08 Thread jiaming yuan
Hi CRAN,

May I ask if someone has tried to reproduce the openblas test environment from 
CRAN? We are trying to resolve the test failures of XGBoost but so far no one 
has managed to reproduce them locally. 
https://github.com/dmlc/xgboost/issues/11431

Would be great if you can share some guidance on how to reproduce that exact 
environment.

Cheers
Jiaming

From: jiaming yuan 
Sent: Friday, May 9, 2025 12:04:45 PM
To: Uwe Ligges ; CRAN 

Cc: CRAN Package Submission Form 
Subject: Re: CRAN Submission xgboost 1.7.11.1

Hi,

Others kindly provided help to reproduce the failure but so far no one has 
managed to do so.

Please see  
https://github.com/dmlc/xgboost/issues/11431#issuecomment-2864947065  and 
related discussions the thread. Would be great if you can share something more 
precise.


Cheers
Jiaming


From: Uwe Ligges 
Sent: Wednesday, May 7, 2025 9:48:56 PM
To: jiaming yuan ; CRAN 
Cc: CRAN Package Submission Form 
Subject: Re: CRAN Submission xgboost 1.7.11.1

Note this is relevant, as most Linux clusters will have admis who will
link scientifiv software aagainst OpenBLAS for faster matriox operations.

Best,
Uwe Ligges

On 07.05.2025 15:48, Uwe Ligges wrote:
> I think any Liniux system with R linked against the system's default
> OpenBLAS installation will show this issue.
> I'd try it with a standard Ubuntu or Debian with OpenBLAS installed and
> link agasinst it.
>
> Best,
> Uwe Ligges
>
>
>
> On 03.05.2025 08:29, jiaming yuan wrote:
>> Thank you for reaching out. We can't really dive into it unless
>> there's an easier way to reproduce the environment (like a container
>> or using some deterministic package managers). It's very unlikely that
>> we can try to build that environment on our own then try to fix all
>> errors and verify all fixes.
>>
>>
>>
>> 
>> From: Uwe Ligges 
>> Sent: Friday, May 2, 2025 8:00:17 PM
>> To: Jiaming Yuan ; CRAN > project.org>
>> Cc: CRAN Package Submission Form 
>> Subject: Re: CRAN Submission xgboost 1.7.11.1
>>
>> Thanks, we see you removed lots of tests. Is this really sensible and
>> are you sure that users with OpenBLAS (as most Linux users and cluster
>> admins will use) will get correct results? Sensibly relaxing numerical
>> assumptions may be a better way to tweak the tests.?
>>
>> Best,
>> Uwe Ligges
>>
>>
>> On 01.05.2025 12:58, CRAN Package Submission Form via CRAN-submissions
>> wrote:
>>> [This was generated from CRAN.R-project.org/submit.html]
>>>
>>> The following package was uploaded to CRAN:
>>> ===
>>>
>>> Package Information:
>>> Package: xgboost
>>> Version: 1.7.11.1
>>> Title: Extreme Gradient Boosting
>>> Author(s): Tianqi Chen [aut], Tong He [aut], Michael Benesty [aut],
>>> Vadim
>>> Khotilovich [aut], Yuan Tang [aut]
>>> (), Hyunsu Cho [aut],
>>> Kailong Chen [aut], Rory Mitchell [aut], Ignacio Cano [aut],
>>> Tianyi Zhou [aut], Mu Li [aut], Junyuan Xie [aut], Min Lin
>>> [aut], Yifeng Geng [aut], Yutian Li [aut], Jiaming Yuan [aut,
>>> cre], XGBoost contributors [cph] (base XGBoost implementation)
>>> Maintainer: Jiaming Yuan 
>>> Depends: R (>= 3.3.0)
>>> Suggests: knitr, rmarkdown, ggplot2 (>= 1.0.1), DiagrammeR (>= 0.9.0),
>>> Ckmeans.1d.dp (>= 3.3.1), vcd (>= 1.3), cplm, e1071, caret,
>>> testthat, lintr, igraph (>= 1.0.1), float, crayon, titanic
>>> Description: Extreme Gradient Boosting, which is an efficient
>>> implementation of the gradient boosting framework from Chen &
>>> Guestrin (2016) . This package
>>> is its R interface. The package includes efficient linear
>>> model solver and tree learning algorithms. The package can
>>> automatically do parallel computation on a single machine
>>> which could be more than 10 times faster than existing
>>> gradient boosting packages. It supports various objective
>>> functions, including regression, classification and ranking.
>>> The package is made to be extensible, so that users are also
>>> allowed to define their own objectives easily.
>>> License: Apache License (== 2.0) | file LICENSE
>>> Imports: Matrix (>= 1.1-0), methods, data.table (>= 1.9.6), jsonlite
>>> (>= 1.0),
>>>
>>>
>>> The maintainer confirms that he or she
>>> has read and agrees to the CRAN policies.
>>>
>>> =
>>>
>>> Original content of DESCRIPTION file:
>>>
>>> Package: xgboost
>>> Type: Package
>>> Title: Extreme Gradient Boosting
>>> Version: 1.7.11.1
>>> Date: 2025-05-01
>>> Authors@R: c(
>>> person("Tianqi", "Chen", role = c("aut"),
>>> email = "tianqi.tc...@gmail.com"),
>>> person("Tong", "He", role = c("aut"),
>>> email = "hetong...@gmail.com"),
>>> person("Michael", "Benesty", role = c("aut"),
>>> email = "mich...@benesty.fr"),
>>> person("Vadim", "Khotilovich", role = c("aut"),
>>> email = "khotilov...@gmail.com"),
>>> person("Yuan", "Tang", role = c("aut"),
>>> email = "terrytangy