[Rd] API for converting LANGSXP to LISTSXP?

2024-07-05 Thread Kevin Ushey
Hi,

A common idiom in the R sources is to convert objects between LANGSXP
and LISTSXP by using SET_TYPEOF. However, this is soon going to be
disallowed in packages. From what I can see, there isn't currently a
direct way to convert between these two object types using the
available API. At the R level, one can convert calls to pairlists
with:

> as.call(pairlist(as.symbol("rnorm"), 42))
rnorm(42)

However, the reverse is not possible:

> as.pairlist(call("rnorm", 42))
Error in as.pairlist(call("rnorm", 42)) :
  'language' object cannot be coerced to type 'pairlist'

One can do such a conversion via conversion to e.g. an intermediate R
list (VECSXP), but that seems wasteful. Would it make sense to permit
this coercion? Or, is there some other relevant API I'm missing?

For completeness, Rf_coerceVector() also emits the same error above
since it uses the same code path.

Thanks,
Kevin

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


[Rd] quarto list of figures

2024-07-05 Thread neonira Arinoem
I am struggling to get Quarto producing a list of figures from a Quarto
book.

Where may I find a working sample to get inspiration from?

[[alternative HTML version deleted]]

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


Re: [Rd] quarto list of figures

2024-07-05 Thread MichaƂ Bojanowski
> I am struggling to get Quarto producing a list of figures from a Quarto
> book.
>
> Where may I find a working sample to get inspiration from?

You will have more luck asking at
https://github.com/quarto-dev/quarto-cli/discussions

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