Learn R Programming

inpdfr package

Purpose of the package

The inpdfr package allows analysing and comparing PDF and/or TXT documents using both classical text mining tools and those from theoretical ecolgy. In the later, words are considered as species and documents as communities, therefore allowing analysis at the community and metacommunity levels.

How to use the package

Gather some PDF and/or TXT files in a folder. Pointing the working directory to this folder, inpdfr package will extract the text and produce a word occurrence data.frame which will be used to analyse and compare documents. An easy way to start is to use the RGtk2 GUI through the loadGUI function (only available on the gitHub version, not on CRAN).

Installation instructions

The package uses XPDF (http://www.foolabs.com/xpdf/download.html) for PDF to text extraction. You need to install XPDF before using inpdfr package. Depending on your operating system, you may need to restart your computer after installing XPDF. If you do not want to use XPDF, you can extract the content of your PDF files with the method of your choice and then store the content in TXT files. The only function making use of XPDF is getPDF which can be substituted with the getTXT function. install.packages("inpdfr")

Overview

The inpdfr package provides three cathegories of functions:

  • functions to extract and process text into a word-occurrence data.frame,
  • functions to analyse the word-occurrence data.frame with standard and ecological tools, and
  • functions to use inpdfr through a GTk2 Graphical User Interface.

Further instructions and a complete example are provided in vignette.

Copy Link

Version

Install

install.packages('inpdfr')

Monthly Downloads

207

Version

0.1.12

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Rebaudo Francois

Last Published

August 24th, 2023

Functions in inpdfr (0.1.12)

getStopWords

Load a list of stopwords.
doCluster

Performs a cluster analysis on the basis of the word-occurrence data.frame.
getSummaryStatsBARPLOT

Perform a barplot with the number of unique words per document
getwordOccuDF

A quick way to obtain the word-occurrence data.frame from a set of documents.
inpdfr

inpdfr: A package to analyse PDF Files Using Ecological Tools.
getMostFreqWord

Returns most frequent words.
truncNumWords

Truncate the word-occurrence data.frame.
getListFiles

List files in a specified directory sorted by extension.
wordOccuDF

Lorem Ipsum word occurrences.
getMostFreqWordCor

Test for correlation between the most frequent words.
preProcTxt

Extract text from txt files and pre-process content.
getPDF

Extract text from PDF files and return a word-occurrence data.frame.
loremIpsum

Lorem Ipsum text.
makeWordcloud

Word cloud based on the word-occurrence data.frame.
getTXT

Extract text from TXT files and return a word-occurrence data.frame.
quitSpaceFromChars

Delete spaces in file names.
getXFreqWord

Returns most frequent words
postProcTxt

Prossess vectors containing words into a data.frame of word occurrences.
mergeWordFreq

Merge word-occurrence data.frames into a single data.frame.
exclusionList_FR

Stop words in French.
getAllAnalysis

A quick way to compute a set of analysis from the word-occurrence data.frame.
IdentifyStructure

Copy of the identifyStructure function from Tad Dallas metacom package.
excludeStopWords

Exclude StopWords form the word-occurrence data.frame.
doMetacomMetacom

Performs a metacomunity analysis.
doMetacomEntropart

Performs an analysis of ecological diversity and structure.
doKmeansClust

Performs a k-means cluster analysis on the basis of the word-occurrence data.frame.
getSummaryStatsOCCUR

Plot a scatter plot with the proportion of documents using similar words.
getSummaryStatsHISTO

Plot an histogram with the number of words excluding stop words
exclusionList_SP

Stop words in Spanish.
exclusionList_UK

Stop words in English.