getTatts: getTatts - Download historic sale results data from...

Description Usage Arguments Details Value Examples

View source: R/getTatts.R

Description

getTatts downloads historic sale results data from the Tattersalls and Tattersalls Ireland websites.

Usage

1
2
3
getTatts(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 a Tattersalls' website page of historic bloodstock sale 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. UK. Required, no default set.

currency

A string containing the abbreviated currency code for the currency of sale bids and payments. e.g. GNS. 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

getTatts downloads historic sale data from the Tattersalls http://tattersalls.com and Tattersalls Ireland http://tattersalls.ie websites, based on the supplied URL. Data is scraped from the sales results tables on the Tattersalls and Tattersalls Ireland websites. Various options may be specified such as a filename and output format. Valid output formats are csv, Rds and sqlite. Only an Rds file is generated by default. Valid URLs for Tattersalls and Tattersalls Ireland 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, data will be downloaded from the Tattersalls website, normalised and output, as the specified file fomats, in the current working directory directory.

Examples

1
2
3
4
5
6
  getTatts(url =
  "http://db.tattersalls.com/4DCGI/Entry/List?30%096%09=%20DEM%2015%09by8",
  catalogue = "http://docs.tattersalls.com/cat/december/2015decmares.pdf",
  csv = FALSE, rds = TRUE, sqlite = FALSE, auctioneer = "Tattersalls",
  country = "UK", currency = "GNS", date = "2015-11-30", sale = "December
  Mares Sale", filename = "tattsSaleData")

phillc73/pinhooker documentation built on May 25, 2019, 5:05 a.m.