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 (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

215

Version

0.1.8

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Rebaudo Francois

Last Published

October 24th, 2018

Functions in inpdfr (0.1.8)

doKmeansClust

Performs a k-means cluster 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.
IdentifyStructure

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

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

Delete spaces in file names.
getSummaryStatsOCCUR

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

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

Truncate the word-occurrence data.frame.
getSummaryStatsBARPLOT

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

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

Stop words in Spanish.
exclusionList_UK

Stop words in English.
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.
postProcTxt

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

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

Performs an analysis of ecological diversity and structure.
doMetacomMetacom

Performs a metacomunity analysis.
getXFreqWord

Returns most frequent words
getwordOccuDF

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

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

Merge word-occurrence data.frames into a single data.frame.
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.
inpdfr

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

Lorem Ipsum text.
doCluster

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