Skip to content

Commit

Permalink
Fix a couple small things to get check to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
nutterb committed Nov 6, 2015
1 parent 163d2af commit 6970d16
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
^xtable_vs_pixiedust.Rmd$
^LaTeX_Table_Tests.pdf$
^LaTeX_Table_Tests.Rmd$
^LaTeX_Table_Tests.tex$
^print_dust_latex_original.R$
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pixiedust
Date: 2015-11-04
Date: 2015-11-05
Title: Tables so Beautifully Fine-Tuned You Will Believe It's Magic
Version: 0.5.2
Version: 0.5.3
Authors@R: person("Benjamin", "Nutter", email = "nutter@battelle.org", role = c("aut", "cre"))
Description: The introduction of the broom package has made converting model objects into data
frames as simple as a single function. While the broom package focuses on providing tidy
Expand Down
11 changes: 11 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#### 0.5.3 (5 November 2015)
* Due to a great deal of difficulty getting the last couple of
features to play nicely, I decided to take a different
approach to the LaTeX output. Most features are
available, but I have yet to include column widths,
column heights, or multirow output.
* An option is added to the print method that
turns off the `knitr::asis_output` return.
The motivation behind this was to be able to
use the HTML code in shiny applications.

#### 0.5.2 (4 November 2015)
* Longtable support is added
* Documentation on cell borders is up to date
Expand Down
17 changes: 11 additions & 6 deletions R/print_dust_latex.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @importFrom tidyr spread_


print_dust_latex <- function(x, ..., asis)
print_dust_latex <- function(x, ..., asis=TRUE)
{

#* Determine the number of divisions
Expand Down Expand Up @@ -71,7 +71,7 @@ part_prep_latex <- function(part, head=FALSE, col_halign)
data.frame(col = 1:length(col_halign),
col_halign = col_halign,
stringsAsFactors = FALSE)) %>%
mutate(require_multicol = (halign != "" & halign != col_halign) |
dplyr::mutate(require_multicol = (halign != "" & halign != col_halign) |
(left_border != "" | right_border != "" |
bottom_border != "" | top_border != ""),
halign = ifelse(require_multicol & halign == "",
Expand Down Expand Up @@ -245,9 +245,9 @@ get_column_halign <- function(Joint){
default_halign,
character(1))
Joint <- Joint %>%
mutate(halign = substr(halign, 1, 1)) %>%
group_by(col) %>%
summarise(col_halign = names(sort(table(halign), decreasing = TRUE))[1])
dplyr::mutate(halign = substr(halign, 1, 1)) %>%
dplyr::group_by(col) %>%
dplyr::summarise(col_halign = names(sort(table(halign), decreasing = TRUE))[1])
Joint$col_halign
}

Expand Down Expand Up @@ -327,4 +327,9 @@ latex_horizontal_border_code <- function(x, col){
"\\cline{", col, "-", col, "}")
return(border_code)
}
}
}


utils::globalVariables(c("halign", "left_border", "right_border",
"bottom_border", "top_border",
"require_multicol"))

0 comments on commit 6970d16

Please sign in to comment.