[R] Externalptr class to character class from (web) scrape

Nick McClure nfmcclure at gmail.com
Fri Jul 26 18:43:32 CEST 2013


I'm hitting a wall. When I use the 'scrape' function from the package
'scrapeR' to get the pagesource from a web page, I do the following:
(as an example)

website.doc = parse("http://www.google.com")

When I look at it, it seems fine:

website.doc[[1]]

This seems to have the information I need.  Then when I try to get it
into a character vector,

character.website = as.character(website.doc[[1]])

I get the error:

Error in as.vector(x, "character") :
cannot coerce type 'externalptr' to vector of type 'character'

I'm trying very very hard to wrap my head around how to get this
external pointer to a character, but after reading many help files, I
cannot understand how to do this. Any ideas?



More information about the R-help mailing list