Learn R Programming

⚠️There's a newer version (0.1.12) of this package.Take me there.

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.

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

215

Version

0.1.5

License

GPL-2

Maintainer

Rebaudo Francois

Last Published

February 27th, 2017

Functions in inpdfr (0.1.5)

excludeStopWords

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

Stop words in French.
getMostFreqWord

Returns most frequent words.
getMostFreqWordCor

Test for correlation between the most frequent words.
IdentifyStructure

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

Stop words in Spanish.
askQuit

RGtk2 GUI function: ask confirmation to quit if topright button is used to quit.
exclusionList_UK

Stop words in English.
doCluster

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

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

List files in a specified directory sorted by extension.
doKmeansClust

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

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

RGtk2 GUI function: check data validity in entries.
getSummaryStatsHISTO

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

Performs a correspondance analysis on the basis of the word-occurrence data.frame.
getPDF

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

Load a list of stopwords.
doMetacomEntropart

Performs an analysis of ecological diversity and structure.
getSummaryStatsOCCUR

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

Performs a metacomunity analysis.
getTXT

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

Lorem Ipsum text.
open_cbFile

RGtk2 GUI function: open a window in order to choose an R data file (rda, RDA, RData).
makeMainWindowsContent

RGtk2 GUI function: dynamic content of main window.
postProcTxt

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

Truncate the word-occurrence data.frame.
inpdfr

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

Returns most frequent words
loadGUI

RGtk2 GUI function: Load the Graphical user Interface
getwordOccuDF

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

RGtk2 GUI function: switch off the "Processing..." message.
mergeWordFreq

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

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

RGtk2 GUI function: open a window in order to choose the working directory.
quitSpaceFromChars

Delete spaces in file names.
makeMenuMainWindow

RGtk2 GUI function: main window.
switchOnDialogWait

RGtk2 GUI function: switch on the "Processing..." message.
makeWordcloud

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