readUrl: Read data from a URL

Description Usage Arguments Value

Description

The task for this function is to read the data from the URL location and assign appropriate column names. The function will throw a warning if there are more columns in the data table than expected. If there are fewer columns than expected the function will retry up to 10 times to get the number of columns correct. If it fails after 10 tries then an error will be thrown.

Usage

1
2
readUrl(inpUrl, columnTypes, columnNames, whichTable, removeRow, dataType,
  idVar, playerLinkString, fbgUser, fbgPwd)

Arguments

inpUrl

The URL to get data from

columnTypes

A character vector describing the types of columns in the data. Note: length(columnTypes) == length(columnNames).

columnNames

A character vector describing the names of the columns in the data. Note: length(columnTypes) == length(columnNames).

whichTable

A number or character describing the table to get. This can be leveraged for HTML tables and spreadsheet files.

removeRow

A numeric vector indicating rows to skip at the top of the data. For exampe c(1,2) will skip the first two rows of data.

dataType

A character indicating the type of data (HTML, XML, file, xls)

Value

Returns a data.table with data from URL.


dadrivr/ffanalytics documentation built on May 14, 2019, 3:12 p.m.