[R] How to import HTML and SQL files

Dieter Menne dieter.menne at menne-biomed.de
Wed Feb 4 15:43:02 CET 2009


Arup <arup.pramanik27 <at> gmail.com> writes:

> I can't import any HTML or SQL files into R..:confused: 

Also confused. HTML and SQL are like apples and bugs.

For HTML (assume you want to extract stock quotes from a site)

-- If you have strict XHTML, using package XML might be
   the best choice, but I doubt you get these nowadays.
-- Otherwise, read in the file and use regular expressions (grep, 
   gsub) to parse.

For SQL: SELECT * from mybase

-- "Importing" that string does not help very much, this is 
   a program telling you what to do when you know your database.
-- You might have a look at package RODBC or RSQLite; details depend on 
   the database you are going to use.

Dieter




More information about the R-help mailing list