define_field.Rd
This function defines the field of study at level 0 in MAG of records
in tbl
. To do so, it queries tables in the database that store the
field of study of the person. See the details for more information.
define_field(tbl, conn, from, ...)
A query from conn
with dbplyr and lazily evaluated.
An object of class SQLiteConnection
to a sqlite database.
A string with options to be queried: "mag_authors" or "graduates".
Additional arguments to be passed to
make_tbl_output
.
If not specified, a lazily evaluated table without limit is returned.
Partially specified arguments are completed with
dots_tbl_output
.
tbl
augmented by a column with the name of the field of study at
level 0 as defined by MAG.
from
= "graduates"The field is defined with a custom mapping between the reported field of
study in ProQuest and the fields in MAG. The mapping is stored in the
database.
A record can have multiple fields, and currently the function returns the
first reported. A missing fieldname0_mag
indicates that it is not possible
to map the field at position 0 in ProQuest to the MAG fields.
In future, this may be made more flexible to consider any of the reported
fields in ProQuest.