Here is an example data set:
data <- data.frame (author = c('bob', 'john', 'james'),
year = c(2000, 1942, 1765),
title = c('test title one two three',
'another test title four five',
'third example title'))
And I would like to automate the process of making bibtex references, e.g. with a function like this:
bibtexify <- function (author, year, title) {
acronym <- convert.to.acronym(title)
paste(author, year, acronym, sep='')
}
so that I get the following result:
with(data, bibtexify(author, year, title))
[1] 'bob2000tto'
[2] 'john1942att'
[3] 'james1765tet'
Is it possible to do this in R?
you want abbreviate
R> abbreviate('test title one two three')
test title one two three
"ttott"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With