Watts-College / cpp-527-spr-2022

https://watts-college.github.io/cpp-527-spr-2022/
0 stars 1 forks source link

Lab 3 Q3 #21

Open mrowland1 opened 2 years ago

mrowland1 commented 2 years ago

Hi Professor @Dselby86, I am struggling with question 3 of the lab. I can't seem to get the clap score per title length, I am only getting it by every individual title (over 6K of them). I also tried the table( ) function but that also was not successful.

x <- tolower(d$title)

word.list <- strsplit(x, " ") title.length <- length(word.list) apply <- sapply(strsplit(x, " "), length) apply df %>% group_by(apply) %>% summarize(clapscore = (sum(d$clap.score))) df