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")
(character) Full path to EML file
(character) Where outputs will be written
(character) File type for abstract, methods, and additional info. Can be: ".txt", ".docx", or ".md". Default is ".txt".
EAL templates and make_eml()
function call
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.
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)
}