Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upkeep #139

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ cran-comments.md
tests/*
.travis.yml
build.R
^likert\.Rproj$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
50 changes: 50 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.Rproj.user
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: likert
Type: Package
Title: Analysis and Visualization Likert Items
Version: 2.0.0
Version: 2.0.0.9000
Date: 2022-05-03
Authors@R: c(
person("Jason", "Bryer", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-2454-0402")),
person("Kim", "Speerschneider", , "[email protected]", role = "ctb")
)
Maintainer: Jason Bryer <[email protected]>
URL: http://jason.bryer.org/likert, http://github.com/jbryer/likert
URL: https://jbryer.github.io/likert/, https://github.com/jbryer/likert
BugReports: https://github.com/jbryer/likert/issues
Description: An approach to analyzing Likert response items, with an emphasis on visualizations.
The stacked bar plot is the preferred method for presenting Likert results. Tabular results
Expand All @@ -20,7 +20,7 @@ License: GPL
LazyLoad: yes
VignetteBuilder: knitr
Depends:
R (>= 3.0), ggplot2 (>= 2.2.0)
R (>= 3.0), ggplot2 (>= 3.4.0)
Imports:
psych,
reshape2,
Expand All @@ -31,11 +31,12 @@ Imports:
colourpicker,
shiny
Suggests:
devtools,
remotes,
knitr,
rmarkdown,
testthat (>= 3.0.0),
vdiffr
RoxygenNote: 7.2.1
RoxygenNote: 7.3.1
Encoding: UTF-8
LazyData: true
Config/testthat/edition: 3
46 changes: 24 additions & 22 deletions NEWS → NEWS.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,61 +1,63 @@
likert 2.0
=========
# likert (development)

* fixes for compatibility with ggplot2 (>= 3.4.0)

# likert 2.0

* Many fixed to be compatible with the latest version of ggplot2.
* Added digits parameter to plot for heatmaps.
* Now check to ensure grouping variable does not have any missing values.
* Print a warning if any variables are not factors.
* New Shiny app that allows for interactively manipulate Likert options.

likert 1.3.6
=========
# likert 1.3.6


* Fixed a bug where the labels were placed on the wrong side.
* Now require ggplot2 versions greater than 2.2.0.

likert 1.3.5
=========
# likert 1.3.5

* Fixed a bug where stacked bars were in the wrong order in grouped plots.
* Plotting options are now passed as a list. The likert.options returns the default set of plotting options.

likert 1.3.4
=========
# likert 1.3.4


* Fixed a bug where the neutral labels would be printed twice when there were an odd number of levels and plot.percents = TRUE.
* Fixed a bug where the results for a grouped analysis with missing levels may not be correct in the print function.

likert 1.3.3
=========
# likert 1.3.3


* Update for ggplot2 version 2.0

likert 1.3.2
=========
# likert 1.3.2


* Removed all use of the reshape package.
* Fixes issue 40 where the histogram bars may not match the likert bars.

likert 1.3.1
=========
# likert 1.3.1


* Fix to work with the latest version of the xtable package.

likert 1.3.0
=========
# likert 1.3.0


* Added ability to group items by factor.
* Converted all uses of reshape to reshape2.
* Other fixes to pass R CMD CHECK.

likert 1.2.1
=========
# likert 1.2.1


* Added colors parameter to plot.likert.bar to define custom colors for levels.
* Fixed bug where an unused factor level would not appear in the legend.

likert 1.2
=========
# likert 1.2


* Added initial support for conducting gap analysis. A demo, GapAnalysis has
also been added.
Expand All @@ -71,8 +73,8 @@ likert 1.2
* Fixed a bug where plot.likert(..., include.histogram=TRUE) would not work with a group and only one item (i.e. one column).
* Updates for newer version of R and Roxygen.

likert 1.1
=========
# likert 1.1


Released September 25, 2013.

Expand Down
48 changes: 14 additions & 34 deletions R/likert-package.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#' Likert Analysis and Visualization
#'
#' @name likert-package
#' @docType package
#' @title Likert Analysis and Visualization
#' @author \email{jason@@bryer.org}
#' @keywords package institutional research likert
"_PACKAGE"

## usethis namespace: start
#' @import xtable
#' @import ggplot2
#' @import gridExtra
Expand All @@ -17,92 +14,82 @@
#' @importFrom stats cor cor.test density sd symnum
#' @importFrom plyr llply
#' @importFrom utils packageVersion
NA
## usethis namespace: end
NULL


#' Fictitious dataset with importance and satisfaction results across five different
#' offices.
#'
#' This data set is used in the \code{GapAnalysis} demo and is used to demonstrate
#' how the \code{likert} package handles a gap analysis.
#'
#' @name gap
#' @docType data
#' @format a data frame with 68 ovservations of 11 variables.
#' @keywords datasets
NA
"gap"

#' Results from the Survey of Academic Self-Regulation (SASR).
#'
#' The Survey of Academic Self-Regulation (SASR) is comprised of six factors:
#' self-regulation, intrinsic motivation, extrinsic motivation, self-efficacy,
#' metacognition, and personal relevance and control.
#'
#' @name sasr
#' @docType data
#' @format a data frame with 860 ovservations of 63 variables.
#' @keywords datasets
#' @references Dugan, R., & Andrade, H. (2011). Exploring the construct validity
#' of academic self-regulation using a new self-report questionnaire. The
#' International Journal of Educational and Psychological Assessment, 7(1).
NA
"sasr"

#' Programme of International Student Assessment
#'
#' North American (i.e. Canada, Mexico, and United States) results from the 2009
#' Programme of International Student Assessment (PISA)
#' as provided by the Organization for Economic Co-operation and Development (OECD).
#' See \url{http://www.pisa.oecd.org/} for more information including the code book.
#' See \url{https://www.oecd.org/pisa/} for more information including the code book.
#'
#' @name pisaitems
#' @docType data
#' @format a data frame 66,690 ovservations of 81 variables from North America.
#' @format a data frame 66,690 observations of 81 variables from North America.
#' @source Organization for Economic Co-operation and Development
#' @keywords datasets
NA
"pisaitems"

#' Results from an administration of the Math Anxiety Scale Survey.
#'
#' A data frame of results of the Math Anxiety Scale Survey administered
#' to 20 students in a statistics course. This data frame contains the original
#' data and can be used to verify the pre-summarized procedures.
#'
#' @name mass
#' @docType data
#' @format data frame with 14 rows and 6 columns.
#' @references Bai, H., Wang, L., Pan, W., & Frey, M. (2009). Measuring mathematics
#' anxiety: Psychometric analysis of a bidimensional affective scale. Journal of
#' Instructional Psychology, 36 (3), 185- 193.
#' @keywords datasets
NA
"mass"

#' Pre-summarized results from an administration of the Math Anxiety Scale Survey.
#'
#' A data frame of presummarized results of the Math Anxiety Scale Survey administered
#' to 20 students in a statistics course.
#'
#' @name MathAnxiety
#' @docType data
#' @format data frame with 14 rows and 6 columns.
#' @references Bai, H., Wang, L., Pan, W., & Frey, M. (2009). Measuring mathematics
#' anxiety: Psychometric analysis of a bidimensional affective scale. Journal of
#' Instructional Psychology, 36 (3), 185- 193.
#' @keywords datasets
NA
"MathAnxiety"

#' Pre-summarized results from an administration of the Math Anxiety Scale Survey
#' grouped by gender.
#'
#' A data frame of presummarized results of the Math Anxiety Scale Survey administered
#' to 20 students in a statistics course grouped by gender.
#'
#' @name MathAnxietyGender
#' @docType data
#' @format data frame with 28 rows and 7 columns.
#' @references Bai, H., Wang, L., Pan, W., & Frey, M. (2009). Measuring mathematics
#' anxiety: Psychometric analysis of a bidimensional affective scale. Journal of
#' Instructional Psychology, 36 (3), 185- 193.
#' @keywords datasets
NA
"MathAnxietyGender"

.onAttach <- function(libname, pkgname) {
#pkgEnv = pos.to.env(match('package:likert', search()))
Expand All @@ -114,11 +101,4 @@ that you detach this package as it causes conflicts with the reshape2
package. You can detach using the following R command:
detach('package:reshape') ")
}

ggplot2.version <- as.integer(unlist(strsplit(
as.character(utils::packageVersion('ggplot2')), split='.', fixed=TRUE)))
if( (ggplot2.version[1] == 2 & ggplot2.version[2] < 2) | ggplot2.version[1] < 2) {
warning(paste0('Version ', ggplot2.version, ' of ggplot2 package detected. It is recommended ',
'that use version 2.2.0 or newer.'))
}
}
6 changes: 3 additions & 3 deletions R/plot.likert.bar.r
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ likert.bar.plot <- function(l,
p <- NULL
if(!is.null(l$grouping)) { ##### Grouping ##################################
item_levels <- unique(l$results$Item)
item_levels <- likert:::label_wrap_mod(item_levels, width = wrap)
lsum$Item <- likert:::label_wrap_mod(lsum$Item, width = wrap)
item_levels <- label_wrap_mod(item_levels, width = wrap)
lsum$Item <- label_wrap_mod(lsum$Item, width = wrap)
lsum$Item <- factor(lsum$Item, item_levels)
levels(l$results$Item) <- levels(lsum$Item)
#l$results$Item <- label_wrap_mod(l$results$Item, width=wrap)
lsum$Item <- factor(lsum$Item,item_levels)
#names(l$items) <- label_wrap_mod(names(l$items), width=wrap)
lsum$Group <- likert:::label_wrap_mod(lsum$Group, width=wrap.grouping)
lsum$Group <- label_wrap_mod(lsum$Group, width=wrap.grouping)
results <- l$results
results <- reshape2::melt(results, id=c('Group', 'Item'))
results$variable <- factor(results$variable, ordered=TRUE)
Expand Down
2 changes: 1 addition & 1 deletion R/plot.likert.gap.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ plot.likert.gap <- function(x, type=c('bar','density'),
panel.arrange='v',
panel.strip.color='#F0F0F0',
legend.position='bottom',
panel.background=element_rect(size=1, color='grey70', fill=NA),
panel.background=element_rect(linewidth=1, color='grey70', fill=NA),
satisfaction.label='Satisfaction',
importance.label='Importance',
legend,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.likert.matrix.r
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ panel.hist <- function(x, ...) {
rect(breaks[-nB], 0, breaks[-1], y, col="orange", ...)
}


#' @exportS3Method NULL
pairs.ordered.categorical <- function(xx,...) {
pairs(xx,
diag.panel = panel.hist ,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.likert.r
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ plot.likert <- function(x, type=c('bar','heat','density'),
panel.strip.color='#F0F0F0',
legend.position='bottom',
group.order,
panel.background=element_rect(size=1, color='grey70', fill=NA),
panel.background=element_rect(linewidth=1, color='grey70', fill=NA),
...) {
if(missing(group.order) & !is.null(x$grouping) & include.histogram) {
# Fixes this issue: https://github.com/jbryer/likert/issues/40
Expand Down
Loading