Coder Social home page Coder Social logo

datahandling's Introduction

About

Lecture materials for the SEPS-HSG (University of St. Gallen) course 'Data Handling: Import, Cleaning and Visualisation' (BA, Major in Economics). The materials consist of two parts:

  • Lecture notes: materials/notes/
  • Lecture slides: materials/slides/

Additional materials related to notes and slides:

  • Sourcecode of examples used in slides/notes: materials/sourcecode/
  • Images used in slides/notes: materials/img
  • References used in slides/notes: materials/references

Code and data:

  • code/ contains r-scripts with additional examples as well as utility functions to curate/maintain and compile the lecture materials.
  • data/ contains data files used in the code examples.

How to contribute

  • Open issues:
    • report bugs and typos
    • suggest enhancements
  • Resolve open issues with a pull request
  • Contribute to the wiki

Prerequisites

install.packages("tidyverse")
install.packages("knitr")
install.packages("bookdown")
install.packages("pacman")
install.packages("qdapRegex")

As well as all the packages used in the code examples.


# get a list of all rmd files (slides and notes)
notes_files <- list.files("materials/notes", pattern = "\\.Rmd", full.names =TRUE)
slides_files <- list.files("materials/slides", pattern = "\\.Rmd", full.names = TRUE)
all_files <- c(notes_files, slides_files)

# parse the rmds, extract a list of package dependencies
rmds <- lapply(all_files, readLines)
to_install <- lapply(rmds, qdapRegex::rm_between, 
                     left = c("library(", "require("),
                     right = c(")", ")"),
                     extract = TRUE)
to_install <-  unique(na.omit(unlist(to_install)))
to_install <- to_install[! to_install %in% c("PACKAGE-NAME",  "<PACKAGE NAME>")]

# install all missing packages
pacman::p_load(char = to_install)

In addition to the standard pandoc installation (should be installed with RStudio) you will have to install the pandocfilters library (in OSX: pip install --user pandocfilters).

Compilation of materials

Run the following in the terminal:

sh makeall_datahandling.sh

This tests all the R code, compiles notes as html (materials/notes/html) and pdf (materials/notes/pdf), slides as html/ioslides (materials/slides/html), and outputs the sourcecode of code examples in the notes to an R script (materials/sourcecode).

Error messages

In case you are confronted with an error message of the type "pandoc document conversion failed" and you still see a tex file that is generated before the knitting process stopped, then do the following: open the tex file in RStudio, run it and install the latex packages that are suggested.

datahandling's People

Contributors

umatter avatar mbachli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.