Skip to content

Commit

Permalink
For pre-summarized data, rename the items column so plot works.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbryer committed Apr 3, 2019
1 parent 5bf9b1e commit 87c5500
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>, Kimberly Speerschneider
<[email protected]>
Date: 2019-03-06
Author: Jason Bryer <[email protected]>
Maintainer: Jason Bryer <[email protected]>
URL: http://jason.bryer.org/likert, http://github.com/jbryer/likert
BugReports: https://github.com/jbryer/likert/issues
Expand Down
3 changes: 2 additions & 1 deletion R/likert.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand All @@ -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.')
}
Expand Down

0 comments on commit 87c5500

Please sign in to comment.