24_deb_pkg_gov/R/documentReadabilityAnalysis.R

17 lines
745 B
R

library(tidyverse)
library(plyr)
# script for the analysis of document readability metrics
# readability metrics will be studied controlled by their length
# gaughan@u.northwestern.edu
# loading in the data
try(setwd(dirname(rstudioapi::getActiveDocumentContext()$path)))
readme_df <- read_csv("../text_analysis/draft_readability_readme.csv")
contributing_df <- read_csv("../text_analysis/draft_readability_contributing.csv")
head(readme_df)
aggregate(readme_df[, 3:10], list(readme_df$subdir), mean)
#readme_df <- readme_df |>
# mutate(coef_grouping <- as.factor(subdir))
#test_lm <- lm(mcalpine_eflaw ~ word_count + as.factor(subdir),data=readme_df)
#summary(test_lm)
aggregate(contributing_df[, 3:10], list(contributing_df$subdir), mean)