text Author page
1 The Fall of the House of Usher Poe 1
2 Poe 2
3 Poe 3
4 Son coeur est un luth suspendu; Poe 4
5 Sitot qu'on le touche il resonne. Poe 5
6 DE BERANGER. Poe 6
text Author page
1 The Fall of the House of Usher Poe 1
2 Poe 2
3 Poe 3
4 Son coeur est un luth suspendu; Poe 4
5 Sitot qu'on le touche il resonne. Poe 5
6 DE BERANGER. Poe 6
text Author page
1 The Adventure of the Red Circle Doyle 1
2 Doyle 2
3 Doyle 3
4 By Doyle 4
5 Doyle 5
6 Sir Arthur Conan Doyle Doyle 6
myfiles=bind_rows(mypoe,mydoyle)head(myfiles)
text Author page
1 The Fall of the House of Usher Poe 1
2 Poe 2
3 Poe 3
4 Son coeur est un luth suspendu; Poe 4
5 Sitot qu'on le touche il resonne. Poe 5
6 DE BERANGER. Poe 6
# A tibble: 6 × 2
word sentiment
<chr> <chr>
1 abacus trust
2 abandon fear
3 abandon negative
4 abandon sadness
5 abandoned anger
6 abandoned fear
table(se$sentiment)
anger anticipation disgust fear joy negative
1245 837 1056 1474 687 3316
positive sadness surprise trust
2308 1187 532 1230
dim(se)
[1] 13872 2
mytext|>inner_join(se)|>group_by(sentiment)|> dplyr::count(word,sentiment,Author,sort =TRUE)|>ungroup()|> dplyr::filter(!sentiment%in%c("positive","negative"))|> dplyr::slice_max(n,n=20)|>mutate(word=reorder(word,n))|>ggplot(aes(sentiment,n))+geom_col(aes(fill=sentiment))+facet_wrap(~sentiment,scale="free_y")+coord_flip()+labs(title ="Emotional word count without +ve & -ve sentiment",subtitle ="Author Wise",caption ="Presented by Saisheel Gopularam")+theme(legend.position ="right")+facet_grid(~Author)
Joining with `by = join_by(word)`
Warning in inner_join(mytext, se): Detected an unexpected many-to-many relationship between `x` and `y`.
ℹ Row 1 of `x` matches multiple rows in `y`.
ℹ Row 13214 of `y` matches multiple rows in `x`.
ℹ If a many-to-many relationship is expected, set `relationship =
"many-to-many"` to silence this warning.
mytext|>inner_join(se)|>group_by(sentiment)|> dplyr::count(word,sentiment,Author,sort =TRUE)|>ungroup()|> dplyr::filter(sentiment%in%c("positive","negative"))|> dplyr::slice_max(n,n=20)|>mutate(word=reorder(word,n))|>ggplot(aes(sentiment,n))+geom_col(aes(fill=sentiment))+facet_wrap(~sentiment,scale="free_y")+coord_flip()+labs(title ="Emotional Word count with only +ve and -ve sentiment",subtitle ="Author Wise",caption ="Presented by Saisheel Gopularam")+theme(legend.position ="right")+facet_grid(~Author)
Joining with `by = join_by(word)`
Warning in inner_join(mytext, se): Detected an unexpected many-to-many relationship between `x` and `y`.
ℹ Row 1 of `x` matches multiple rows in `y`.
ℹ Row 13214 of `y` matches multiple rows in `x`.
ℹ If a many-to-many relationship is expected, set `relationship =
"many-to-many"` to silence this warning.