I'm trying to use the following code, which is supossed to order the pages of a pdf:
ordenar <- function(archivo) {
library(pdftools)
nombre <- sapply(strsplit(sapply(strsplit(pdftools::pdf_text(archivo),
"Nombre: +"), `[`, 2), "\r"), `[`, 1)
nombre <- as.character(nombre)
OBRA <- sapply(strsplit(sapply(strsplit(pdftools::pdf_text(archivo),"Depto\\.: +"), `[`, 2), "\r"), `[`, 1)
OBRA <- as.character(OBRA)
OBRA <- substr(OBRA,1,5)
OBRA <- as.data.frame(OBRA)
combine_n <- cbind(OBRA,nombre)
pagina <- time(nombre)
combine_n <- cbind(combine_n,pagina)
orden<- with(combine_n, combine_n[order(OBRA, nombre) , ])
ordenado <- as.vector(orden$pagina)
pdf_subset(archivo, pages = ordenado, output = "compilado_a-z.pdf")
}
The code works fine on other computers but in the one I'm currently at I get this error:
Error in cpp_pdf_select(input, output, pages, password) :
open C:\Users\HP\Documents\prueba\compilado_a-z.pdf: Permission denied
I have ran parts of the code and it is able to extract data from the pdf, the problem occurs when it tries to create a new pdf, I have also tried to export a dataframe to excel and I get the same error. This is a work computer, should I call IT or is it an internal problem?