0

Having an option like this:

D <- readFiles("file (1).bib","file (2).bib","file (3).bib")

How is it possible to have a simple read for all. Something like this:

D <- readFiles("file (",1:3").bib")
Elr Mant
  • 477
  • 4
  • 12

1 Answers1

1

readFiles from the bibliometrix package is actually just a wrapper for readLines. But the way it is written does not play nicely with lapply, which makes it difficult to pass character objects with file names.

I would therefore simply stick with readLines:

library("bibliometrix")
files <- list.files(path = "path/to/your/bibfiles",
                    pattern = ".bib$",
                    recursive = TRUE,
                    full.names = TRUE)
D <- unlist(lapply(files, readLines, encoding = "UTF-8"))
JBGruber
  • 10,045
  • 1
  • 19
  • 41