u/Moosiebwerry

▲ 212 r/UniUK

Failed an exam, failed a module, not graduating this summer

Exactly what it says in the title. Got my academic year turned upside down because I flunked an exam (I not only did not finish in the required time, so I would’ve gotten a low mark anyway, I DOUBLE fucked myself by giving in the wrong assignment document). So I’ve subsequently failed this module. Failing a module doesn’t mean that I’ll fail the year, hallelujah, but it does mean that I’ve dropped the ball on getting a 1st Class. Already in the process of hopefully getting an upcapped resit, but dang. I just didn’t think my entire year would be upended on a random ass Monday morning. Feels bad.

reddit.com
u/Moosiebwerry — 3 days ago
▲ 1 r/rstats

Tried to create a histogram with sentiment scores and it came up empty, how can I fix this?

Good Afternoon, I'm a complete R-Studio newb, I'm doing this for social data science assignment due in two days. Tried to create a sentiment score histogram, and I was following a tutorial document by my module teacher, but my histogram came up empty. I realise it's because the file "doc_sentiment_filtered" came up empty, but I don't know why that happened (I suspect it might be because his tutorial was meant to have two dfm_subsets for another thingy?? but I didn't need that for the purpose of my own investigation, so I just used the original doc.dfm.final file instead)

#convert sentiment scores to data frame and add docvars

doc_sentiment_df1 <- cbind(convert(sentiment_scores1, to = "data.frame"), docvars(doc.dfm.final))

#calculate document lengths

doc_length <- ntoken(doc.dfm.final)

#Harmonise document names across both frames/files

names(doc_length) <- basename(names(doc_length))

#Add document lengths, aligning names

doc_sentiment_df1$doc_length <- doc_length[match(rownames(doc_sentiment_df1), names(doc_length))]

#Filter documents with positive length

doc_sentiment_filtered <- doc_sentiment_df1 %>% filter(doc_length > 0)

#calculate raw and normalised sentiment scores

doc_sentiment_filtered$raw_sentiment_score <- doc_sentiment_filtered$positve - doc_sentiment_filtered$negative

doc_sentiment_filtered$normalized_sentiment_score <- (doc_sentiment_filtered$raw_sentiment_score / doc_sentiment_filtered$doc_length)*100

#Now summary should be meaningful

summary(doc_sentiment_filtered$normalized_sentiment_score)

#Histogram of normalised sentiment scores

ggplot(doc_sentiment_filtered, aes(x = normalized_sentiment_score)) + geom_histogram(binwidth = 1, fill = "skyblue", colour = "black") + labs(title = "Distribution of Normalised Sentiment Scores per 100 Words",

x = "Normalised Sentiment Score", y = "Number of Documents")

reddit.com
u/Moosiebwerry — 3 days ago