Opitools v1.8.0: An R-package for analyzing Opinions in a Text Document
Package Website
Click here to explore the website dedicated to the package. Below, I provide a short description of the key functions of the package.
Statement of Need
The recent advent of social media systems, such as the Twitter and Facebook, has heralded not only enormous data opportunities, but also new advances in the opinion mining of natural language texts (Liu, 2012; Tsapatsoulis & Djouvas, 2019). However, in spite of the availability of wide variety of text-based opinion mining tools (Kiomourtzis et al. 2014; Sheng et al. 2015; Wawer 2016; Munson et al. 2019), there has been a lack of capability for analysing cross-impact of opinions between multiple subjects within a text document, using any of these tools. For instance, given a collection of tweets on a specific subject A, a researcher may find it difficult to assess the impact of a secondary subject B on the opinion concerning subject A. The new opitools
package is designed in R language to address this limitation in the opinion mining of social media data. We demonstrated the utility of opitools
in Adepeju & Jimoh (2021), in which we examined the impacts of COVID-19 pandemic (subject B) on public opinion concerning policing (subject A). Lastly, we argue that opitools
may serve as a great asset to many public organisations for unravelling important issues that may be driving confidence and trust in relation to their services.
Key functionalities of Opitools
The main functionality of the ‘opitools’ package can be accessed through the ‘opi_impact’ function, which draws from two other functions, ‘opi-score’ and ‘opi_sim’, for computing the observed opinion score and simulating the expectation distribution, respectively. The outputs of the function includes a graphical plot (if enabled) showing the proportion of opinion classes, and summary statistics describing the impacts of subject B on the opinion concerning subject A. Furthermore, with the understanding that the definition of opinion score function may vary across different application domains, a ‘fun’ argument is added to the ‘opi_impact’ function, in order to allow a user-defined function of opinion score. The R user manual and the vignette demonstrating the utility of opitools for law enforcement application can be downloaded from here.