MyNixOS website logo
Description

A 'Shiny' App for Exploration of Text Collections.

Facilitates dynamic exploration of text collections through an intuitive graphical user interface and the power of regular expressions. The package contains 1) a helper function to convert a data frame to a 'corporaexplorerobject', 2) a 'Shiny' app for fast and flexible exploration of a 'corporaexplorerobject', and 3) a 'Shiny' app for simple retrieval/extraction of documents from a 'corporaexplorerobject' in a reading-friendly format. The package also includes demo apps with which one can explore Jane Austen's novels and the State of the Union Addresses (data from the 'janeaustenr' and 'sotu' packages respectively).

corporaexplorer: An R package for dynamic exploration of text collections

CRANstatus License: GPLv3 R buildstatus DOI Mentioned in AwesomeR

“I really like the application and its simplicity. It looks great and is very functional. … a nice addition to text analysis tools.”
Kenneth Benoit, creator of quanteda, professor of computational social science at LSE

“I really enjoyed interacting with corporaexplorer.This is exciting work that opens up doors for non-technical users.”
Tyler Rinker, creator of sentimentr and qdap

– Featured in RStudio’s “R Views” blog’s “Top 40 New R Packages”

– Included in CRAN Task View: Natural Language Processing



Illustrationscreenshots

What is corporaexplorer?

corporaexplorer is an R package that uses the Shiny graphical user interface framework for dynamic exploration of text collections.

corporaexplorer is designed for use with a wide range of text collections; one example could be a collection of tens of thousands of documents scraped from a governmental website; another example could be the collected works of a novelist; a third example could be the chapters of a single book.

corporaexplorer’s intended primary audience are qualitatively oriented researchers who rely on close reading of textual documents as part of their academic activity, but the package should also be a useful supplement for those doing quantitative textual research and wishing to visit the texts under study. Finally, by offering a convenient way to explore any character vector, it can also be useful for a wide range of other R users.

While collecting and preparing the text collections to be explored requires some familiarity with R programming, using the Shiny apps for exploring and extracting documents from the corpus should be fairly intuitive also for those with no programming knowledge, once the apps have been set up by a collaborator. Thus, the aim is for the package to be useful for anyone with a rudimentary knowledge of R – or with collaborators who have such knowledge.

Installation

To install the released version from CRAN, simply run the following from an R console:

install.packages("corporaexplorer")

Alternatively, to install the development version from GitHub, run the following from an R console:

install.packages("devtools")
devtools::install_github("kgjerde/corporaexplorer")

corporaexplorer works on Mac OS, Windows and Linux. (The Shiny apps look much clunkier on Windows than on the other platforms, but the apps are fully functional.)

Note to developers: The package’s internal test suite uses the shinytest package, which requires that PhantomJS is installed. This can be done through the shinytest::installDependencies() function.

How to cite

Please cite the following paper if you use corporaexplorer in your research.

Gjerde, Kristian Lundby. 2019. “corporaexplorer: An R package for dynamic exploration of text collections.” Journal of Open Source Software 4 (38): 1342. https://doi.org/10.21105/joss.01342.

For a BibTeX entry, use the output from citation(package = "corporaexplorer").

Usage

For usage instructions and example corpora, see the package web page.

Demo apps

The package includes two demo apps.

To explore Jane Austen’s novels (data accessed through the janeaustenr package):

library(corporaexplorer)
run_janeausten_app()

To explore the US presidents’ State of the Union addresses (data accessed through the the sotu package):

library(corporaexplorer)
run_sotu_app()

For more info, see and <https://kgjerde.github.io/corporaexplorer/articles/sotu.html, and also the function references.

A note on platforms and encoding

corporaexplorer works on Mac OS, Windows and Linux, and there are some important differences in how R handles text on the different platforms. If you are working with plain English text, there will most likely be no issues with encoding on any platform. Unfortunately, working with non-ASCII encoded text in R (e.g. non-English characters), can be complicated – in particular on Windows.

On Mac OS or Linux, problems with encoding will likely not arise at all. If problems do arise, they can typically be solved by making the R “locale” unicode-friendly (e.g. Sys.setlocale("LC_ALL", "en_US.UTF-8")). NB! This assumes that the text is UTF-8 encoded, so if changing the locale in this way does not help, make sure that the text is encoded as UTF-8 characters. Alternatively, if you can ascertain the character encoding, set the locale correspondingly.

On Windows, things can be much more complicated. The most important thing is to check carefully that the texts appear as expected in corporaexplorer’s apps, and that the searches function as expected. If there are problems, a good place to start is a blog post with the telling title “Escaping from character encoding hell in R on Windows”.

For (a lot) more information about encoding, see this informative article by David C. Zentgraf.

Contributing

Contributions in the form of feedback, bug reports and code are most welcome. Ways to contribute:

Metadata

Version

0.8.6

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows