tests/testthat/test_star_table_notes.R

## c:/Dropbox/Rpackages/starpolish/tests/testthat/test_star_table_notes.R

##    Chandler Lutz
##    Questions/comments: cl.eco@cbs.dk
##    $Revisions:      1.0.0     $Date:  2016-12-21


context("test star_notes_caption() function")

##Clear the workspace
rm(list = ls())

##For star_table notes



library(stargazer)
data(mtcars)
##First set up models without weight
mod.mtcars.1 <- lm(mpg ~ hp, mtcars)
mod.mtcars.2 <- lm(mpg ~ hp + cyl, mtcars)
star.out <- capture.output(stargazer(mod.mtcars.1, mod.mtcars.2))
star.out <- star_notes_tex(star.out, note.type = "caption", "custom note")

test_that("star_notes_tex() works", {
    expect_is(star_notes_tex(star.out, note.type = "caption", "custom note"), "character")
})
ChandlerLutz/starpolishr documentation built on April 16, 2023, 8:55 a.m.