Skip to content

Commit

Permalink
Minor updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbryer committed Feb 16, 2016
1 parent bfceff0 commit a5553c2
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -65,3 +65,4 @@ R-Scripts/.DS_Store
Slides/Albany R Meetup/Sweave.sty
lindner.csv
Slides/Albany R Meetup/Slides.tpbuild
config.R
4 changes: 4 additions & 0 deletions NAMESPACE
Expand Up @@ -4,10 +4,14 @@ S3method(plot,MatchBalance)
S3method(print,MatchBalance)
S3method(summary,MatchBalance)
export(MatchBalance)
export(loess.plot)
export(psa_shiny)
import(MatchIt)
import(Matching)
import(PSAgraphics)
import(ggplot2)
import(granovaGG)
import(party)
import(reshape2)
import(shiny)
importFrom(cowplot,plot_grid)
2 changes: 2 additions & 0 deletions R/psa-package.R
Expand Up @@ -10,7 +10,9 @@
#' @import Matching
#' @import MatchIt
#' @import PSAgraphics
#' @import granovaGG
#' @import party
#' @import shiny
#' @importFrom cowplot plot_grid
NA

Expand Down
6 changes: 6 additions & 0 deletions R/psa_shiny.R
@@ -0,0 +1,6 @@
#' Run the psa shiny application.
#'
#' @export
psa_shiny <- function() {
shiny::runApp(paste0(find.package(package='psa'), '/shiny/psa'))
}
8 changes: 7 additions & 1 deletion inst/shiny/psa/about.md
@@ -1,7 +1,13 @@
**Author:** Jason Bryer, Ph.D.
**Email:** [jason@bryer.org](mailto:jason@bryer.org)
**Webiste:** [github.com/jbryer/psa](www.github.com/jbryer/psa)
**Website:** [github.com/jbryer/psa](www.github.com/jbryer/psa)

This package was designed primarily for teaching purposes and is not provide an exhaustive treatment of conducting propensity score analysis. This shiny application is included in the `psa` R package and can be run locally using the following commands:

```
devtools::install_github('jbryer/psa')
psa::psa_shiny()
```

### R Packages

Expand Down
7 changes: 6 additions & 1 deletion inst/shiny/psa/server.R
@@ -1,4 +1,4 @@
shinyServer(function(input, output) {
shinyServer(function(input, output, session) {
filedata <- reactive({
infile <- input$file
if(is.null(infile)) {
Expand Down Expand Up @@ -103,6 +103,7 @@ shinyServer(function(input, output) {
)

output$tabs <- renderUI({
selected.tab <- isolate(input$tabs)
df <- NULL

input$refresh
Expand Down Expand Up @@ -291,6 +292,7 @@ shinyServer(function(input, output) {

##### Build the tabs
mytabs <- list(
id = 'tabs',
tabPanel('Overview', br(), includeMarkdown('overview.md'),
hr(),
{
Expand All @@ -314,6 +316,7 @@ shinyServer(function(input, output) {
if(!is.null(df) & !is.null(lr.out)) {
tabPanel('Balance',
plotOutput('cv.bal.psa'),
hr(),
plotOutput('balancePlot')
)
} else { NULL }
Expand Down Expand Up @@ -352,6 +355,8 @@ shinyServer(function(input, output) {
} else { NULL }
}
)

updateTabsetPanel(session, 'tabs', selected.tab)
# Clean up the NULL tabs
mytabs <- mytabs[!sapply(mytabs, is.null)]
return(do.call(tabsetPanel, mytabs))
Expand Down
12 changes: 10 additions & 2 deletions man/MatchBalance.Rd

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

68 changes: 68 additions & 0 deletions man/loess.plot.Rd

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

12 changes: 12 additions & 0 deletions man/psa_shiny.Rd

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

0 comments on commit a5553c2

Please sign in to comment.