Skip to content

Commit

Permalink
git push origin masterMerge branch 'larmarange-labelled_2'
Browse files Browse the repository at this point in the history
  • Loading branch information
juba committed Nov 25, 2018
2 parents ef11ec0 + 7a0dfb2 commit 6d32acc
Show file tree
Hide file tree
Showing 75 changed files with 938 additions and 900 deletions.
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Authors@R: c(person("Julien", "Barnier", email="julien.barnier@ens-lyon.fr",
role=c("aut","cre")), person("François", "Briatte",
email="f.briatte@gmail.com", role="aut"), person("Joseph", "Larmarange",
email="joseph@larmarange.net", role="aut"))
Version: 0.6.4
Date: 2018-07-20
Version: 0.7.0
License: GPL (>= 2)
Encoding: UTF-8
Title: Functions to Make Surveys Processing Easier
Expand All @@ -25,7 +24,7 @@ Imports:
graphics,
stats,
utils,
labelled (>= 1.0.0)
labelled (>= 2.0.0)
Suggests:
memisc,
testthat,
Expand All @@ -39,4 +38,4 @@ SystemRequirements: xclip (Linux)
VignetteBuilder: knitr
URL: https://juba.github.io/questionr/
BugReports: https://github.com/juba/questionr/issues
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ S3method(describe,character)
S3method(describe,data.frame)
S3method(describe,default)
S3method(describe,factor)
S3method(describe,labelled)
S3method(describe,haven_labelled)
S3method(describe,numeric)
S3method(format,proptab)
S3method(odds.ratio,factor)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
questionr 0.6.4
questionr 0.7.0
---------------

* Compatibility with `labelled` 2.0.0


questionr 0.6.3
---------------
Expand Down
12 changes: 6 additions & 6 deletions R/describe.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
res <- paste0("[", length(x), " obs.] ")
res <- paste0(res, labelled::var_label(x), "\n")

if (inherits(x, "labelled_spss"))
if (inherits(x, "haven_labelled_spss"))
cl <- paste("labelled_spss", typeof(x))
else if (inherits(x, "labelled"))
else if (inherits(x, "haven_labelled"))
cl <- paste("labelled", typeof(x))
else
cl <- class(x)
Expand Down Expand Up @@ -124,9 +124,9 @@
res <- paste0("[", length(x), " obs.] ")
res <- paste0(res, labelled::var_label(x), "\n")

if (inherits(x, "labelled_spss"))
if (inherits(x, "haven_labelled_spss"))
cl <- paste("labelled_spss", typeof(x))
else if (inherits(x, "labelled"))
else if (inherits(x, "haven_labelled"))
cl <- paste("labelled", typeof(x))
else
cl <- class(x)
Expand Down Expand Up @@ -189,12 +189,12 @@


#' @rdname describe
#' @aliases describe.labelled
#' @aliases describe.haven_labelled
#' @examples
#' data(fecondite)
#' describe(femmes$milieu)
#' @export
`describe.labelled` <-
`describe.haven_labelled` <-
function(x, n = 10, show.length = TRUE, freq.n.max = 10, ...) {
if (is.numeric(x)) {
res <- describe.numeric(x, n = n, show.length = show.length, freq.n.max = 0, ...)
Expand Down
2 changes: 1 addition & 1 deletion R/lookfor.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ lookfor <- function(data,
res$type[i] <- paste(typeof(data[[v]]), collapse = ", ")
if (is.factor(data[[v]]))
res$levels[i] <- paste(levels(data[[v]]), collapse = "; ")
if (inherits(data[[v]], "labelled")) {
if (inherits(data[[v]], "haven_labelled")) {
res$value_labels[i] <- paste(names(labelled::val_labels(data[[v]], prefixed=TRUE)), collapse = "; ")
res$na_values[i] <- paste(labelled::na_values(data[[v]]), collapse = ", ")
res$na_range[i] <- paste(labelled::na_range(data[[v]]), collapse = "-")
Expand Down
2 changes: 1 addition & 1 deletion R/recode.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function (var, nbclass, include.lowest=TRUE, right=FALSE, dig.lab=5, ...) {
#' freq(recode.na(hdv2003$trav.satisf, "Equilibre"))
#' ## Truncate a count variable (recommends numeric conversion).
#' freq(recode.na(hdv2003$freres.soeurs, 5:22))
#' @export
#' @export recode.na

recode.na <- function(x, ..., verbose = FALSE, regex = TRUE, as.numeric = FALSE) {
if(!is.factor(x)) x = factor(x)
Expand Down
Binary file modified data/fecondite.RData
Binary file not shown.
Binary file modified data/fertility.RData
Binary file not shown.
23 changes: 12 additions & 11 deletions docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions docs/articles/recoding_addins.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6d32acc

Please sign in to comment.