From 730c500f9106027c6448173d1ee59646d98f645d Mon Sep 17 00:00:00 2001 From: alex-vand Date: Tue, 17 Sep 2024 11:16:30 +0200 Subject: [PATCH] Updates for clean var labels - Code modified and moved from Quarto index file to fetch.R script. --- index.qmd | 14 +------------- scripts/fetch.R | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/index.qmd b/index.qmd index c80a0ea..589db5b 100644 --- a/index.qmd +++ b/index.qmd @@ -20,19 +20,7 @@ For a human-curated list of health economics R packages, please visit the [getst This project was started as part of a R-HTA Hackathon held at the University of Belfast on 5th and 6th August 2024. ```{r} -dat <- read.csv("data/data.csv") -#PLACEHOLDER - WILL MOVE TO PROCESSING SCRIPTS -names(dat) <- c("Package", - "Title", - "Description", - "License", - "Authors", - "Maintainer", - "Date published (CRAN)", - "Has tests?", - "Has Vingettes?", - "# contributors", - "On CRAN?") +dat <- read.csv("data/data.csv", check.names = FALSE) DT::datatable(dat, options = list( scrollX = TRUE, diff --git a/scripts/fetch.R b/scripts/fetch.R index 91cae21..9c74c2a 100755 --- a/scripts/fetch.R +++ b/scripts/fetch.R @@ -19,5 +19,19 @@ all_names <- unique(unlist(lapply(package_metadata, names))) filled_list <- lapply(package_metadata, fill_na, all_names = all_names) # Create combined data frame of package metadata. df <- dplyr::bind_rows(lapply(filled_list, as.data.frame)) +# Clean variable labels +var_names <- c("Package", + "Title", + "Description", + "License", + "Authors", + "Maintainer", + "Date published (CRAN)", + "Has tests?", + "Has Vingettes?", + "# Contributors", + "# Repo stars", + "On CRAN?") +names(df) <- var_names # Write combined data frame to file as csv. write.csv(df, "data/data.csv", row.names = FALSE) \ No newline at end of file