Re: [R-pkg-devel] CRAN packages dependency on bioconductor packages

2024-05-14 Thread Lluís Revilla
Hi Junhui,

There is a separate log for checking if your package works without
suggested packages: in the StepReg results
The noSuggests title leads to:
https://www.stats.ox.ac.uk/pub/bdr/noSuggests/StepReg.out
Where you can see that it fails if a user don't have BiocStyle installed.
I don't know if it is possible to use a vignette output conditionally with
knitr: In any case it seems that it would be a requirement (Imports, or
Depends).

However, it is best to not use the Bioconductor style for a package in
CRAN.
You could use the *_vignette or *_document format directly (from rmarkdown
if I recall correctly).
You will remove a dependency and avoid this problem entirely.

Best,

Lluís


On Tue, 14 May 2024 at 22:48, Li, Junhui  wrote:

> Hi everyone,
>
> I recently developed an R package called 'StepReg' and used the
> Bioconductor R package 'BiocStyle' in my vignettes, as shown below:
>
> output:
>   BiocStyle::html_document:
> toc_float: true
>   BiocStyle::pdf_document: default
>
> In my DESCRIPTION file, I added 'BiocStyle' to the Suggests field and
> included a new line 'biocViews:', as follows:
>
> VignetteBuilder: knitr
> biocViews:
> Suggests:
> knitr,
> testthat,
> BiocStyle,
> kableExtra
>
> You may find all those information here:
> https://github.com/JunhuiLi1017/StepReg/tree/dev
>
> There were no error messages when checking with 'R CMD check' and on
> https://win-builder.r-project.org/upload.aspx. However, an error message
> occurred when I attempted to upload it to CRAN:
>
> * checking re-building of vignette outputs ... ERROR
> Error(s) in re-building vignettes:
> --- re-building 'StepReg.Rmd' using rmarkdown
> Error: processing vignette 'StepReg.Rmd' failed with diagnostics:
> there is no package called 'BiocStyle'
> --- failed re-building 'StepReg.Rmd'
>
> SUMMARY: processing the following file failed:
>'StepReg.Rmd'
>
> Error: Vignette re-building failed.
> Execution halted
>
> For version 1.5.0 (
> https://cran.r-project.org/web/packages/StepReg/index.html), I
> successfully uploaded it to CRAN without including 'biocViews:' in the
> DESCRIPTION file two months ago. However, I'm encountering difficulties
> this time. Any insights or suggestions on resolving this issue would be
> greatly appreciated.
>
> Thanks,
> Junhui
>
> [[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


[R-pkg-devel] CRAN packages dependency on bioconductor packages

2024-05-14 Thread Li, Junhui
Hi everyone,

I recently developed an R package called 'StepReg' and used the Bioconductor R 
package 'BiocStyle' in my vignettes, as shown below:

output:
  BiocStyle::html_document:
toc_float: true
  BiocStyle::pdf_document: default

In my DESCRIPTION file, I added 'BiocStyle' to the Suggests field and included 
a new line 'biocViews:', as follows:

VignetteBuilder: knitr
biocViews:
Suggests:
knitr,
testthat,
BiocStyle,
kableExtra

You may find all those information here: 
https://github.com/JunhuiLi1017/StepReg/tree/dev

There were no error messages when checking with 'R CMD check' and on 
https://win-builder.r-project.org/upload.aspx. However, an error message 
occurred when I attempted to upload it to CRAN:

* checking re-building of vignette outputs ... ERROR
Error(s) in re-building vignettes:
--- re-building 'StepReg.Rmd' using rmarkdown
Error: processing vignette 'StepReg.Rmd' failed with diagnostics:
there is no package called 'BiocStyle'
--- failed re-building 'StepReg.Rmd'

SUMMARY: processing the following file failed:
   'StepReg.Rmd'

Error: Vignette re-building failed.
Execution halted

For version 1.5.0 (https://cran.r-project.org/web/packages/StepReg/index.html), 
I successfully uploaded it to CRAN without including 'biocViews:' in the 
DESCRIPTION file two months ago. However, I'm encountering difficulties this 
time. Any insights or suggestions on resolving this issue would be greatly 
appreciated.

Thanks,
Junhui

[[alternative HTML version deleted]]

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


[Rd] Support for as(x, "raw")

2024-05-14 Thread Hervé Pagès
Hi,

as(x, "") is supported and does as.(x) for all 
vector types except for raw. For example all the following coercions 
work and do what you'd expect: as(1L, "logical"), as(1L, "double"), 
as(1L, "complex"), as(1L, "character"), as(1L, "list"). But as(1L, 
"raw") does not:

     > as(1L, "raw")
     Error in as(1L, "raw") :
       no method or default for coercing “integer” to “raw”

Even though as.raw(1L) works:

     > as.raw(1L)
     [1] 01

Is there any particular reason for that or would it be reasonable to 
define a coerce() method from ANY to raw like it's been done for all the 
other vector types:

     > selectMethod(coerce, c("ANY", "logical"))
     Method Definition:
     function (from, to, strict = TRUE)
     {
         value <- as.logical(from)
         if (strict)
             attributes(value) <- NULL
         value
     }
     
     Signatures:
             from  to
     target  "ANY" "logical"
     defined "ANY" "logical"

     ...

     ...

     > selectMethod(coerce, c("ANY", "list"))
     Method Definition:
     function (from, to, strict = TRUE)
     {
         value <- as.list(from)
         if (strict)
             attributes(value) <- NULL
         value
     }
     
     Signatures:
         from  to
     target  "ANY" "list"
     defined "ANY" "list"


     > selectMethod(coerce, c("ANY", "raw"))
     Error in selectMethod(coerce, c("ANY", "raw")) :
       no method found for signature ANY, raw

Thanks,

H.

-- 
Hervé Pagès

Bioconductor Core Team
hpages.on.git...@gmail.com

[[alternative HTML version deleted]]

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


Re: [Rd] Altrep and translations (was "[R] Description of error is untranslated when ....")

2024-05-14 Thread Ricardo Villalba
Hello
On the other hand, i find that R_compact_intrange checks whether (r = n2 -
n1 + 1) >= R_XLEN_T_MAX,  while seq_colon checks for (r = fabs(n2 - n1)) >=
R_XLEN_T_MAX. And only then n is defined as r + 1 + epsilon. r is not used
again
That is why seq_colon does not reject that size at first and then altrep
does.
Should not line 101  be  " if (r + 1 + FLT_EPSILON >= R_XLEN_T_MAX) "
instead of r >= R_XLEN_T_MAX?

El mar, 14 may 2024 a las 4:45, Martin Maechler ()
escribió:

> > Ivan Krylov via R-help
> > on Tue, 14 May 2024 08:08:58 +0300 writes:
>
> > Dear Ricardo Villalba, Thank you for spotting this corner
> > case!
>
> > В Mon, 13 May 2024 11:37:57 -0300 Ricardo Villalba
> >  пишет:
>
> >> I track the messages to be coded here:
> >>
> https://github.com/r-devel/r-svn/blob/abe625945c4402cd2bb97b5a64e7469db3e904f0/src/main/altclasses.c#L580
> >> and here
> >>
> https://github.com/r-devel/r-svn/blob/abe625945c4402cd2bb97b5a64e7469db3e904f0/src/main/seq.c#L102
>
> > You may have noticed that one of these places lacks the
> > underscore that R uses as the translation keyword: it's
> > _(string) that looks up the translation of the string.
>
> > Would you like to suggest a patch on R-devel@r-project.org
> > or https://bugs.r-project.org ?
>
> > --
> > Best regards, Ivan
>
> Thank you, but, well... for such small changes -- that would be
> quite a bit of (human, i.e. R-core) overhead, but of course is
> generally a good possibility  (but here, wait! .. and read on : )
>
> Actually -- this now gets more  "R-devel" - appropriate --
> I notice that there are quite a few  error("..." .. )
> and also  warning("..." ..) calls in
> src/main/altclasses.c *and* in
> src/main/altrep.cand *none* of them asks for translation;
>
> While this could be for historical reasons (code originally much
> by Gabe Becker from outside R-core *and* at first just in a
> separate branch before being merged in to the main (r-devel)
> branch.
> OTOH: There may be good reasons for translations lookup being
> brittle in case of altrep error messages .. and hence left off
> purposely?
>
> Martin
>
> --
> Martin Maechler
> ETH Zurich  and  R Core Team
>
>

-- 
®DV!

[[alternative HTML version deleted]]

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


Re: [Rd] FR: Customize background colour of row and column headers for the View output

2024-05-14 Thread Duncan Murdoch
This seems like something that should be fairly easily doable.  Why 
don't you work out a patch?


Some decisions to make:

- What colours are we talking about?  Would you want the labels to have 
their colour set independent of the dialog colours?  If so, would you 
also want to configure the dialog colours?


- What names should be used for the colours?

- Where should all of these definitions be documented?

If you don't feel comfortable with the coding, perhaps you could answer 
these questions, and someone else may code it for you.  I won't (I no 
longer have easy access to Windows), but I could help with the design.


Duncan Murdoch

On 2024-05-14 5:25 a.m., Iago Giné Vázquez wrote:

Thanks again Duncan and Ivan,

I forward then the email to R-devel.

Summarizing, the dataedit options (in RGui preferences or RConsole) to
colouring the View output do not have effect on the background of the row
and column names (see https://ibb.co/Dkn2pVs ).

Could this be implemented?

Thank you!

Best regards,
Iago

*De:* Ivan Krylov 
*Enviat el:* dilluns, 13 de maig de 2024 14:34
*Per a:* Duncan Murdoch 
*A/c:* Iago Giné Vázquez ; r-h...@r-project.org 


*Tema:* Re: [R] Is there some way to customize colours for the View output?
В Mon, 13 May 2024 06:08:22 -0400
Duncan Murdoch  пишет:


The row and column names don't appear to be controllable from that
menu, they seem (on my machine) to be displayed in the same colour as
the background of a dialog box, i.e. some kind of gray.  I don't
think R tries to control that colour, but perhaps some Windows
setting would change it.


This is entirely correct: the dialog uses the colour returned by
dialog_bg(), which is GetSysColor(COLOR_BTNFACE).

I think it could be a reasonable feature request to use an adjustable
colour for the row and column headers.

--
Best regards,
Ivan


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


[Rd] FR: Customize background colour of row and column headers for the View output

2024-05-14 Thread Iago Giné Vázquez
Thanks again Duncan and Ivan,

I forward then the email to R-devel.

Summarizing, the dataedit options (in RGui preferences or RConsole) to
colouring the View output do not have effect on the background of the row
and column names (see https://ibb.co/Dkn2pVs).

Could this be implemented?

Thank you!

Best regards,
Iago

De: Ivan Krylov 
Enviat el: dilluns, 13 de maig de 2024 14:34
Per a: Duncan Murdoch 
A/c: Iago Gin�� V��zquez ; r-h...@r-project.org 

Tema: Re: [R] Is there some way to customize colours for the View output?

�� Mon, 13 May 2024 06:08:22 -0400
Duncan Murdoch  ��ڧ�֧�:

> The row and column names don't appear to be controllable from that
> menu, they seem (on my machine) to be displayed in the same colour as
> the background of a dialog box, i.e. some kind of gray.  I don't
> think R tries to control that colour, but perhaps some Windows
> setting would change it.

This is entirely correct: the dialog uses the colour returned by
dialog_bg(), which is GetSysColor(COLOR_BTNFACE).

I think it could be a reasonable feature request to use an adjustable
colour for the row and column headers.

--
Best regards,
Ivan

[[alternative HTML version deleted]]

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


[Rd] Altrep and translations (was "[R] Description of error is untranslated when ....")

2024-05-14 Thread Martin Maechler
> Ivan Krylov via R-help 
> on Tue, 14 May 2024 08:08:58 +0300 writes:

> Dear Ricardo Villalba, Thank you for spotting this corner
> case!

> В Mon, 13 May 2024 11:37:57 -0300 Ricardo Villalba
>  пишет:

>> I track the messages to be coded here:
>> 
https://github.com/r-devel/r-svn/blob/abe625945c4402cd2bb97b5a64e7469db3e904f0/src/main/altclasses.c#L580
>> and here
>> 
https://github.com/r-devel/r-svn/blob/abe625945c4402cd2bb97b5a64e7469db3e904f0/src/main/seq.c#L102

> You may have noticed that one of these places lacks the
> underscore that R uses as the translation keyword: it's
> _(string) that looks up the translation of the string.

> Would you like to suggest a patch on R-devel@r-project.org
> or https://bugs.r-project.org ?

> -- 
> Best regards, Ivan

Thank you, but, well... for such small changes -- that would be
quite a bit of (human, i.e. R-core) overhead, but of course is
generally a good possibility  (but here, wait! .. and read on : )

Actually -- this now gets more  "R-devel" - appropriate --
I notice that there are quite a few  error("..." .. )
and also  warning("..." ..) calls in
src/main/altclasses.c *and* in
src/main/altrep.cand *none* of them asks for translation;

While this could be for historical reasons (code originally much
by Gabe Becker from outside R-core *and* at first just in a
separate branch before being merged in to the main (r-devel)
branch.
OTOH: There may be good reasons for translations lookup being
brittle in case of altrep error messages .. and hence left off
purposely?

Martin

--
Martin Maechler
ETH Zurich  and  R Core Team

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