[R] Accessing Pointers

Roy Mendelssohn - NOAA Federal roy.mendelssohn at noaa.gov
Fri Jun 23 01:34:10 CEST 2017


Hi Lawrence:
> On Jun 22, 2017, at 4:26 PM, David Winsemius <dwinsemius at comcast.net> wrote:
> 
> 
> 
>> is pointing to in the following line of code.  Need some help.
>> 
>> #install.packages('xml2')
>> library('xml2')
>> pg1 <- read_html("www.msn.com")
> 
> Error: 'www.msn.com' does not exist in current working directory ('/Users/davidwinsemius').
> 
> 

I suggest you do:

?read_html

and peruse it carefully.  You are not passing it a URL.

> library('xml2')
> pg1 <- read_html("http://www.msn.com")
> str(pg1)
List of 2
 $ node:<externalptr> 
 $ doc :<externalptr> 
 - attr(*, "class")= chr [1:2] "xml_document" "xml_node"


**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.



More information about the R-help mailing list