Open nuest opened 5 years ago
There is no such migration guide within the xml2 docs. There are definitely packages that have done this, but I can't think of any off the top of my head. You might be able to turn some up with clever GitHub searches. But it really sounds like a good topic for https://community.rstudio.com or even an #rstats tweet.
Thanks for the ideas, I went ahead with one and two. Would you mind leaving this issue open for a little bit, potentially collect some more information?
The migration will be a big step for my package, so I'll need a bit to schedule that, and it'll probably be so much work that a couple of hours to write down lessons learned are not a big addition. Still I'd hope to find some other contributors to such a migration guide and collect as much information here as possible.
itdepends
is very useful for finding all references to functions of the package, see https://speakerdeck.com/jimhester/it-depends?slide=39Here's are some of the main PRs where the switch happened in googlesheets:
I just published my notes on the transition to xml2
in this gist:
https://gist.github.com/nuest/3ed3b0057713eb4f4d75d11bb62f2d66
The source code changes are best seen via the commits mentioning the issue https://github.com/52North/sos4R/issues/42
The notes include a table listing the related functions, and things I could "automate" with regexes, and changes I did manually. It's pretty raw, not a friendly "guide" yet. I'm open for feedback and suggestions how to proceed here. Looking at the large number of packages depending on XML
, an orphaned package, it might be worth reaching out to some of them and advertise xml2
.
I currently use the XML package only because of the readHTMLTable
function. The xml2 package does not have a function to read tables in the HTML files, correct? I've already tried using the rvest :: html_table function, but readHTMLTable
is 10x faster and produces a cleaner data table.
I put an HTML example in the attached file. The table "id =' tableResult" for test
I think a useful TDD task would be to take @nuest's guide and turning parts of it into a vignette / pkgdown article.
Atualmente, uso o pacote XML apenas por causa da
readHTMLTable
função. O pacote xml2 não tem função de leitura de tabelas nos arquivos HTML, correto? Já tentei usar a função rvest :: html_table, masreadHTMLTable
é 10x mais rápida e produz uma tabela de dados mais limpa.Coloquei um exemplo de HTML no arquivo anexado. A tabela "id = 'tableResult" para teste
@hadley made a spectacular improvement in the performance of the rvest::html_table
function!!! Aqui
You may want to include the rvest::html_table
function in the tutorial Switching from XML to xml2
The package
XML
is orphaned on CRAN. There are still updates from time to time, but I am unsure whether my current problem, where I get a segfault the moment thatRccp
is loaded, will be fixed.Is there a migration guide for users to switch to
xml2
fromXML
or are you aware of any packages that did this?