test_that("read_voteview works", {
x <- read_voteview("both", 116)
expect_true(is.data.frame(x))
expect_gt(nrow(x), 500)
expect_gt(ncol(x), 10)
expect_named(x)
expect_true(".timestamp" %in% names(x))
x <- read_voteview("h", 116)
expect_true(x$congress[1] == 116)
expect_true(is.data.frame(x))
expect_gt(nrow(x), 400)
expect_gt(ncol(x), 10)
expect_named(x)
expect_true(".timestamp" %in% names(x))
x <- read_voteview("senate", 116)
expect_true(x$congress[1] == 116)
expect_true(is.data.frame(x))
expect_gt(nrow(x), 40)
expect_gt(ncol(x), 10)
expect_named(x)
expect_true(".timestamp" %in% names(x))
x <- read_voteview("s", "110th")
expect_true(x$congress[1] == 110)
expect_true(is.data.frame(x))
expect_gt(nrow(x), 40)
expect_gt(ncol(x), 10)
expect_named(x)
expect_true(".timestamp" %in% names(x))
x <- read_voteview(99)
expect_true(x$congress[1] == 99)
expect_true(is.data.frame(x))
expect_gt(nrow(x), 50)
expect_gt(ncol(x), 10)
expect_named(x)
expect_true(".timestamp" %in% names(x))
x <- read_voteview(1962)
expect_true(x$congress[1] == 87)
expect_true(is.data.frame(x))
expect_gt(nrow(x), 50)
expect_gt(ncol(x), 10)
expect_named(x)
expect_true(".timestamp" %in% names(x))
expect_error(
read_voteview(data.frame(x = 20, y = 50))
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.