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