I am trying to run an R script that I wrote some months ago. I would like to download online information which is why I use the htmlToText function. R can't find this function even though I have included the RCurl and XML packages.
library(XML)
library(RCurl)
doc=htmlToText(link)
Error: could not find function "htmlToText"
Why is this the case and how can I solve the error?
Best Pete
That is not a function native to those packages. I assume you are looking at the blog post:
http://www.r-bloggers.com/htmltotext-extracting-text-from-html-via-xpath/
In that case the function definition for
htmlToText
can be found here:https://github.com/tonybreyal/Blog-Reference-Functions/blob/master/R/htmlToText/htmlToText.R
Authored by Tony Breyal: