From b48a6841856764465b34c5831dc5bbecfab04bff Mon Sep 17 00:00:00 2001 From: mjgaughan Date: Mon, 10 Jun 2024 17:05:31 -0400 Subject: [PATCH] adding new aggregate analysis for doc readability --- R/documentReadabilityAnalysis.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 R/documentReadabilityAnalysis.R diff --git a/R/documentReadabilityAnalysis.R b/R/documentReadabilityAnalysis.R new file mode 100644 index 0000000..2cec261 --- /dev/null +++ b/R/documentReadabilityAnalysis.R @@ -0,0 +1,16 @@ +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)