Description Usage Arguments Details Examples
Let's get this done.
1 |
elem |
Something |
language |
Another thing |
id |
Something else |
I hope this works
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
structure(function (elem, language, id)
{
function(elem, language, id) {
author <- gsub("Author:", "", grep("^Author:", elem$content,
value = TRUE))
title <- gsub("Title:", "", grep("^Title:", elem$content,
value = TRUE))
section <- gsub("Section: ", "", grep("^Section: ", elem$content,
value = TRUE))
datetimestamp <- strptime(gsub("Publication date: ",
"", grep("^Publication date:", elem$content, value = TRUE)),
format = "%b %d, %Y")
origin <- gsub("Publication title:", "", grep("^Publication title:",
elem$content, value = TRUE))
id <- as.numeric(gsub("ProQuest document ID: ", "", grep("^^ProQuest document ID:",
elem$content, value = TRUE)))
content <- elem$content[grep("^Full [Tt]ext:", elem$content):grep("^Title",
elem$content) - 1]
doc <- PlainTextDocument(x = gsub("Full Text: |Full text: ",
"", content), author = author, heading = title, id = id,
datetimestamp = datetimestamp, origin = origin)
meta(doc, "Length") <- sum(sapply(gregexpr("\W+", doc),
length) + 1)
meta(doc, "Section") <- section
doc
}
}, class = c("FunctionGenerator", "function"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.