# Path to the sample template included in the package
template_path <- system.file("template_document", "Template.docx", package="docket")
# Create a dictionary by using the getDictionary function on the sample template file
result <- getDictionary(template_path)
# Insert data into the template dictionary
result[1,2] <- Sys.getenv("USERNAME") #Author name
result[2,2] <- as.character(Sys.Date()) # Date report created
result[3,2] <- 123
result[4,2] <- 456
result[5,2] <- 789
result[6,2] <- sum(as.numeric(result[3:5,2]))
# Verify that the result dictionary is valid
if (checkDictionary(result) == TRUE) {
print("Valid Dictionary")
}
Run the code above in your browser using DataLab