From 87c55000b6c0527096feb85d3e0f6af6e1fc6760 Mon Sep 17 00:00:00 2001 From: Jason Bryer Date: Wed, 3 Apr 2019 09:23:14 -0400 Subject: [PATCH] For pre-summarized data, rename the items column so plot works. --- DESCRIPTION | 5 ++--- R/likert.R | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 266e0b8..eebb41f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,9 +2,8 @@ Package: likert Type: Package Title: Analysis and Visualization Likert Items Version: 1.3.6 -Date: 2017-06-26 -Author: Jason Bryer , Kimberly Speerschneider - +Date: 2019-03-06 +Author: Jason Bryer Maintainer: Jason Bryer URL: http://jason.bryer.org/likert, http://github.com/jbryer/likert BugReports: https://github.com/jbryer/likert/issues diff --git a/R/likert.R b/R/likert.R index 121c955..f98416d 100644 --- a/R/likert.R +++ b/R/likert.R @@ -45,7 +45,7 @@ likert <- function(items, summary, factors=NULL, importance, nlevels=length(levels(items[[1]]))) { - items <- as.data.frame(items) + items <- as.data.frame(items) # Handle tibbles if(!missing(grouping)) { if(sum(is.na(grouping)) > 0) { stop('Grouping variable cannot have any missing values.') @@ -57,6 +57,7 @@ likert <- function(items, summary, } } if(!missing(summary)) { #Pre-summarized data + names(summary)[1] <- 'Items' if(!is.null(grouping) & length(grouping) != nrow(summary)) { stop('The length of grouping must be equal to the number of rows in summary.') }