Skip to content

Commit

Permalink
Fixes for release on CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
gdemin committed Dec 10, 2018
1 parent b3c2d96 commit 56b66b1
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
20 changes: 15 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,6 @@ export(is.with_caption)
export(items)
export(keep)
export(key)
export(knit_print.etable)
export(knit_print.with_caption)
export(lab_num)
export(last)
export(le)
Expand Down Expand Up @@ -550,9 +548,6 @@ export(read_spss_to_list)
export(recode)
export(ref)
export(regex)
export(repr_html.etable)
export(repr_html.with_caption)
export(repr_text.etable)
export(rleid)
export(rleidv)
export(rowid)
Expand Down Expand Up @@ -695,6 +690,21 @@ export(write_labelled_tab2)
export(write_labels)
export(write_labels_spss)
export(xl_write)
if(getRversion() >= "3.6.0") {
S3method(knitr::knit_print, "etable")
S3method(knitr::knit_print, "with_caption")
S3method(repr::repr_html, "etable")
S3method(repr::repr_html, "with_caption")
S3method(repr::repr_text, "etable")
S3method(repr::repr_text, "with_caption")
} else {
export(knit_print.etable)
export(knit_print.with_caption)
export(repr_html.etable)
export(repr_html.with_caption)
export(repr_text.etable)
export(repr_text.with_caption)
}
import(data.table)
import(foreign)
import(htmlTable)
Expand Down
29 changes: 24 additions & 5 deletions R/html_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,29 @@ matrix_to_cgroup = function(header){
list(cgroup = do.call(rbind, cgroup), n.cgroup = do.call(rbind, n.cgroup))
}

#' @export
#' @rawNamespace if(getRversion() >= "3.6.0") {
#' S3method(knitr::knit_print, "etable")
#' S3method(knitr::knit_print, "with_caption")
#' S3method(repr::repr_html, "etable")
#' S3method(repr::repr_html, "with_caption")
#' S3method(repr::repr_text, "etable")
#' S3method(repr::repr_text, "with_caption")
#' } else {
#' export(knit_print.etable)
#' export(knit_print.with_caption)
#' export(repr_html.etable)
#' export(repr_html.with_caption)
#' export(repr_text.etable)
#' export(repr_text.with_caption)
#' }
#' @rdname htmlTable.etable
knit_print.etable = function(x, digits = get_expss_digits(), escape.html = FALSE, ...){
knitr::knit_print(htmlTable.etable(x, digits = digits,
escape.html = escape.html,
..., row_groups = TRUE))
}

#' @export

#' @rdname htmlTable.etable
knit_print.with_caption = function(x, digits = get_expss_digits(), escape.html = FALSE, ...){
knitr::knit_print(htmlTable.with_caption(x, digits = digits,
Expand All @@ -327,20 +341,20 @@ knit_print.with_caption = function(x, digits = get_expss_digits(), escape.html =
}


#' @export

#' @rdname htmlTable.etable
repr_html.etable = function(obj, digits = get_expss_digits(), escape.html = FALSE, ...){
htmlTable(obj, digits = digits, escape.html = escape.html, ..., row_groups = FALSE)

}

#' @export

#' @rdname htmlTable.etable
repr_html.with_caption = function(obj, digits = get_expss_digits(), escape.html = FALSE, ...){
htmlTable(obj, digits = digits, escape.html = escape.html, ..., row_groups = FALSE)
}

#' @export

#' @rdname htmlTable.etable
repr_text.etable = function(obj, digits = get_expss_digits(), ...){
curr_output = getOption("expss.output")
Expand All @@ -364,6 +378,7 @@ repr_text.etable = function(obj, digits = get_expss_digits(), ...){

}

#' @rdname htmlTable.etable
repr_text.with_caption = function(obj, digits = get_expss_digits(), ...){
width = getOption("width")
on.exit(options(width = width))
Expand Down Expand Up @@ -486,3 +501,7 @@ html_table_no_row_groups = function(x, escape.html = FALSE, ...){

}





3 changes: 3 additions & 0 deletions man/htmlTable.etable.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test_dichotomy.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ dep = c(1,1,1,2,2,2)
indep = c(1,1,3,2,2,3)
var_lab(indep) = "Label"
val_lab(indep) = c(a=1,b=2,c=3)
if(as.numeric(version$major) ==3 && as.numeric(version$minor)<5){
if(FALSE){
expect_equal_to_reference(lm(dep ~ dummy(indep)),"rds/lm_dichotomy_default.rds", update = FALSE)
expect_equal_to_reference(lm(dep ~ dummy1(indep)),"rds/lm_dichotomy_default2.rds", update = FALSE)
}
Expand Down

0 comments on commit 56b66b1

Please sign in to comment.