データセットの例を次に示します。
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'))
そして、たとえば次のような関数を使用して、bibtex 参照を作成するプロセスを自動化したいと思います。
bibtexify <- function (author, year, title) {
acronym <- convert.to.acronym(title)
paste(author, year, acronym, sep='')
}
次の結果が得られるようにします。
with(data, bibtexify(author, year, title))
[1] 'bob2000tto'
[2] 'john1942att'
[3] 'james1765tet'
Rでこれを行うことは可能ですか?