getBBAG: getBBAG - Download historic sale results data from BBAG.

Description Usage Arguments Details Value Examples

View source: R/getBBAG.R

Description

getBBAG downloads historic sale results data from the BBAG website in xls format.

Usage

1
2
3
getBBAG(url, catalogue = "", auctioneer, country, currency, date,
  csv = FALSE, rds = TRUE, sqlite = FALSE, sale = "",
  filename = "bloodstockSalesData")

Arguments

url

A string containing the universal resource locator for an xls file of historic bloodstock sale results data. Required, no default set.

catalogue

A string containing the universal resource locator for a sale catalogue, usually containing pedigree information in PDF format. Optional, no default set.

auctioneer

A string containing the name of the company conducting the auction sale. Required, no default set.

country

A string containing the abbreviated country code for the location of the sale. e.g. DE. Required, no default set.

currency

A string containing the abbreviated currency code for the currency of sale bids and payments. e.g. EUR. Required, no default set.

date

A string containing the date of the sale. Multi-day sales should only have the first day's date entered. The date should be entered in the format yyyy-mm-dd. Required, no default set.

csv

A Boolean defining the data output format, in this case a CSV file. Required. Defaults to FALSE. May be changed to TRUE. Multiple output formats are possible.

rds

A Boolean defining the data output format, in this case an Rds file. Required. Defaults to TRUE. May be changed to FALSE. Multiple output formats are possible.

sqlite

A Boolean defining the data output format, in this case an SQLite file. Required. Defaults to FALSE. May be changed to TRUE. Multiple output formats are possible. Requires the RSQLite library to be installed, which is only optional for pinhooker package installation. Prior to attempting SQLite output, please ensure the RSQLite package is installed.

sale

A string containing the name of the sale. e.g. Breeding Stock Sale. Required, no default set.

filename

A string containing the output file name, without file extension. Required. Defaults to 'bloodstockSalesData'. Files are output to the current working directory.

Details

getBBAG downloads historic sale results data from the Baden-Badener Auktionsgesellschaft http://bbag-sales.de/ website, in xls format, based on the supplied URL. Various options may be specified such as a filename and output format. Valid output formats are csv, Rds and sqlite. Only an Rds is generated by default. Valid URLs for BBAG sales have been tested as far back as 2009. The demo directory contains a complete set of URLs and function calls to generate results data for all sales back to 2009.

Value

If all parameters are valid, xls data will be downloaded from the BBAG website, normalised and output, as the specified file fomats, in the current working directory.

Examples

1
2
3
4
5
6
7
  getBBAG(url =
  "http://www.bbag-sales.de/en/Catalogues-and-statistics.html?auctionType=Sales%20%26%20Racing%20Festival&auctionYear=2015&page=csvExport",
   catalogue =
  "http://www.bbag-sales.de/download/public/share/public/BBAG/PDF-Dokumente/Kataloge/SuR_Inhalt_2015_LR.pdf",
   csv = FALSE, rds = TRUE, sqlite = FALSE, auctioneer = "BBAG", country =
  "DE", currency = "EUR", date = "2015-10-16", sale = "October Mixed Sales",
  filename = "bbagSaleData")

phillc73/pinhooker documentation built on Feb. 18, 2021, 9:21 p.m.