[R-pkg-devel] vapply and More Complex FUN.VALUE

2023-09-26 Thread Dario Strbenac
Good day,

Is it possible to somehow specify more complex return types, such as a 
data.frame with specific columns?

--
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [Rd] is.atomic(NULL) will become FALSE

2023-09-26 Thread Martin Maechler
I've sent a longish post to the R-devel mailing list with this
topic here:
https://stat.ethz.ch/pipermail/r-devel/2023-September/082892.html

In the mean time, the plan is to effectuate the change in
R-devel (the in-development version of R) on Sep.28, ~ 9:30 CEST ( =UTC+2)

Martin

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


Re: [R-pkg-devel] Discrepancy between R CMD check results and usethis::use_cran_comments

2023-09-26 Thread Hadley Wickham
On Tue, Sep 26, 2023 at 2:01 AM Leonard Mada via R-package-devel
 wrote:
>
> Dear List-Members,
>
> There are no errors/warnings/notes when I run the check:
>
> ── R CMD check results
>  Rpdb 2.3.3 
> Duration: 2m 50.1s
>
> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
>
> However, there is a discrepancy when I run:
> usethis::use_cran_comments(open = rlang::is_interactive())
> =>
> 0 errors ✔ | 0 warnings ✔ | 1 note
>
> For some reason, the file is saved with 1 note. The discrepancy remains
> even if I restart R, delete the old cran-comments.md file, and re-run
> the check.

This is just a template; you need to fill it out with the actual
results. (There's usually one note on first submission which is why we
use this as the default.)

Hadley

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


Re: [R-pkg-devel] 2 Return values for 2 Functions

2023-09-26 Thread Enrico Schumann
On Tue, 26 Sep 2023, Leonard Mada via R-package-devel writes:

> Dear Members,
>
>
> How should the return values be documented, when the
> help page covers 2 related functions:
>
>
> 1.) Variant 1: fails the checks
>
> \value{
> \code{cryst1} returns a list of class \sQuote{cryst1} with the
> following components:
> \describe{
> \item{abc}{a numeric vector of length 3 containing the norms of the lattice
>   vectors a, b and c there are more items}
> }
> \item{}{}
> \code{is.cryst1} returns TRUE if \code{x} is an object
> of class \sQuote{cryst1}
>   and FALSE otherwise.
> }
>
>
> 2.) Variant 2: fails in Latex
>
> \value{
> \code{cryst1} returns a list of class \sQuote{cryst1} with the
> following components:
> \describe{
> \item{abc}{a numeric vector of length 3 containing the norms of the lattice
>   vectors a, b and c there are more items}
> }
> \cr\cr
> \code{is.cryst1} returns TRUE if \code{x} is an object
> of class \sQuote{cryst1}
>   and FALSE otherwise.
> }
>
>
> 3.) 2 separate Value-Sections
>
> Did not generate actually 2 sections: only the 1st one.
>
>
> Sincerely,
>
>
> Leonard


Have you tried something like this?

\value{
  Function \code{xx} evaluates to a list:
  \item{A}{result A}
  \item{B}{result B}

  Function \code{yy} evaluates to a list:
  \item{C}{result C}
  \item{D}{result D}  
}

"Writing R Extensions" says not to use \describe environments;
see https://cran.r-project.org/doc/manuals/R-exts.html#index-_005cvalue :

