Skip to content

Commit 91ed1cf

Browse files
authored
fixing paths and flow
1 parent dd5ef55 commit 91ed1cf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/workshop_package/scripts_sentiment_analysis_ak.qmd

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Sentiment and Emotion Analysis of Comments"
33
editor: visual
44
---
55

6-
## Setup: Installing and Loading Packages
6+
## Setup: Installing & Loading Packages & Data
77

88
```{r}
99
# Install all required packages
@@ -29,12 +29,14 @@ library(RColorBrewer)
2929
library(stringr)
3030
```
3131

32-
### Polarity Analysis
33-
3432
```{r}
3533
# Load Data
36-
comments <- readr::read_csv("./data/comments_preprocessed.csv")
34+
comments <- readr::read_csv("./data/clean/comments_preprocessed.csv")
35+
```
3736

37+
### Polarity Analysis
38+
39+
```{r}
3840
# Compute sentiment per row/case
3941
sentiment_scores <- sentiment_by(comments$comments)
4042
@@ -80,6 +82,7 @@ ggplot(polarity_seasons, aes(x = score, fill = season)) +
8082
scale_fill_brewer(palette = "Set1")
8183
8284
# Save results
85+
dir.create("output", recursive = TRUE, showWarnings = FALSE) #create dir
8386
write_csv(polarity, "output/polarity_results.csv")
8487
```
8588

0 commit comments

Comments
 (0)