Set methods

The methods tree in the EML section has many different options, visible in the schema. You can create new elements in the methods tree by following the schema and using the eml helpers.

Another simple and potentially useful way to add methods to an EML that has no methods at all is by adding them via a MS Word document. An example is shown below:

methods1 <- set_methods('methods_doc.docx')
doc$dataset$methods <- methods1

If you want to make minor changes to existing methods information that has a lot of nested elements, your best bet may be to edit the EML manually in a text editor (or in RStudio), otherwise there is a risk of accidentally overwriting nested elements with blank object classes, therefore losing methods information.

Adding sampling info to methods section

# add method steps as new variables
step1 <- eml$methodStep(description = "text describing the methods used")

stEx <- eml$studyExtent(description = "study extent description")

samp <- eml$sampling(studyExtent = stEx,
                     samplingDescription = "sampling description text")


# combine all methods steps and sampling info 
methods1 <- eml$methods(methodStep = step1, 
                        sampling = samp)

doc$dataset$methods <- methods1