diff --git a/01-intro.Rmd b/01-intro.Rmd new file mode 100644 index 0000000..6b16e73 --- /dev/null +++ b/01-intro.Rmd @@ -0,0 +1,21 @@ +# Introduction {#intro} + +You can label chapter and section titles using `{#label}` after them, e.g., we can reference Chapter \@ref(intro). If you do not manually label them, there will be automatic labels anyway, e.g., Chapter \@ref(methods). + +Figures and tables with captions will be placed in `figure` and `table` environments, respectively. + +```{r nice-fig, fig.cap='Here is a nice figure!', out.width='80%', fig.asp=.75, fig.align='center'} +par(mar = c(4, 4, .1, .1)) +plot(pressure, type = 'b', pch = 19) +``` + +Reference a figure by its code chunk label with the `fig:` prefix, e.g., see Figure \@ref(fig:nice-fig). Similarly, you can reference tables generated from `knitr::kable()`, e.g., see Table \@ref(tab:nice-tab). + +```{r nice-tab, tidy=FALSE} +knitr::kable( + head(iris, 20), caption = 'Here is a nice table!', + booktabs = TRUE +) +``` + +You can write citations, too. For example, we are using the **bookdown** package [@R-bookdown] in this sample book, which was built on top of R Markdown and **knitr** [@xie2015]. diff --git a/02-literature.Rmd b/02-literature.Rmd new file mode 100644 index 0000000..00745d0 --- /dev/null +++ b/02-literature.Rmd @@ -0,0 +1,3 @@ +# Literature + +Here is a review of existing methods. diff --git a/03-method.Rmd b/03-method.Rmd new file mode 100644 index 0000000..93f03d8 --- /dev/null +++ b/03-method.Rmd @@ -0,0 +1,3 @@ +# Methods + +We describe our methods in this chapter. diff --git a/04-application.Rmd b/04-application.Rmd new file mode 100644 index 0000000..d5b076e --- /dev/null +++ b/04-application.Rmd @@ -0,0 +1,7 @@ +# Applications + +Some _significant_ applications are demonstrated in this chapter. + +## Example one + +## Example two diff --git a/05-summary.Rmd b/05-summary.Rmd new file mode 100644 index 0000000..c1ac36f --- /dev/null +++ b/05-summary.Rmd @@ -0,0 +1,3 @@ +# Final Words + +We have finished a nice book. diff --git a/06-references.Rmd b/06-references.Rmd new file mode 100644 index 0000000..b216bb7 --- /dev/null +++ b/06-references.Rmd @@ -0,0 +1,3 @@ +`r if (knitr::is_html_output()) ' +# References {-} +'` diff --git a/LCC.Rproj b/LCC.Rproj new file mode 100644 index 0000000..827cca1 --- /dev/null +++ b/LCC.Rproj @@ -0,0 +1,15 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +BuildType: Website diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce1d36d --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Libro Control Ciudadano + +Este libro es una recopilacion de los resultados que se lograron en el primer [Datatón de Control Ciudadano](https://github.com/SCRUG/DCC) organizado por el San Carlos R User Group. + +Esperamos que este sea la base para la organización (por el SCRUG y por otros) de mucho más datatones con datos de gobierno, y ademas que sea un forma util para divulgar los resultados. Todo depende de ti! Puedes participar leyendo, revisando, corrigiendo, añadiendo contenido. Y si algo te gusta sientete libre en divulgarlo para que se de a conocer. + +Todo el continido es propiedad del autor original. Hicimos copias de los resultados del dataton aqui [Datatón de Control Ciudadano](https://github.com/SCRUG/DCC) para acomodar formatos. + +Estas bienvenido a ayudar a escribir el libro. Puedes encontrar referencia sobre el formato R Markdown y **bookdown** (https://github.com/rstudio/bookdown) que usamos en linea en la pagina "Get Started" at https://bookdown.org/. Si buscas hay introducciones en español tambien en linea. diff --git a/_bookdown.yml b/_bookdown.yml new file mode 100644 index 0000000..df657c0 --- /dev/null +++ b/_bookdown.yml @@ -0,0 +1,5 @@ +book_filename: "LCC" +delete_merged_file: true +language: + ui: + chapter_name: "Chapter " diff --git a/_output.yml b/_output.yml new file mode 100644 index 0000000..ecc03da --- /dev/null +++ b/_output.yml @@ -0,0 +1,16 @@ +bookdown::gitbook: + css: style.css + config: + toc: + before: | +
  • A Minimal Book Example
  • + after: | +
  • Published with bookdown
  • + download: ["pdf", "epub"] +bookdown::pdf_book: + includes: + in_header: preamble.tex + latex_engine: xelatex + citation_package: natbib + keep_tex: yes +bookdown::epub_book: default diff --git a/book.bib b/book.bib new file mode 100644 index 0000000..f52f3d2 --- /dev/null +++ b/book.bib @@ -0,0 +1,10 @@ +@Book{xie2015, + title = {Dynamic Documents with {R} and knitr}, + author = {Yihui Xie}, + publisher = {Chapman and Hall/CRC}, + address = {Boca Raton, Florida}, + year = {2015}, + edition = {2nd}, + note = {ISBN 978-1498716963}, + url = {http://yihui.name/knitr/}, +} diff --git a/index.Rmd b/index.Rmd new file mode 100644 index 0000000..b19fa44 --- /dev/null +++ b/index.Rmd @@ -0,0 +1,34 @@ +--- +title: "A Minimal Book Example" +author: "Yihui Xie" +date: "`r Sys.Date()`" +site: bookdown::bookdown_site +documentclass: book +bibliography: [book.bib, packages.bib] +biblio-style: apalike +link-citations: yes +description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook." +--- + +# Prerequisites + +This is a _sample_ book written in **Markdown**. You can use anything that Pandoc's Markdown supports, e.g., a math equation $a^2 + b^2 = c^2$. + +The **bookdown** package can be installed from CRAN or Github: + +```{r eval=FALSE} +install.packages("bookdown") +# or the development version +# devtools::install_github("rstudio/bookdown") +``` + +Remember each Rmd file contains one and only one chapter, and a chapter is defined by the first-level heading `#`. + +To compile this example to PDF, you need XeLaTeX. You are recommended to install TinyTeX (which includes XeLaTeX): . + +```{r include=FALSE} +# automatically create a bib database for R packages +knitr::write_bib(c( + .packages(), 'bookdown', 'knitr', 'rmarkdown' +), 'packages.bib') +``` diff --git a/preamble.tex b/preamble.tex new file mode 100644 index 0000000..dfd2e14 --- /dev/null +++ b/preamble.tex @@ -0,0 +1 @@ +\usepackage{booktabs} diff --git a/style.css b/style.css new file mode 100644 index 0000000..f317b43 --- /dev/null +++ b/style.css @@ -0,0 +1,14 @@ +p.caption { + color: #777; + margin-top: 10px; +} +p code { + white-space: inherit; +} +pre { + word-break: normal; + word-wrap: normal; +} +pre code { + white-space: inherit; +}