Reads a .csv
file or R dataframe of letter recipients, processes the column names for write.murl
, checks whether United States ZIP codes conform to standard formats, and reports potential problems to the user.
read.murl(file = "murljobs.csv", header = TRUE, stringsAsFactors =
FALSE, field.title = "title", field.fname = "fname", field.lname =
"lname", fields.address = "address", field.city = "city",
field.state = "state", field.zip = "zipcode", field.position =
"position", field.subfield = "subfield", field.dept = "dept",
field.institution = "institution", field.instShort = "instShort",
colClasses = c("character"), ...)
An R dataframe containing the relevant information for creating a set of standardized but customizable letters to be mailed.
the name of a .csv
file or R dataframe.
a logical for whether the first row of the input file or dataframe is a header row.
a logical for whether character strings should be stored as factors with levels.
a character string giving the name of the column containing recipients' titles (such as ``Doctor", ``Mrs.", etc.).
a character string giving the name of the column containing recipients' first names.
a character string giving the name of the column containing recipients' last names.
a character string common to the name(s) of the column(s) containing recipients' street mailing address information. Each column will be printed as its own row in the mailing address. See Details below for more.
a character string giving the name of the column containing recipients' cities.
a character string giving the name of the column containing recipients' states or provinces.
a character string giving the name of the column containing recipients' United States ZIP or other postal codes.
a character string giving the name of the column containing recipient-specific information, such as the specific position for which one is applying.
a character string giving the name of the column containing recipient-specific information, such as the specific subfield for which one is applying.
a character string giving the name of the column containing additional information, such as the specific department offering the position for which one is applying.
a character string giving the name of the column containing additional information, such as the institution offering the position for which one is applying.
a character string giving the name of the column containing the shortened version of the name of the institution. Optionally used in the closing.
a vector of character strings indicating the class of each column. Using c(``character'')
ensures leading zeros in, for example, ZIP codes will be preserved.
other arguments to pass to read.csv()
if the input file is a .csv file.
Ryan T. Moore rtm@american.edu and Andrew Reeves reeves@wustl.edu
Recipients' addresses are formatted for mailing as follows. The first row contains the contents of the fields defined by field.title
, field.fname
, and field.lname
. Each of the fields defined by fields.address
is formatted as a unique row. The last row contains the contents of the fields defined by field.city
, field.state
, and field.zip
.
fields.address
specifies the string common to the names of the columns containing the recipients' street addresses. For example, if the user's file has the street address in columns named addr1
, addr2
, ...
, then the user should set fields.address = "addr"
.
If the input file is an R dataframe, then the argument ...
is ignored.
write.murl
, zip.plot
## Specify path to .csv database of sample addresses
fpath <- system.file("extdata", "murljobs.csv", package = "muRL")
murljobs <- read.murl(fpath)
Run the code above in your browser using DataLab