Questions tagged [qdap]

qdap (Quantitative Discourse Analysis Package) is an R package designed to assist in quantitative discourse analysis. The package stands as a bridge between qualitative transcripts of dialogue and statistical analysis & visualization.

110 questions
3
votes
1 answer

Using mgsub function with word boundaries for replacement values

I am trying to replace substrings of string elements within a vector with blank spaces. Below are the vectors we are considering: test <- c("PALMA DE MALLORCA", "THE RICH AND THE POOR", "A CAMEL IN THE DESERT", "SANTANDER SL", "LA") lista <-…
MN Beitelmal
  • 165
  • 8
3
votes
0 answers

How to integrate ngrams function with freq_terms in qdap package?

I like the qdap freq_terms functions. It's very straightforward and does exactly what I need, at least most of the time. However, there are occasions where the freq_terms function isn't sufficient enough. For a text analysis I need instead of a term…
rdatasculptor
  • 8,112
  • 14
  • 56
  • 81
3
votes
2 answers

replace string in R giving a vector of patterns and vector of replacements

Given a string with different placeholders I want to replace, does R have a function that replace all of them given a vector of patterns and a vector of replacements? I have managed to accomplish that with a list and a loop > library(stringr) >…
Pablo Marin-Garcia
  • 4,151
  • 2
  • 32
  • 50
3
votes
1 answer

qdap ngram polarity dictionary

Dear Stackoverlow crowd I managed to use the qdap polarity function to calculate the polarity of some blog entries, loading my own dictionary, based on sentiWS. Now I do have a new sentiment dictionary (SePL) which not only contains single words,…
Benasso
  • 123
  • 5
2
votes
1 answer

combining words in tm R is not achieving desired result

I am trying to combine a few words so that they count as one. In this example I want val and valuatin to be counted as valuation. The code I have been using to try and do this is below: #load in package library(tm) replaceWords <- function(x, from,…
user11015000
  • 151
  • 1
  • 15
2
votes
4 answers

Extract values based on last n characters

I have a vector like below: vector jdjss-jdhs--abc-bec-ndj kdjska-kvjd-jfj-nej-ndjk eknd-nend-neekd-nemd-nemdkd-nedke How do I extract the last 3 values so that my result looks like below based on a - delimitor: vector …
nak5120
  • 4,089
  • 4
  • 35
  • 94
2
votes
1 answer

Error in library(qdap) : there is no package called ‘qdap’

I've installed qdap: install.packages("qdap") It takes a while to donwload everything but the console fills up with all the downloads and at the end I get a message like this: Warning in install.packages : installation of package ‘qdap’ had…
Doug Fir
  • 19,971
  • 47
  • 169
  • 299
2
votes
1 answer

subset/filter based on a frequency table

I have a df with some text data e.g. words <- data.frame(terms = c("qhick brown fox", "tom dick harry", "cats dgs", "qhick black fox")) I'm already able to…
Doug Fir
  • 19,971
  • 47
  • 169
  • 299
2
votes
0 answers

load failed for ‘qdap’ on Mac Sierra in Rstudio

I'm trying to run app in Rstudio using "shiny" package, but I get this the error quoted below. I read the posts here, so I guess there must be a problem with rJava? I have downloaded the rJava package in Rstudio. The version of java on my Mac is…
2
votes
0 answers

Installing qdap package in R

I have been trying to install qdap in R (note I am using R version 3.3.1). I have been trying a couple of times and the installation freezes all the time. Do you know if there is anything i can do? I want to use the qdap package for some spell…
A.Cedar
  • 21
  • 2
2
votes
1 answer

Fill columns with NA for shorter strings when splitting to columns

Suppose I have a dataframe with a column that looks like this: E <- data.frame( c("a brown fox"), c("something"), c("else") ) E <- as.data.frame(t(E)) V1 c..a.brown.fox.. a brown fox c..something.. …
Hack-R
  • 22,422
  • 14
  • 75
  • 131
2
votes
2 answers

Counting words in text (in R): Results unreadable

I'm counting words in a given text using R libraries tm and qdap. When my vector (words) has only a few words, everything looks fine: library(tm) library(qdap) text <- "activat affect affected affecting affects aggravat allow attribut based basis bc…
2
votes
0 answers

r tm determine polarity of documents parallel using foreach

I am new to the r tm coding world and I am trying to process a large textual data frame parallel while using a foreach %dopar% loop (as I found out that this is way quicker). However, I do not really understand how that works respectively how I can…
C. G.
  • 53
  • 7
2
votes
1 answer

Get all.polarity value from qdap package results in R

I wanted to do sentimental analysis in R using qdap package. It gives out a data frame containing all.all, all.wc, all.polarity, all.pos.words, all.neg.words etc. I want to extract the values of all.polarity, all.pos.words,all.neg.words but when i…
Bitanshu Das
  • 627
  • 2
  • 8
  • 21
2
votes
1 answer

agrep string matching in R

I have two list of some product names. My problem is "Operating system" is matching with "system", "cooling system",etc. But it has to match only with "Operating","OS". Another example is "Key Board" should be matched with "key" or "KB" but not with…
Kavipriya
  • 441
  • 4
  • 17