Skip to content

Commit

Permalink
Merge branch 'new_summary_tables'
Browse files Browse the repository at this point in the history
  • Loading branch information
hofnerb committed Oct 22, 2015
2 parents 842eee8 + 89fb34e commit 8b510d3
Show file tree
Hide file tree
Showing 14 changed files with 826 additions and 462 deletions.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ tests/.*\.Rout\.save$
^\.travis\.yml$
^appveyor\.yml$
.*\.tar\.gz
.Rproj
^.*\.Rproj$
^\.Rproj\.user$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.Rproj.user
.Rhistory
.RData
12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
Package: papeR
Title: A Toolbox for Writing 'knitr', 'Sweave' or Other 'LaTeX'-Based Papers and Reports
Version: 1.0-0
Date: 2015-08-25
Date: 2015-10-22
Author: Benjamin Hofner, with contributions by many others (see inst/CONTRIBUTIONS)
Maintainer: Benjamin Hofner <[email protected]>
Description: A toolbox for writing 'knitr', 'Sweave' or other 'LaTeX'-based
reports and to prettify the output of various estimated models.
Depends:
car
car,
xtable
Enhances:
nlme,
lme4,
survival
survival,
knitr
Imports:
utils,
gmodels,
Expand All @@ -23,7 +25,7 @@ Copyright: See inst/COPYRIGHTS.
Collate:
'helpers.R'
'labels.R'
'latex_table.R'
'summarize.R'
'plot.R'
'prettify.R'
'toLatex.R'
'toLatex.R'
12 changes: 7 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ importFrom("gmodels", "ci")
importFrom("graphics", "abline", "barplot", "boxplot")
importFrom("stats", "as.formula", "coef", "coefficients", "complete.cases",
"fivenum", "lm", "qnorm", "qt", "sd", "symnum", "vcov")
import(xtable)

export(as.labeled.data.frame,
is.labeled.data.frame,
as.labelled.data.frame,
is.labelled.data.frame,
convert.labels,
get_options,
get_option,
labels,
labels.data.frame,
latex.table.cont,
Expand All @@ -20,10 +21,11 @@ export(as.labeled.data.frame,
print.table.fac,
prettify,
prettifyPValue,
summarize, summarise,
summarize_numeric, summarize_factor,
toLatex,
toLatex.character,
"labels<-",
get_options)
"labels<-")

S3method(Anova, lme)
S3method(confint, lme)
Expand All @@ -42,8 +44,8 @@ S3method(prettify, anova)
S3method(prettify, data.frame)
S3method(mySapply, default)
S3method(mySapply, data.frame)
S3method(print, table.cont)
S3method(print, table.fac)
S3method(xtable, summary)
S3method(print, xtable.summary)
S3method(toLatex, default)
S3method(toLatex, character)
S3method(toLatex, sessionInfo)
Expand Down
8 changes: 4 additions & 4 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Anova.lme <- function(mod, type = c("marginal", "sequential"), ...) {

################################################################################
# add and get options from tables
add_options <- function(object, ..., class) {
attr(object, "latex.table.options") <- list(...)
set_options <- function(object, ..., class) {
attr(object, "table.options") <- list(...)
class(object) <- c(class, class(object))
object
}

get_options <- function(object, name) {
attr(object, "latex.table.options")[[name]]
get_option <- function(object, name) {
attr(object, "table.options")[[name]]
}


Expand Down
3 changes: 2 additions & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ plot.ldf <- function(x, variables = names(x),
boxplot(x[, i], main = variables[i], ylab = labels[i], ...)
}
for (i in which.fac) {
barplot(table(x[, i]), main = variables[i], ylab = labels[i], ...)
barplot(table(x[, i]),
main = variables[i], ylab = labels[i], ...)
}
} else {
grp_label <- ifelse(!is.null(grp_label), grp_label, by)
Expand Down
Loading

0 comments on commit 8b510d3

Please sign in to comment.