Skip to content

Commit

Permalink
Fixing fixtures. Should pass CI
Browse files Browse the repository at this point in the history
  • Loading branch information
1beb committed Oct 23, 2020
1 parent d763d59 commit a51cda7
Show file tree
Hide file tree
Showing 27 changed files with 1,928 additions and 550 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: In order to generate custom survey reports, this package provides
'banners' (cross-tabulations) of datasets in the Crunch
(<https://crunch.io/>) web service. Reports can be written in 'PDF' format
using 'LaTeX' or in Microsoft Excel '.xlsx' files.
Version: 1.2.9
Version: 1.3.0
Authors@R: c(
person("Persephone", "Tsebelis", role="aut"),
person("Kamil", "Sedrowicz", role="aut"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
\documentclass{article}
\usepackage[pdftex]{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{sfmath}
\usepackage{comment}
\usepackage[T1]{fontenc}
\usepackage[pdftex=true, pdftoolbar=true, pdfmenubar=true, pdfauthor = {}, pdfcreator = {PDFLaTeX}, pdftitle = {}, colorlinks=true, urlcolor=blue, linkcolor=blue, citecolor=blue, implicit=true, hypertexnames=false]{hyperref}
\usepackage[scaled]{helvet}
\renewcommand*\familydefault{\sfdefault}
\usepackage{booktabs}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{siunitx}
\sisetup{
round-mode = places, % Rounds numbers
round-precision = 2, % to 2 places
table-format = 3
}
\usepackage[top=0.6in, bottom=0.6in, left=1in, right=1in, includeheadfoot]{geometry}
\usepackage{array}
\usepackage[english]{babel}
\newcolumntype{B}[2]{>{#1\hspace{0pt}\arraybackslash}b{#2}}
\setlength{\parindent}{0pt}
\usepackage[dvipsnames]{color}
\definecolor{gray}{gray}{0.85}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\newcolumntype{d}{S}
\newcolumntype{J}{S[table-format=1]}
\newcolumntype{K}{S[table-format=2]}
\newcolumntype{M}{S[table-format=4]}
\newcolumntype{N}{S[table-format=5]}
\newcolumntype{O}{S[table-format=6]}
% default is 3 so it's not included above
\usepackage{float}
\usepackage{marginnote}
\setlength\extrarowheight{2pt}
\newlength\mywidth
\setlength\mywidth{3.5in}
\usepackage{caption}
\captionsetup[table]{labelformat=empty}
\renewcommand*{\marginfont}{\scriptsize\itshape}
\fancyfoot{}
\fancyfoot[R]{\thepage}
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\let\PBS=\PreserveBackslash
\newcommand{\longtablesep}{\endfirsthead \multicolumn{2}{c}{\textit{}} \\ \endhead \multicolumn{2}{c}{\textit{}} \\ \endfoot \endlastfoot}
\usepackage[titles]{tocloft}
\newcommand{\cftchapfont}{12}
\newcommand{\formatvardescription}[1]{#1}
\newcommand{\formatvarname}[1]{#1}
\newcommand{\formatvaralias}[1]{#1}
\newcommand{\formatvarfiltertext}[1]{\fontsize{8}{12}\textit{#1}}
\newcommand{\formatvarsubname}[1]{#1}
\usepackage{amsmath}
\usepackage{listings}
\usepackage{inconsolata}

\newenvironment{absolutelynopagebreak}
{\par\nobreak\vfil\penalty0\vfilneg
\vtop\bgroup}
{\par\xdef\tpd{\the\prevdepth}\egroup
\prevdepth=\tpd}

\fancyhead{}
\fancyhead[L]{{\fontsize{16}{24}\textbf{Data for Progress National Issues Survey -- Foreign Policy}}}


\begin{document}
\setlength{\tabcolsep}{1em}
\setlength{\LTleft}{0pt}
\setlength{\LTright}{\fill}
\setlength{\LTcapwidth}{\textwidth}
\vspace{.25in}





\renewcommand{\listtablename}{Table of Contents}


\begin{absolutelynopagebreak}
\begin{absolutelynopagebreak}
\textbf{Country of Residence}\hfill\textbf{\ttfamily{country\_of\_residence}}

{\small Categorical}

\vskip 0.10in
In what country do you live?
\addcontentsline{lot}{table}{\parbox{1.8in}{\ttfamily{country\_of\_residence}} Country of Residence}
\vskip 0.10in\end{absolutelynopagebreak} \textit{There are more than 20 categories. Please see Appendix 1}\end{absolutelynopagebreak}

\clearpage

\clearpage
\fancyhead{}
\fancyhead[L]{{\fontsize{16}{24}\textbf{Appendix}}}

\begin{absolutelynopagebreak}
\textbf{Country of Residence}\hfill\textbf{\ttfamily{country\_of\_residence}}

{\small Categorical}

\vskip 0.10in
In what country do you live?
\addcontentsline{lot}{table}{\parbox{1.8in}{\ttfamily{country\_of\_residence}} Country of Residence}
\vskip 0.10in\end{absolutelynopagebreak}

\begin{longtabu} to \linewidth {d>{\raggedright\arraybackslash}p{1.75in}M>{\centering}Xd>{\raggedright\arraybackslash}p{1.75in}J}
\toprule
{{Code}} & {{Label}} & {{Count}} & {{}} & {{Code}} & {{Label}} & {{Count}}\\
\cmidrule(l){1-3}\cmidrule(l){5-7}

4 & Afghanistan & 0 & & 8 & Albania & 0\\
10 & Antarctica & 0 & & 12 & Algeria & 0\\
16 & American Samoa & 0 & & 20 & Andorra & 0\\
24 & Angola & 0 & & 28 & Antigua and Barbuda & 0\\
31 & Azerbaijan & 0 & & 32 & Argentina & 0\\
36 & Australia & 0 & & 40 & Austria & 0\\
44 & Bahamas & 0 & & 48 & Bahrain & 0\\
50 & Bangladesh & 0 & & 51 & Armenia & 0\\
52 & Barbados & 0 & & 56 & Belgium & 0\\
60 & Bermuda & 0 & & 64 & Bhutan & 0\\
68 & Bolivia & 0 & & 70 & Bosnia and Herzegovina & 0\\
72 & Botswana & 0 & & 74 & Bouvet Island & 0\\
76 & Brazil & 0 & & 84 & Belize & 0\\
86 & British Indian Ocean Territory & 0 & & 90 & Solomon Islands & 0\\
92 & Virgin Islands, British & 0 & & 96 & Brunei Darussalam & 0\\
100 & Bulgaria & 0 & & 104 & Myanmar & 0\\
108 & Burundi & 0 & & 112 & Belarus & 0\\
116 & Cambodia & 0 & & 120 & Cameroon & 0\\
124 & Canada & 0 & & 132 & Cape Verde & 0\\
136 & Cayman Islands & 0 & & 140 & Central African Republic & 0\\
144 & Sri Lanka & 0 & & 148 & Chad & 0\\
152 & Chile & 0 & & 156 & China & 0\\
158 & Taiwan & 0 & & 162 & Christmas Island & 0\\
166 & Cocos (Keeling) Islands & 0 & & 170 & Colombia & 0\\
174 & Comoros & 0 & & 175 & Mayotte & 0\\
178 & Congo & 0 & & 180 & Congo, the Democratic Republic of the & 0\\
184 & Cook Islands & 0 & & 188 & Costa Rica & 0\\
191 & Croatia & 0 & & 192 & Cuba & 0\\
196 & Cyprus & 0 & & 203 & Czech Republic & 0\\
204 & Benin & 0 & & 208 & Denmark & 0\\
212 & Dominica & 0 & & 214 & Dominican Republic & 0\\
218 & Ecuador & 0 & & 222 & El Salvador & 0\\
226 & Equatorial Guinea & 0 & & 231 & Ethiopia & 0\\
232 & Eritrea & 0 & & 233 & Estonia & 0\\
234 & Faroe Islands & 0 & & 238 & Falkland Islands (Malvinas) & 0\\
239 & South Georgia and the South Sandwich Islands & 0 & & 242 & Fiji & 0\\
246 & Finland & 0 & & 248 & Aland Islands & 0\\
250 & France & 0 & & 254 & French Guiana & 0\\
258 & French Polynesia & 0 & & 260 & French Southern Territories & 0\\
262 & Djibouti & 0 & & 266 & Gabon & 0\\
268 & Georgia & 0 & & 270 & Gambia & 0\\
275 & Palestinian Territory, Occupied & 0 & & 276 & Germany & 0\\
288 & Ghana & 0 & & 292 & Gibraltar & 0\\
296 & Kiribati & 0 & & 300 & Greece & 0\\
304 & Greenland & 0 & & 308 & Grenada & 0\\
312 & Guadeloupe & 0 & & 316 & Guam & 0\\
320 & Guatemala & 0 & & 324 & Guinea & 0\\
328 & Guyana & 0 & & 332 & Haiti & 0\\
334 & Heard Island and McDonald Islands & 0 & & 336 & Holy See (Vatican City State) & 0\\
340 & Honduras & 0 & & 344 & Hong Kong & 0\\
348 & Hungary & 0 & & 352 & Iceland & 0\\
356 & India & 0 & & 360 & Indonesia & 0\\
364 & Iran, Islamic Republic of & 0 & & 368 & Iraq & 0\\
372 & Ireland & 0 & & 376 & Israel & 0\\
380 & Italy & 0 & & 384 & Cote d'Ivoire & 0\\
388 & Jamaica & 0 & & 392 & Japan & 0\\
398 & Kazakhstan & 0 & & 400 & Jordan & 0\\
404 & Kenya & 0 & & 408 & Korea, Democratic People's Republic of & 0\\
410 & Korea, Republic of & 0 & & 414 & Kuwait & 0\\
417 & Kyrgyzstan & 0 & & 418 & Lao People's Democratic Republic & 0\\
422 & Lebanon & 0 & & 426 & Lesotho & 0\\
428 & Latvia & 0 & & 430 & Liberia & 0\\
434 & Libyan Arab Jamahiriya & 0 & & 438 & Liechtenstein & 0\\
440 & Lithuania & 0 & & 442 & Luxembourg & 0\\
446 & Macao & 0 & & 450 & Madagascar & 0\\
454 & Malawi & 0 & & 458 & Malaysia & 0\\
462 & Maldives & 0 & & 466 & Mali & 0\\
470 & Malta & 0 & & 474 & Martinique & 0\\
478 & Mauritania & 0 & & 480 & Mauritius & 0\\
484 & Mexico & 0 & & 492 & Monaco & 0\\
496 & Mongolia & 0 & & 498 & Moldova, Republic of & 0\\
500 & Montserrat & 0 & & 504 & Morocco & 0\\
508 & Mozambique & 0 & & 512 & Oman & 0\\
516 & Namibia & 0 & & 520 & Nauru & 0\\
524 & Nepal & 0 & & 528 & Netherlands & 0\\
530 & Netherlands Antilles & 0 & & 533 & Aruba & 0\\
540 & New Caledonia & 0 & & 548 & Vanuatu & 0\\
554 & New Zealand & 0 & & 558 & Nicaragua & 0\\
562 & Niger & 0 & & 566 & Nigeria & 0\\
570 & Niue & 0 & & 574 & Norfolk Island & 0\\
578 & Norway & 0 & & 580 & Northern Mariana Islands & 0\\
581 & United States Minor Outlying Islands & 0 & & 583 & Micronesia, Federated States of & 0\\
584 & Marshall Islands & 0 & & 585 & Palau & 0\\
586 & Pakistan & 0 & & 591 & Panama & 0\\
598 & Papua New Guinea & 0 & & 600 & Paraguay & 0\\
604 & Peru & 0 & & 608 & Philippines & 0\\
612 & Pitcairn & 0 & & 616 & Poland & 0\\
620 & Portugal & 0 & & 624 & Guinea-Bissau & 0\\
626 & Timor-Leste & 0 & & 630 & Puerto Rico & 0\\
634 & Qatar & 0 & & 638 & Reunion & 0\\
642 & Romania & 0 & & 643 & Russian Federation & 0\\
646 & Rwanda & 0 & & 654 & Saint Helena & 0\\
659 & Saint Kitts and Nevis & 0 & & 660 & Anguilla & 0\\
662 & Saint Lucia & 0 & & 666 & Saint Pierre and Miquelon & 0\\
670 & Saint Vincent and the Grenadines & 0 & & 674 & San Marino & 0\\
678 & Sao Tome and Principe & 0 & & 682 & Saudi Arabia & 0\\
686 & Senegal & 0 & & 690 & Seychelles & 0\\
694 & Sierra Leone & 0 & & 702 & Singapore & 0\\
703 & Slovakia & 0 & & 704 & Viet Nam & 0\\
705 & Slovenia & 0 & & 706 & Somalia & 0\\
710 & South Africa & 0 & & 716 & Zimbabwe & 0\\
724 & Spain & 0 & & 732 & Western Sahara & 0\\
736 & Sudan & 0 & & 740 & Suriname & 0\\
744 & Svalbard and Jan Mayen & 0 & & 748 & Swaziland & 0\\
752 & Sweden & 0 & & 756 & Switzerland & 0\\
760 & Syrian Arab Republic & 0 & & 762 & Tajikistan & 0\\
764 & Thailand & 0 & & 768 & Togo & 0\\
772 & Tokelau & 0 & & 776 & Tonga & 0\\
780 & Trinidad and Tobago & 0 & & 784 & United Arab Emirates & 0\\
788 & Tunisia & 0 & & 792 & Turkey & 0\\
795 & Turkmenistan & 0 & & 796 & Turks and Caicos Islands & 0\\
798 & Tuvalu & 0 & & 800 & Uganda & 0\\
804 & Ukraine & 0 & & 807 & Macedonia, the former Yugoslav Republic of & 0\\
818 & Egypt & 0 & & 826 & United Kingdom & 0\\
831 & Guernsey & 0 & & 832 & Jersey & 0\\
833 & Isle of Man & 0 & & 834 & Tanzania, United Republic of & 0\\
840 & United States & 1380 & & 850 & Virgin Islands, U.S. & 0\\
854 & Burkina Faso & 0 & & 858 & Uruguay & 0\\
860 & Uzbekistan & 0 & & 862 & Venezuela & 0\\
876 & Wallis and Futuna & 0 & & 882 & Samoa & 0\\
887 & Yemen & 0 & & 891 & Serbia and Montenegro & 0\\
894 & Zambia & 0 & & & & \\
\bottomrule
\end{longtabu}

\end{document}
Binary file added tests/testthat/Example Dataset with Nets.pdf
Binary file not shown.
Loading

0 comments on commit a51cda7

Please sign in to comment.