tcpSearch: Search the TCP index

Description Usage Arguments How to use it Examples

View source: R/tcpSearch.R

Description

Performs basic keyword searching in the Text Creation Partnership index.

Usage

1
tcpSearch(term = NULL, range = NULL, field, free = TRUE, write = FALSE)

Arguments

term

A character string (i.e., the search term).

range

A numeric vector representing the desired date range, usually provided in the form 1600:1610. For a single year, just enter the year number.

field

A character string (i.e., the search field). Must be identical to the name of a column in the TCP index. Valid field names include "TCP","EEBO","VID","STC","Status","Author","Date","Title", "Terms",and "Pages" (case-sensitive).

free

A logical value. If TRUE, will limit results to freely available texts. To see "Restricted" items, set this argument to FALSE.

write

A logical value. If TRUE, will write the results to a .csv file, called "index.csv" in your working directory. BE CAREFUL WHEN USING, because it will over-write any existing "index.csv" file.

How to use it

The most common situation for using tcpSearch is when you want to find and download content from Text Creation Partnership. In this case, follow these steps.

  1. Create a folder where you'll store your XML files.

  2. Play with tcpSearch until you find results that look useful to you.

  3. Enter the command: results = tcpSearch(YOUR SEARCH, write = T). This generates a 'results' object and writes it to .csv as "index.csv."

  4. Enter the command: tcpDownload(results). This will download the selected files.

Examples

1
2
3
4
5
6
tcpSearch(term = "Robinson Crusoe", field = "Title")
tcpSearch(term = "Defoe", field = "Author") # search by author
tcpSearch(term = "Travel", field = "Terms") # search by subject terms
tcpSearch(range = 1700:1735, field = "Date") # search by date
results = tcpSearch(term = "Defoe", field = "Author") # creates a 'results' data frame in R
tcpSearch(term = "Robinson Crusoe", field = "Title", write = TRUE) # writes an index to .csv

michaelgavin/tei2r documentation built on May 22, 2019, 9:50 p.m.