I have a variable with html code.
Here what the code variable outpout in R console:
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
I try to save the content into a txt file
write.table(code, file='C:/Users/Desktop/code_result.txt')
But it stacks with this error:
Error in as.data.frame.default(x[[i]], optional = TRUE) :
c("cannot coerce class \"c(\"HTMLInternalDocument\", \"HTMLInternalDocument\", \"XMLInternalDocument\", \" to a data.frame", "cannot coerce class \"\"XMLAbstractDocument\")\" to a data.frame")
Title
` – Berbery Dec 25 '15 at 13:33