Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.swo
*.swp
docs
3 changes: 3 additions & 0 deletions .scripts/build_documentation.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
library("devtools")

devtools::document()
4 changes: 4 additions & 0 deletions .scripts/build_documentation_html.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(pkgdown)

pkgdown::build_site()

3 changes: 3 additions & 0 deletions .scripts/build_package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
library(devtools)

devtools::build()
2 changes: 2 additions & 0 deletions .scripts/check_package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
library(devtools)
devtools::check()
2 changes: 2 additions & 0 deletions .scripts/install_package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
library(devtools)
devtools::install(upgrade=FALSE)
2 changes: 2 additions & 0 deletions .scripts/test_package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
library(devtools)
devtools::test()
2 changes: 2 additions & 0 deletions .scripts/test_package_cov.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
library(covr)
report()
24 changes: 24 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Package: statstool
Title: An awesome R package with stats tolos
Version: 0.0.0
Author: Alex Paxton <alex.paxton@uconn.edu>
Maintainer: Alex Paxton <alex.paxton@uconn.edu>
Description: What the package does.
Depends: R (>= 3.5)
Imports: dplyr,
pander,
xtable,
plyr
Suggests: testthat (>= 1.0.0),
knitr,
rmarkdown,
covr,
shiny,
DT,
roxygen2,
kableExtra
VignetteBuilder: knitr
License: MIT License + file LICENSE
Encoding: UTF-8
LazyData: false
RoxygenNote: 6.1.1
File renamed without changes.
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
RSCRIPT ?= Rscript


all: doc-doxygen check build install test

build:
$(RSCRIPT) .scripts/build_package.R

install: doc-doxygen
$(RSCRIPT) .scripts/install_package.R


check:
$(RSCRIPT) .scripts/check_package.R

doc-doxygen:
$(RSCRIPT) .scripts/build_documentation.R

doc-html: install
$(RSCRIPT) .scripts/build_documentation_html.R

doc: doc-html

test:
$(RSCRIPT) .scripts/test_package.R
6 changes: 6 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(pander_anova)
export(pander_lm)
export(pander_lme_to_latex)
export(xtable_lme)
24 changes: 8 additions & 16 deletions pander_anova.r → R/pander_anova.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
library(pander)
library(plyr)

#' Create a cleaner ANOVA model output with pander.
#'
#' @param anova_model_name ANOVA model. Model whose output will be cleaned.
#' @return neat_output pander table. Cleaned ANOVA model output.
#' @export
pander_anova = function(anova_model_name){

#' Create a cleaner ANOVA model output with pander.
#'
#' Parameters
#' ----------
#' anova_model_name : ANOVA model
#' Model whose output will be cleaned.
#'
#' Output
#' ------
#' neat_output : pander table
#' Cleaned ANOVA model output.

# load in pander
require(pander)
require(plyr)

# disable scientific notation
options(scipen = 999)

Expand Down
31 changes: 16 additions & 15 deletions pander_lm.R → R/pander_lm.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#' Create a cleaner lm model output with pander.
#'
#' Parameters
#' ----------
#' lm_model_name : lm model
#' Model whose output will be cleaned.
#'
#' stats.caption : boolean, optional (default: FALSE)
#' Specify whether or not to provide the adjusted
#' R-squared and F-statistics in the table caption.
#'
#' Output
#' ------
#' neat_output : table
#' Cleaned lm model output.
#' @export
pander_lm = function(lm_model_name, stats.caption=FALSE){

#' Create a cleaner lm model output with pander.
#'
#' Parameters
#' ----------
#' lm_model_name : lm model
#' Model whose output will be cleaned.
#'
#' stats.caption : boolean, optional (default: FALSE)
#' Specify whether or not to provide the adjusted
#' R-squared and F-statistics in the table caption.
#'
#' Output
#' ------
#' neat_output : table
#' Cleaned lm model output.

# load in pander
require(pander)
Expand Down
36 changes: 18 additions & 18 deletions pander_lme.R → R/pander_lme.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#' Create a cleaner lme4 model output with pander.
#'
#' Parameters
#' ----------
#' lme_model_name : lme4 model
#' Model whose output will be cleaned.
#'
#' stats.caption : boolean, optional (default: FALSE)
#' Specify whether or not to provide the marginal
#' (i.e., fixed effects only) and conditional (i.e.,
#' fixed and random effects) R-squared values in the
#' table's caption.
#'
#' Output
#' ------
#' neat_output : pander table
#' Cleaned lme4 model output.
#' export
pander_lme = function(lme_model_name, stats.caption=FALSE){

#' Create a cleaner lme4 model output with pander.
#'
#' Parameters
#' ----------
#' lme_model_name : lme4 model
#' Model whose output will be cleaned.
#'
#' stats.caption : boolean, optional (default: FALSE)
#' Specify whether or not to provide the marginal
#' (i.e., fixed effects only) and conditional (i.e.,
#' fixed and random effects) R-squared values in the
#' table's caption.
#'
#' Output
#' ------
#' neat_output : pander table
#' Cleaned lme4 model output.

# load in pander
require(pander)

Expand Down
40 changes: 20 additions & 20 deletions pander_lme_to_latex.r → R/pander_lme_to_latex.R
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#' Export an LMER summary table to a LaTex file.
#'
#' Note that this will retain the row index column,
#' which will be given a name`neat" in the table.
#' This will be need to be manually removed in the
#' final `.tex` file.
#'
#' Parameters
#' ----------
#' lme_model_name : lme4 model
#' Model whose output will be cleaned.
#'
#' save_filename : str
#' File name for saved LaTex model.
#'
#' Output
#' ------
#' neat_output : pander table
#' Cleaned lme4 model output.
#' @export
pander_lme_to_latex = function(lme_model_name, save_filename){

#' Export an LMER summary table to a LaTex file.
#'
#' Note that this will retain the row index column,
#' which will be given a name`neat" in the table.
#' This will be need to be manually removed in the
#' final `.tex` file.
#'
#' Parameters
#' ----------
#' lme_model_name : lme4 model
#' Model whose output will be cleaned.
#'
#' save_filename : str
#' File name for saved LaTex model.
#'
#' Output
#' ------
#' neat_output : pander table
#' Cleaned lme4 model output.

# load in pander
require(pander)
require(Hmisc)
Expand Down
25 changes: 12 additions & 13 deletions xtable_lme.r → R/xtable_lme.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#' Create a cleaner lme4 model output for printing with xtable.
#'
#' Parameters
#' ----------
#' lme_model_name : lme4 model
#' Model whose output will be cleaned.
#'
#' Output
#' ------
#' neat_output : table
#' Cleaned lme4 model output.
#' @export
xtable_lme = function(lme_model_name){

#' Create a cleaner lme4 model output for
#' printing with xtable.
#'
#' Parameters
#' ----------
#' lme_model_name : lme4 model
#' Model whose output will be cleaned.
#'
#' Output
#' ------
#' neat_output : table
#' Cleaned lme4 model output.

# load in pander
library(pander)
library(dplyr)
Expand Down
3 changes: 0 additions & 3 deletions doc/TODO

This file was deleted.

1 change: 1 addition & 0 deletions man/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder is automatically generated. DO NOT EDIT MANUALLY.
17 changes: 17 additions & 0 deletions man/pander_anova.Rd

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

24 changes: 24 additions & 0 deletions man/pander_lm.Rd

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

27 changes: 27 additions & 0 deletions man/pander_lme.Rd

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

28 changes: 28 additions & 0 deletions man/pander_lme_to_latex.Rd

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

20 changes: 20 additions & 0 deletions man/xtable_lme.Rd

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

Loading