Esawi
October 5, 2018, 3:27pm
1
Hi All--
I have a simple code to extant tables from PDF files using R-Tabulizer package. My code is below. I had the same problem with my home computer where i deleted the folder and recreated it and the problem was solved.
I tried the same code on my office computers but i kept getting the same error again. i deleted and recreated the folder but did not work. All my computers run the same software.
here is my code and the error message.
Any help is greatly appreciated.
EK.
++++++++++ code +++++++
install.packages("tabulizer")
installed.packages("stringr")
library(stringi)
library(tabulizer)
path = "C:/Users/eesawi/Downloads/MyFiles"
file.names <- dir(path, pattern =".PDF")
for(i in 1:length(file.names)){
print(file.names[i])
A[[i]] <- extract_tables(file.names[i])
}
[1] "August 23.PDF"
Error in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="August 23.PDF": The system cannot find the file specified
Perhaps the issue is that dir
returns local paths instead of full path names?
Try adding full.names = TRUE
like so:
file_names <- dir(path, pattern = ".PDF", full.names = TRUE)
mara
October 6, 2018, 1:51pm
4
If your question's been answered (even if by you), would you mind choosing a solution? (See FAQ below for how).
Having questions checked as resolved makes it a bit easier to navigate the site visually and see which threads still need help.
If your question has been answered, don't forget to mark the solution!
How do I mark a solution?
Find the reply you want to mark as the solution and look for the row of small gray icons at the bottom of that reply. Click the one that looks like a box with a checkmark in it:
[image]
Hovering over the mark solution button shows the label, "Select if this reply solves the problem". If you don't see the mark solution button, try clicking the three dots button ( ••• ) to expand the full set of options.
When a solution is chosen, the icon turns green and the hover label changes to: "Unselect if this reply no longer solves the problem". Success!
[solution_reply_author]
…
Thanks