Can someone please help me find the frequency of words from excel .csv file. I want frequency from each column separately except first column and then want to correlate frequency of words with the first column score (which starts from 7 and ends to 9). Here is how data looks like:
squads <- tibble::tribble(
~`Q4_1__Category-_Liking_attribute`, ~Q8__1___COMMENTS, ~Q8__2___COMMENTS, ~Q8__3___COMMENTS, ~Q8__4___COMMENTS, ~Q8__5___COMMENTS,
7L, "Good flavor", "Off color", "Smooth", "Whipped ok", "Warm",
8L, "Smooth", "Creamy", "Wholesome", "Natural", "Organic",
9L, "Wholesome", "Natural", "Delicious", "Healthy", "Tasty",
9L, "Different", "Wholesome", "Natural", "Tasty", "Organic",
8L, "Plain", "Potatoey", "Tasty", "Natural", "Homemade",
7L, "Good", "Chunky", "Flavorful", "Authentic", "Tasty",
7L, "Thick", "Tasty", "Authentic", "Very potatoey", "Good",
7L, "Purple", "Interesting", "Fun", "Different", "Unusual",
7L, "White", "Hot", "Mashed", "Smooth", "Creamy",
8L, "Colorful", "Bright", "Tasty", "Real potato taste", "Worthy of Sunday dinner",
8L, "Bold", "Flavorful", "Tastes like real potato", "Hot", "Good",
7L, "Hot", "Smooth", "Creamy", "Potatey", "White",
8L, "Colorful", "Interesting", "Creative", "Bold", "Unusual"
)
head(sqauds)
#> Error in head(sqauds): object 'sqauds' not found
Code:
library(tidyverse)
library(tidytext)
library(tm)
#> Loading required package: NLP
#>
#> Attaching package: 'NLP'
#> The following object is masked from 'package:ggplot2':
#>
#> annotate
library(dplyr)
library(qdap)
#> Loading required package: qdapDictionaries
#> Loading required package: qdapRegex
#>
#> Attaching package: 'qdapRegex'
#> The following object is masked from 'package:dplyr':
#>
#> explain
#> The following object is masked from 'package:ggplot2':
#>
#> %+%
#> Loading required package: qdapTools
#>
#> Attaching package: 'qdapTools'
#> The following object is masked from 'package:dplyr':
#>
#> id
#> Loading required package: RColorBrewer
#> Error: package or namespace load failed for 'qdap':
#> .onLoad failed in loadNamespace() for 'rJava', details:
#> call: fun(libname, pkgname)
#> error: JAVA_HOME cannot be determined from the Registry
df <- read.csv("C:/Users/cs/Downloads/review.csv", header=T)
colnames(df)[1] = "score"
colnames(df)[2] = "First_response"
colnames(df)[3] = "Second_response"
colnames(df)[4] = "Third_response"
colnames(df)[5] = "Fourth_response"
colnames(df)[6] = "Fifth_response"
Created on 2022-04-24 by the reprex package (v2.0.1)
Created on 2022-04-24 by the reprex package (v2.0.1)