,
| Note that \value is implicitly a \describe environment, so
| that environment should not be used for listing components,
| just individual \item{}{} entries.
`



-- 
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net

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


[R-pkg-devel] 2 Return values for 2 Functions

2023-09-26 Thread Leonard Mada via R-package-devel

Dear Members,


How should the return values be documented, when the help page covers 2 
related functions:



1.) Variant 1: fails the checks

\value{
\code{cryst1} returns a list of class \sQuote{cryst1} with the
following components:
\describe{
\item{abc}{a numeric vector of length 3 containing the norms of the lattice
  vectors a, b and c there are more items}
}
\item{}{}
\code{is.cryst1} returns TRUE if \code{x} is an object of class 
\sQuote{cryst1}

  and FALSE otherwise.
}


2.) Variant 2: fails in Latex

\value{
\code{cryst1} returns a list of class \sQuote{cryst1} with the
following components:
\describe{
\item{abc}{a numeric vector of length 3 containing the norms of the lattice
  vectors a, b and c there are more items}
}
\cr\cr
\code{is.cryst1} returns TRUE if \code{x} is an object of class 
\sQuote{cryst1}

  and FALSE otherwise.
}


3.) 2 separate Value-Sections

Did not generate actually 2 sections: only the 1st one.


Sincerely,


Leonard

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


Re: [R-pkg-devel] [EXTERNAL] Re: Warning: a function declaration without a prototype is deprecated in all versions of C

2023-09-26 Thread Serguei Sokol

Le 26/09/2023 à 10:50, Iñaki Ucar a écrit :

On Tue, 26 Sept 2023 at 10:29, Sameh Abdulah  wrote:


Thanks for replying!

The main problem that this warning from a C library that I am relying on, I 
have no control to fix the warning there. So, I am still getting this warning 
from R, when building my package.


We don't have a way of knowing for sure, because you didn't provide a
link to the package in question, so I'm just guessing here. From your
description, it seems that you vendor OpenBLAS in your package,
And if you do, it's probably not the best way to proceed. R relies 
already heavily on BLAS. So it is already available and may be it is 
sufficient in your case to add the following lines to Makevars to link 
to the local BLAS and leave the choice of the vendor to a final user 
(OpenBLAS, Atlas, MKL, ...):


PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

You can see a demo package of using BLAS/LAPACK in R e.g. at 
https://github.com/cjgeyer/mat


Best,
Serguei.


and
that's why you get a warning. Then you *do* have control to fix that:
just patch your copy appropriately. This is what e.g. the BH package
(and others) do. And in this case it would be nice to send the fix
upstream too.

Iñaki



Best,
--Sameh

From: R-package-devel  on behalf of Jeff 
Newmiller via R-package-devel 
Date: Tuesday, September 26, 2023 at 11:19 AM
To: r-package-devel@r-project.org 
Subject: [EXTERNAL] Re: [R-pkg-devel] Warning: a function declaration without a 
prototype is deprecated in all versions of C
This error arises because you are not declaring the function properly before 
you call it... likely because you have not included the appropriate header file 
or because you have typoed the function call.

If you provide a link to your package someone may point you more precisely to 
your error, but this is a pretty basic C language question rather than an R 
package question so it isn't technically on topic here.

On September 26, 2023 12:58:25 AM PDT, Sameh Abdulah 
 wrote:

Dear Colleagues,


I've encountered a warning in my package that states:

'warning: a function declaration without a prototype is deprecated in all 
versions of C [-Wstrict-prototypes].'

This warning originates from one of the libraries I depend on, specifically 
OpenBLAS. So, I have no control to fix it inside OpenBLAS.

I'm not sure how to resolve this issue.


Best regards,
--Sameh"




--
Sent from my phone. Please excuse my brevity.

__
R-package-devel@r-project.org mailing list
https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-package-devel__;!!Nmw4Hv0!yyvWt-qHY4RQENDvneARJTJbYchLTruMwyEmREYaEtV52oUiLbgVqWM1wxJW-ijKGJeNgHq1HWtnHCQ1_CqTIRN9gfJfWX3c1A7nVQ$

--

This message and its contents, including attachments are intended solely
for the original recipient. If you are not the intended recipient or have
received this message in error, please notify me immediately and delete
this message from your computer system. Any unauthorized use or
distribution is prohibited. Please consider the environment before printing
this email.

 [[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] [EXTERNAL] Re: Warning: a function declaration without a prototype is deprecated in all versions of C

2023-09-26 Thread Iñaki Ucar
On Tue, 26 Sept 2023 at 10:29, Sameh Abdulah  wrote:
>
> Thanks for replying!
>
> The main problem that this warning from a C library that I am relying on, I 
> have no control to fix the warning there. So, I am still getting this warning 
> from R, when building my package.

We don't have a way of knowing for sure, because you didn't provide a
link to the package in question, so I'm just guessing here. From your
description, it seems that you vendor OpenBLAS in your package, and
that's why you get a warning. Then you *do* have control to fix that:
just patch your copy appropriately. This is what e.g. the BH package
(and others) do. And in this case it would be nice to send the fix
upstream too.

Iñaki

>
> Best,
> --Sameh
>
> From: R-package-devel  on behalf of 
> Jeff Newmiller via R-package-devel 
> Date: Tuesday, September 26, 2023 at 11:19 AM
> To: r-package-devel@r-project.org 
> Subject: [EXTERNAL] Re: [R-pkg-devel] Warning: a function declaration without 
> a prototype is deprecated in all versions of C
> This error arises because you are not declaring the function properly before 
> you call it... likely because you have not included the appropriate header 
> file or because you have typoed the function call.
>
> If you provide a link to your package someone may point you more precisely to 
> your error, but this is a pretty basic C language question rather than an R 
> package question so it isn't technically on topic here.
>
> On September 26, 2023 12:58:25 AM PDT, Sameh Abdulah 
>  wrote:
> >Dear Colleagues,
> >
> >
> >I've encountered a warning in my package that states:
> >
> >'warning: a function declaration without a prototype is deprecated in all 
> >versions of C [-Wstrict-prototypes].'
> >
> >This warning originates from one of the libraries I depend on, specifically 
> >OpenBLAS. So, I have no control to fix it inside OpenBLAS.
> >
> >I'm not sure how to resolve this issue.
> >
> >
> >Best regards,
> >--Sameh"
> >
> >
>
> --
> Sent from my phone. Please excuse my brevity.
>
> __
> R-package-devel@r-project.org mailing list
> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-package-devel__;!!Nmw4Hv0!yyvWt-qHY4RQENDvneARJTJbYchLTruMwyEmREYaEtV52oUiLbgVqWM1wxJW-ijKGJeNgHq1HWtnHCQ1_CqTIRN9gfJfWX3c1A7nVQ$
>
> --
>
> This message and its contents, including attachments are intended solely
> for the original recipient. If you are not the intended recipient or have
> received this message in error, please notify me immediately and delete
> this message from your computer system. Any unauthorized use or
> distribution is prohibited. Please consider the environment before printing
> this email.
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



-- 
Iñaki Úcar

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


Re: [R-pkg-devel] [EXTERNAL] Re: Warning: a function declaration without a prototype is deprecated in all versions of C

2023-09-26 Thread Sameh Abdulah
Thanks for replying!

The main problem that this warning from a C library that I am relying on, I 
have no control to fix the warning there. So, I am still getting this warning 
from R, when building my package.

Best,
--Sameh

From: R-package-devel  on behalf of Jeff 
Newmiller via R-package-devel 
Date: Tuesday, September 26, 2023 at 11:19 AM
To: r-package-devel@r-project.org 
Subject: [EXTERNAL] Re: [R-pkg-devel] Warning: a function declaration without a 
prototype is deprecated in all versions of C
This error arises because you are not declaring the function properly before 
you call it... likely because you have not included the appropriate header file 
or because you have typoed the function call.

If you provide a link to your package someone may point you more precisely to 
your error, but this is a pretty basic C language question rather than an R 
package question so it isn't technically on topic here.

On September 26, 2023 12:58:25 AM PDT, Sameh Abdulah 
 wrote:
>Dear Colleagues,
>
>
>I've encountered a warning in my package that states:
>
>'warning: a function declaration without a prototype is deprecated in all 
>versions of C [-Wstrict-prototypes].'
>
>This warning originates from one of the libraries I depend on, specifically 
>OpenBLAS. So, I have no control to fix it inside OpenBLAS.
>
>I'm not sure how to resolve this issue.
>
>
>Best regards,
>--Sameh"
>
>

--
Sent from my phone. Please excuse my brevity.

__
R-package-devel@r-project.org mailing list
https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-package-devel__;!!Nmw4Hv0!yyvWt-qHY4RQENDvneARJTJbYchLTruMwyEmREYaEtV52oUiLbgVqWM1wxJW-ijKGJeNgHq1HWtnHCQ1_CqTIRN9gfJfWX3c1A7nVQ$

-- 

This message and its contents, including attachments are intended solely 
for the original recipient. If you are not the intended recipient or have 
received this message in error, please notify me immediately and delete 
this message from your computer system. Any unauthorized use or 
distribution is prohibited. Please consider the environment before printing
this email.

[[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] Warning: a function declaration without a prototype is deprecated in all versions of C

2023-09-26 Thread Jeff Newmiller via R-package-devel
This error arises because you are not declaring the function properly before 
you call it... likely because you have not included the appropriate header file 
or because you have typoed the function call.

If you provide a link to your package someone may point you more precisely to 
your error, but this is a pretty basic C language question rather than an R 
package question so it isn't technically on topic here.

On September 26, 2023 12:58:25 AM PDT, Sameh Abdulah 
 wrote:
>Dear Colleagues,
>
>
>I've encountered a warning in my package that states:
>
>'warning: a function declaration without a prototype is deprecated in all 
>versions of C [-Wstrict-prototypes].'
>
>This warning originates from one of the libraries I depend on, specifically 
>OpenBLAS. So, I have no control to fix it inside OpenBLAS.
>
>I'm not sure how to resolve this issue.
>
>
>Best regards,
>--Sameh"
>
>

-- 
Sent from my phone. Please excuse my brevity.

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


Re: [R-pkg-devel] R_orderVector1 - algo: radix, shell, or another?

2023-09-26 Thread Jan Gorecki
Thank you Ivan for all detail.

I was looking for particular algo for benchmarking purpose.

On Mon, Sep 25, 2023 at 9:26 AM Ivan Krylov  wrote:

> В Sun, 24 Sep 2023 10:38:41 +0200
> Jan Gorecki  пишет:
>
> >
> https://github.com/wch/r-source/blob/ed51d34ec195b89462a8531b9ef30b7b72e47204/src/main/sort.c#L1133
>
> > could anyone describe which one R_orderVector1 uses,
>
> The body of the sorting algorithm is defined in the sort2_with_index
> macro. This is shell sort. (I don't actually recognise sorting
> algorithms on sight, but the "sincs" array gave it away:
> <
> https://discourse.julialang.org/t/ironic-observation-about-sort-and-sortperm-speed-for-small-integers-vs-r/8715/3
> >.)
>
> > and if there is easy API to use different ones from C?
>
> No easy ones, I think. You could construct a call to order(..., method
> = 'radix') from R or bundle a sort implementation of your own.
>
> These are all undocumented implementation details. They could change in
> a new version of R (although quite a lot of it hasn't changed in 11-22
> years). Why are you looking for specific sorting algorithms? Could
> there be a better way to solve your problem?
>
> --
> Best regards,
> Ivan
>

[[alternative HTML version deleted]]

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


[R-pkg-devel] Warning: a function declaration without a prototype is deprecated in all versions of C

2023-09-26 Thread Sameh Abdulah
Dear Colleagues,


I've encountered a warning in my package that states:

'warning: a function declaration without a prototype is deprecated in all 
versions of C [-Wstrict-prototypes].'

This warning originates from one of the libraries I depend on, specifically 
OpenBLAS. So, I have no control to fix it inside OpenBLAS.

I'm not sure how to resolve this issue.


Best regards,
--Sameh"


-- 

This message and its contents, including attachments are intended solely 
for the original recipient. If you are not the intended recipient or have 
received this message in error, please notify me immediately and delete 
this message from your computer system. Any unauthorized use or 
distribution is prohibited. Please consider the environment before printing 
this email.

[[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] Discrepancy between R CMD check results and usethis::use_cran_comments

2023-09-26 Thread Ivan Krylov
В Tue, 26 Sep 2023 10:01:21 +0300
Leonard Mada via R-package-devel  пишет:

> ── R CMD check results 

Is it R CMD check or R CMD check --as-cran? You will most likely get a
NOTE when checking a package with --as-cran that had been archived on
CRAN.

> By the way: what is the purpose of this cran-comments.md file? It
> does not seem to be included in the package archive?

This convention is from the book "R Packages" by Hadley Wickham and
Jennifer Bryan:
https://r-pkgs.org/release.html#sec-release-cran-comments

According to the book, it's important to put the CRAN submission
comments under version control. Indeed, the actual file is excluded
from the source package using .Rbuildignore. Its contents are
transferred to the "optional comment" field when the devtools
package submits the form at .

Many people find the devtools abstraction layer convenient, and since
you're already using devtools, the path of least resistance is to keep
using this file.

-- 
Best regards,
Ivan

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


[R-pkg-devel] Discrepancy between R CMD check results and usethis::use_cran_comments

2023-09-26 Thread Leonard Mada via R-package-devel

Dear List-Members,

There are no errors/warnings/notes when I run the check:

── R CMD check results 
 Rpdb 2.3.3 

Duration: 2m 50.1s

0 errors ✔ | 0 warnings ✔ | 0 notes ✔

However, there is a discrepancy when I run:
usethis::use_cran_comments(open = rlang::is_interactive())
=>
0 errors ✔ | 0 warnings ✔ | 1 note

For some reason, the file is saved with 1 note. The discrepancy remains 
even if I restart R, delete the old cran-comments.md file, and re-run 
the check.



By the way: what is the purpose of this cran-comments.md file? It does 
not seem to be included in the package archive?



Sincerely,


Leonard

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