parse_html_table: A simplistic HTML parser for Synop data from the Ogimet...

View source: R/parse_html_table.R

parse_html_tableR Documentation

A simplistic HTML parser for Synop data from the Ogimet webpage

Description

Parses an HTML table into a data.frame using base R only with no external dependencies The code relies purely on regular expressions and basic string and regex functions.

Usage

parse_html_table(html, table_start_pattern = "<TABLE[^>]*>")

Arguments

html

a single string containing the HTML body (or any larger HTML chunk) that includes the table you want to parse.

Details

By default the function grabs the first TABLE element it finds. If the HTML code has several tables and you need a specific one, pass a regex that matches its opening tag via table_start_pattern, e.g.:

parse_html_table(html, table_start_pattern = '<TABLE align="center" border=0[^>]*>')

Value

description

data.frame with automatically detected column names (built from


climate documentation built on Sept. 18, 2026, 5:06 p.m.