Eksprakcja Tekstu z HTML'a

# load packages
library(RCurl)
library(XML)
 
# assign input (could be a html file, a URL, html text, so some combination of all three is the form of a vector)
input <- "http://www.google.co.uk/search?gcx=c&sourceid=chrome&ie=UTF-8&q=r+project#pq=%22hello+%3C+world%22&hl=en&cp=5&gs_id=3r&xhr=t&q=phd+comics&pf=p&sclient=psy-ab&source=hp&pbx=1&oq=phd+c&aq=0&aqi=g4&aql=&gs_sm=&gs_upl=&bav=on.2,or.r_gc.r_pw.r_cp.,cf.osb&fp=27ff09b2758eb4df&biw=1599&bih=904"
 
# evaluate input and convert to text
txt <- htmlToText(input)
txt
 
#r project - Google Search Web Images Videos Maps News Shopping Gmail More Translate Books Finance Scholar Blogs YouTube Calendar Photos Documents Sites Groups Reader Even more » Account Options Sign in Search settings Web History Advanced Search Results 1 - 10 of about 336,000,000 for r project . Everything More Search Options Show options... Web The R Project for Statistical Computing R , also called GNU S, is a strongly functional language and environment to statistically explore data sets, make many graphical displays of data from custom ... www. r - project .org/ - Cached - Similar [Trunc...]

Created by Pretty R at inside-R.org

Żeby zadziałało potrzebna jest jeszcze funkcja ze strony: github.com

Źródło: R-bloggers

admin piątek, 18 listopad 2011 - 10:23 pm | | Blog-R

Brak komentarzy

(pole opcjonalne)
(pole opcjonalne)
Komentarze są wyłączone ze względu na masowy spam!

Moderacja komentarzy w tym serwisie jest aktywna. To oznacza, że twój komentarz nie będzie widoczny na stronie dopóki nie zostanie zaakceptowany przez redaktora.

Zapamiętać informacje o tobie?
Uwaga: Wszystkie znaczniki HTML poza <b> i <i> zostaną usunięte z twojego komentarza. Możesz dodawać linki wpisując po prostu adres URL lub e-mail.