[R] Error "STRING_ELT() can only be applied to a 'character vector', not a 'list'" from rmarkdown

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Fri Aug 25 15:48:58 CEST 2023


В Fri, 25 Aug 2023 11:49:03 +0200
Chris Evans via R-help <r-help using r-project.org> пишет:

> Hm.  I tried that butI really don't know what to make of what it's 
> telling me.  It seemed to me that I was just stepping through the
> same bits of code (with the warning that the debugger didn't
> have the source so I'm not really sure what it was showing me!)

write_feed_xml is an internal function in the "distill" package. It's
supposed to create the RSS feed for a whole set of web pages. Somehow
it ends up trying to assign a list to xml2::xml_text(some_xml_node),
where only assigning a character string would make sense.

The function contains quite a lot of assignments like this. Some of
them come from site_config (which comes from _site.yml?), others are
taken from the article contents and metadata.

If you run options(error = recover) in a fresh R session before
knitting your website, you should get a debugger menu right at the
point where the code crashes. Try to find out what is the XML node
where the text is being assigned and what is the list that ends up
being assigned into it. You will also get the option to see the
variables in the callers of the failing function, which may shed some
light on the situation too.

-- 
Best regards,
Ivan



More information about the R-help mailing list