context("containsQTable")
tb.no.stats <- list(`Age by Income` = structure(c(34.7826086956522, 0, 0, 8.69565217391304,
0, 0, 0, 47.8260869565217, 8.69565217391304, 100, 19.4805194805195,
6.49350649350649, 0, 7.79220779220779, 16.8831168831169, 3.8961038961039,
9.09090909090909, 20.7792207792208, 15.5844155844156, 100, 16.4383561643836,
5.47945205479452, 8.21917808219178, 9.58904109589041, 4.10958904109589,
8.21917808219178, 12.3287671232877, 26.027397260274, 9.58904109589041,
100, 13.953488372093, 6.97674418604651, 16.2790697674419, 10.077519379845,
7.75193798449612, 12.4031007751938, 10.8527131782946, 4.65116279069767,
17.0542635658915, 100, 8.22784810126582, 11.3924050632911, 8.86075949367089,
8.22784810126582, 20.253164556962, 8.86075949367089, 16.4556962025316,
16.4556962025316, 1.26582278481013, 100, 7.76699029126214, 27.1844660194175,
11.6504854368932, 18.4466019417476, 6.79611650485437, 2.9126213592233,
15.5339805825243, 9.70873786407767, 0, 100, 6.77966101694915,
10.1694915254237, 16.9491525423729, 6.77966101694915, 10.1694915254237,
13.5593220338983, 10.1694915254237, 25.4237288135593, 0, 100,
4.54545454545455, 11.3636363636364, 11.3636363636364, 29.5454545454545,
6.81818181818182, 9.09090909090909, 4.54545454545455, 22.7272727272727,
0, 100, 17.0731707317073, 17.0731707317073, 14.6341463414634,
7.31707317073171, 14.6341463414634, 0, 14.6341463414634, 14.6341463414634,
0, 100, 12.3055162659123, 11.5983026874116, 10.4667609618105,
11.3154172560113, 11.3154172560113, 7.63790664780764, 12.1640735502122,
16.8316831683168, 6.36492220650637, 100), statistic = "Column %", .Dim = c(10L,
10L), .Dimnames = list(c("18 to 24", "25 to 29", "30 to 34",
"35 to 39", "40 to 44", "45 to 49", "50 to 54", "55 to 64", "65 or more",
"NET"), c("Less than $15,000", "$15,001 to $30,000", "$30,001 to $45,000",
"$45,001 to $60,000", "$60,001 to $90,000", "$90,001 to $120,000",
"$120,001 to $150,000", "$150,001 to $200,000", "$200,001 or more",
"NET")), name = "Age by Income", questions = c("Age", "Income")))
tb.with.stats <- list(`Age by Income` = structure(c(34.7826086956522, 0, 0, 8.69565217391304,
0, 0, 0, 47.8260869565217, 8.69565217391304, 100, 19.4805194805195,
6.49350649350649, 0, 7.79220779220779, 16.8831168831169, 3.8961038961039,
9.09090909090909, 20.7792207792208, 15.5844155844156, 100, 16.4383561643836,
5.47945205479452, 8.21917808219178, 9.58904109589041, 4.10958904109589,
8.21917808219178, 12.3287671232877, 26.027397260274, 9.58904109589041,
100, 13.953488372093, 6.97674418604651, 16.2790697674419, 10.077519379845,
7.75193798449612, 12.4031007751938, 10.8527131782946, 4.65116279069767,
17.0542635658915, 100, 8.22784810126582, 11.3924050632911, 8.86075949367089,
8.22784810126582, 20.253164556962, 8.86075949367089, 16.4556962025316,
16.4556962025316, 1.26582278481013, 100, 7.76699029126214, 27.1844660194175,
11.6504854368932, 18.4466019417476, 6.79611650485437, 2.9126213592233,
15.5339805825243, 9.70873786407767, 0, 100, 6.77966101694915,
10.1694915254237, 16.9491525423729, 6.77966101694915, 10.1694915254237,
13.5593220338983, 10.1694915254237, 25.4237288135593, 0, 100,
4.54545454545455, 11.3636363636364, 11.3636363636364, 29.5454545454545,
6.81818181818182, 9.09090909090909, 4.54545454545455, 22.7272727272727,
0, 100, 17.0731707317073, 17.0731707317073, 14.6341463414634,
7.31707317073171, 14.6341463414634, 0, 14.6341463414634, 14.6341463414634,
0, 100, 12.3055162659123, 11.5983026874116, 10.4667609618105,
11.3154172560113, 11.3154172560113, 7.63790664780764, 12.1640735502122,
16.8316831683168, 6.36492220650637, 100, 0.0039807217070846,
0, 0, 0.00199888492189559, 0, 0, 0, 0.00465778242730789, 0.00199888492189559,
0.00667682824465732, 0.00542346588195757, 0.00315378289881675,
0, 0.00345233451241458, 0.00505626290103049, 0.00244638718226599,
0.00372628677967813, 0.00559728280918975, 0.00486139892923941,
0.0117244876360376, 0.00486139892923941, 0.00282283760180859,
0.00345233451241458, 0.00372628677967813, 0.00244638718226599,
0.00345233451241458, 0.00421917172205166, 0.0060862425405387,
0.00372628677967813, 0.0114520779299328, 0.00592821709207783,
0.00421917172205166, 0.00638925087184309, 0.00505626290103049,
0.00444421053699322, 0.00559728280918975, 0.00524335027110719,
0.00345233451241458, 0.00653483854222681, 0.0145357354437494,
0.00505626290103049, 0.00592821709207783, 0.00524335027110719,
0.00505626290103049, 0.0078235724961344, 0.00524335027110719,
0.00708334615220998, 0.00708334615220998, 0.00199888492189559,
0.0156780827148481, 0.0039807217070846, 0.00733993372435252,
0.00486139892923941, 0.0060862425405387, 0.00372628677967813,
0.00244638718226599, 0.00559728280918975, 0.00444421053699322,
0, 0.0132774696490871, 0.00282283760180859, 0.00345233451241458,
0.00444421053699322, 0.00282283760180859, 0.00345233451241458,
0.0039807217070846, 0.00345233451241458, 0.00542346588195757,
0, 0.0104085862289755, 0.00199888492189559, 0.00315378289881675,
0.00315378289881675, 0.00505626290103049, 0.00244638718226599,
0.00282283760180859, 0.00199888492189559, 0.00444421053699322,
0, 0.00909204000853127, 0.00372628677967813, 0.00372628677967813,
0.00345233451241458, 0.00244638718226599, 0.00345233451241458,
0, 0.00345233451241458, 0.00345233451241458, 0, 0.00879644676254966,
0.0123632800456569, 0.0120510578304054, 0.0115211531722201, 0.0119222163766617,
0.0119222163766617, 0.00999612564337838, 0.0123019302804119,
0.0140812230998479, 0.00918784134634635, 0, 0.000849377419153474,
0.0773809827461264, 0.0954961038909552, 0.686781943204848, 0.0815725762954532,
0.160878761024438, 0.0696059066711372, 0.0000536534428476898,
0.641571893614577, NA, 0.0423210095424223, 0.138351665068541,
0.00148126755068367, 0.301199195429941, 0.102298995198857, 0.190338372185203,
0.382136279730124, 0.326704874125211, 0.000447169134715319, NA,
0.256328046748208, 0.0846852156976564, 0.507691842184744, 0.62292953328991,
0.0401358267826595, 0.843470320141708, 0.963740814436351, 0.0265869880109406,
0.233427571493747, NA, 0.528586480556088, 0.0698293923241086,
0.0170784486631649, 0.623518700409737, 0.157642936167409, 0.0242179617346248,
0.614296809388373, 0.0000432417394942153, 3.79435104447268e-08,
NA, 0.0766221933689186, 0.926918518829267, 0.454254318229909,
0.16443692441598, 0.0000570765610781176, 0.51134932415577, 0.0610920797125845,
0.886017825067399, 0.00288807619190024, NA, 0.129264005505931,
9.05778875237573e-08, 0.671140990940982, 0.0134437150729616,
0.117238912014026, 0.0507654829575195, 0.257628154136641, 0.0365830352009795,
0.00419949566936639, NA, 0.177137754498547, 0.720335604552778,
0.0893252341570526, 0.250644853277108, 0.771638738277393, 0.0736617002828646,
0.624430468982927, 0.0654054200653444, 0.0364541201647898, NA,
0.105638606959378, 0.959963120931475, 0.840945546998515, 0.0000808329136292585,
0.330828649229419, 0.707865703158119, 0.110368183500707, 0.280430074299729,
0.0741158466703972, NA, 0.338321115867427, 0.259318212136639,
0.369126520991046, 0.405017436714764, 0.489466621817869, 0.0578063340496739,
0.618104574183931, 0.698395168435894, 0.0854228412526985, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), .Dim = c(10L, 10L, 3L
), .Dimnames = list(c("18 to 24", "25 to 29", "30 to 34", "35 to 39",
"40 to 44", "45 to 49", "50 to 54", "55 to 64", "65 or more",
"NET"), c("Less than $15,000", "$15,001 to $30,000", "$30,001 to $45,000",
"$45,001 to $60,000", "$60,001 to $90,000", "$90,001 to $120,000",
"$120,001 to $150,000", "$150,001 to $200,000", "$200,001 or more",
"NET"), c("Column %", "Standard Error", "p")), name = "Age by Income",
questions = c("Age","Income")))
test_that("test_containsqtable",
{
expect_true(containsQTable(list(X = tb.no.stats)))
expect_true(containsQTable(list(X = NULL, Y = list(tb.no.stats))))
expect_false(containsQTable(list(X = 1:19)))
expect_false(containsQTable(list(X = 1:10, list(Y = list(1:10, 2:11)))))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.