AllanCameron / PDFR

An R package to extract text from pdf.
Other
37 stars 3 forks source link

Add documentation and minor refactoring to allow PDFR to pass `devtools::check()` without errors #4

Open elipousson opened 1 year ago

elipousson commented 1 year ago

Hello @AllanCameron! I really appreciate you creating this package – I'm using it to extract text from some older reports at work and reformat the text into a tabular structure. When I went to look-up the documentation for pdfpage() I realized that exporting the documentation is one of the things that remained incomplete with the package.

I just forked the package and went ahead and made the following changes to get the documentation filled in and get the package to pass devtools::check() without errors. Here are all the changes I made:

If this all looks good, I'm happy to open a pull request.

I also noticed that the size parameter in pdfgraphics() may need to be changed to linewidth to work with the most recent version of ggplot2 (see this post for more information). I can test this out and add it to the same pull request or open a separate issue if you'd like to discuss.

elipousson commented 1 year ago

The package is still kicking back a note and two warnings:

I started addressing the note by replacing class(pdf) == "character" with rlang::is_character() with the assumption that an additional dependency for rlang should be fine if you are already importing ggplot2. I'd also be glad to convert the stop() errors into abort() or (if you're OK with adding a dependency on cli) cli::cli_abort(). Again, happy to handle these in a separate pull request or avoid adding these additional dependencies altogether if you prefer.

AllanCameron commented 1 year ago

Hi Eli

Thanks very much for this. I had rather given up developing this package as you can probably tell. I will have to re familiarise myself with the code base. Please do open a pull request; I'm very happy to have your input

Allan