From 7fa616af7b97cf3ae1875d12322c40b56649236d Mon Sep 17 00:00:00 2001 From: Miha Date: Tue, 19 Oct 2021 19:54:30 +0200 Subject: [PATCH] =?UTF-8?q?Popravek=20R=20kode,=20ki=20generira=20NIJZ=20p?= =?UTF-8?q?oro=C4=8Dilo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/survey/modules/mod_NIJZ/R/Nijz_report.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/admin/survey/modules/mod_NIJZ/R/Nijz_report.R b/admin/survey/modules/mod_NIJZ/R/Nijz_report.R index 1526be99a..f87f97c5f 100644 --- a/admin/survey/modules/mod_NIJZ/R/Nijz_report.R +++ b/admin/survey/modules/mod_NIJZ/R/Nijz_report.R @@ -107,6 +107,8 @@ data <- read.csv2(paste0( # Remove missing values data <- as.data.frame(data) +colnames(data)[1] <- "V1" +colnames(data)[2] <- "V2" #--------------------------- // READ DATA // ------------------------# @@ -121,16 +123,17 @@ CairoPNG('modules/mod_NIJZ/results/img/radar.png', width = 900, height = 700) # # height = 8.5 # ) # Create rang which will be labeld in grapf (10 likert scale) -myrange <- c(0, 7) +steviloVrstic <- nrow(data) - 5 +myrange <- c(0, steviloVrstic) # create a data frame with the max and min as the first two rows mydf <- - as.data.frame(rbind(max = myrange[2], min = myrange[1], as.numeric(data[1:7,]$V2)), + as.data.frame(rbind(max = myrange[2], min = myrange[1], as.numeric(data[1:steviloVrstic,]$V2)), stringsAsFactors = FALSE) # Add names which will be displayed as labels in # chart and also their means in parentheses -labels <- gsub('(.{1,20})(\\s|$)', '\\1\n', data[1:7,]$V1) +labels <- gsub('(.{1,20})(\\s|$)', '\\1\n', data[1:steviloVrstic,]$V1) colnames(mydf) <- labels # Deljenje besed zaradi preglednosti