For when you want to work with EML in EAL but don't have the templates and make_eml() function call.

eml2eal(eml, path, file.type = ".txt")

Arguments

eml

(character) Full path to EML file

path

(character) Where outputs will be written

file.type

(character) File type for abstract, methods, and additional info. Can be: ".txt", ".docx", or ".md". Default is ".txt".

Value

EAL templates and make_eml() function call

Details

Each sub-process within this function maps EML to an EAL file based on XPaths and logic representing known communities of practice. Information losses are sent as warnings. Remember, EAL focuses on metadata facilitating reuse (e.g. creator's email address), not antiquated info (e.g. creator's telephone number).

Benefits of file.type differ. ".docx" supports basic formatting (super/sub scripts, italics, symbols, accented characters) but doesn't support bulleted lists and elaborately formatted equations. ".md" supports less formatting than ".docx" but is open source. ".txt" doesn't support any formatting but is a common file type.

Examples

if (FALSE) {
# Create working directory
mydir <- paste0(tempdir(), "/pkg")
dir.create(mydir)

# Translate EML, w/unsupported content, to EAL templates. Note info loss 
# warnings.
eml <- system.file("eml2eal_test.xml", package = "EMLassemblyline")
eml2eal(eml, mydir)
dir(mydir)

# Clean up
unlink(mydir, recursive = TRUE)
}