html2df: Converts a html document in data.frame

Description Usage Arguments Value

View source: R/html2df.R

Description

This a high level function that facilitate the creation of a data.frame from an html document

Usage

1
html2df(doc, obsPath, varPath, extractFun = cssCharacter)

Arguments

doc

A parsed html document created with htmlParse

obsPath

CSS path to the html elements containing the observations (see example)

varPath

Named list containing the paths to the elements containing the values to extract inside an observation (see example)

extractFun

Function or vector of functions of same length than varPath. This parameter indicates what kind of value to extract for each variable (cssCharacter for character value, cssNumeric for numeric value, etc.)

Value

a data.frame with number of rows corresponding to the number of elements selected by "obsPath" and number of columns equal to the length of varPath


cuche27/CSS documentation built on May 12, 2017, 1:27 p.m.