Skip to content

Commit

Permalink
Fixed 'format_html' for codebooks of data frames with factors.
Browse files Browse the repository at this point in the history
  • Loading branch information
melff committed Oct 20, 2018
1 parent 14e72ed commit 2b9d70d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: memisc
Type: Package
Title: Management of Survey Data and Presentation of Analysis Results
Version: 0.99.16.1
Date: 2018-10-20
Version: 0.99.16.2
Date: 2018-10-21
Author: Martin Elff (with contributions from Christopher N. Lawrence, Dave Atkins, Jason W. Morgan, Achim Zeileis)
Maintainer: Martin Elff <memisc@elff.eu>
Description: An infrastructure for the management of survey data including
Expand Down
8 changes: 3 additions & 5 deletions pkg/R/codebook-format-html.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ format_html.codebookEntry <- function(x,name="",
counts_html <- formatC(tab[,1],format="d")
counts_html <- html_td(counts_html,vectorize=TRUE,style=css(align.right,lrpad))

perc_html <- cbind(
formatC(tab[,2],format="f",digits=1),
formatC(tab[,3],format="f",digits=1)
)
perc_html <- formatC(tab[,-1,drop=FALSE],
format="f",digits=1)
perc_html[perc_html=="NA"] <- ""

perc_html <- spltDec(perc_html)
Expand Down Expand Up @@ -160,4 +158,4 @@ format_html.codebook <- function(x,toprule=2,
title_tag=title_tag
))
as.character(html_div(unlist(out),class="codebook"))
}
}
1 change: 1 addition & 0 deletions pkg/inst/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2018-10-20:
- The 'subset' method for 'importer' objects now accepts the names of
variables to be selected also as a character vector.
- Fixed 'format_html' for codebooks of data frames with factors.

2018-10-15:
- A 'setCodeplan' and 'codeplan<-' assignment function is created that
Expand Down

0 comments on commit 2b9d70d

Please sign in to comment.