Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Advanced R
Rating: 4.3 out of 5(82 ratings)
772 students
Last updated 3/2017
English

What you'll learn

  • Build R packages
  • Write C++ code in R via Rcpp
  • Do complex date parsing
  • Profile and benchmark their programs
  • Build parallel code
  • Parse complex text via Regex
  • And much more!

Course content

8 sections19 lectures4h 41m total length
  • Introduction4:29

    Brief introduction to this course

  • Creating Packages19:55

    Once we develop our R code, we would ideally like to encapsulate our code. In that fashion, we can distribute it in a more efficient way (since we will just create one compressed file), we can upload it to the CRAN servers, and we can properly document our functions. 

    Finding our code in the future will certainly be much easier, and understanding what each function does will be trivial, since we will be able to access the documentation via the help() function.

    In this lecture we discuss how to write R packages, how to install pdflatex, what are the common problems, and how to use package.skeleton(). We use all this steps to create a real package that we then install from a file.

  • Packages
  • Functionals and closures12:27

    R functions can both accept functions are arguments, and return functions as outputs. We discuss how to code functions that build functions, and how to pass functions to functions.

    You would not be surprised to know that the well known function apply(), uses those concepts. In fact we will reuse this concept of passing functions as arguments in a much more advanced Section: Rcpp and high performance R-C++ computing, when we will pass R functions to C++ code.

    We finally explain how can R keep references from the functions to the variables that exist in same workspace where those functions live. 

  • Functionals
  • Environments19:58

    Imagine you would like to encapsulate several variables and functions into a common workspace. The advantages could be potentially interesting because, you will end up with more organized code. You will also be able to invoke that workspace and use the variable values that you have there. 

    Environments in R are designed for that, and are quite useful for protecting a subspace of your workplace from the rest of the code. They end up being extensively in packages, but their utility needs not be restricted to that

  • Environments

Requirements

  • A few weeks experience with R is absolutely necessary, and ideally some months of experience would be better
  • Being able to code functions, manipulate data, and be comfortable writing complex R code
  • Some experience with other programming languages (such as Python - Java) would be beneficial, but it is not necessary

Description

This course is intended for R and data science professionals aiming to master R. Intermediate and advanced users, will both find that this course will separate them from the rest of people doing analytics with R. We don't recommend this course on beginners.

We start by explaining how to work with closures, environments, dates, and more advanced topics. We then move into regex expressions and parsing html data. We explain how to write R packages, and write the proper documentation that the CRAN team expects if you want to upload your code into R's libraries.  After that we introduce the necessary skills for profiling your R code. We then move into C++ and Rcpp, and we show how to write super fast C++ parallel code that uses OpenMP. Understanding and mastering Rcpp will allow you to push your R skills to another dimension. When your colleagues are writing R functions, you will be able to get Rcpp+OpenMP equivalent code running 4-8X times faster. We then move into Python and Java, and show how these can be called from R and vice-versa. This will be really helpful for writing code that leverages the excellent object oriented features from this pair of languages. You will be able to build your own classes in Java or Python that store the data that you get from R. Since the Python community is growing so fast, and producing so wonderful packages, it's great to know that you will be able to call any function from any Python package directly from R. We finally explain how to use sqldf, which is a wonderful package for doing serious, production grade data processing in R. Even though it has its limitations, we will be able to write SQL queries directly in R. We will certainly show how to bypass those limitations, such as its inability to write full joins using specific tricks. 

All the code (R,JAVA,C++,.csv) used in this course is available for download, and all the lectures can be downloaded as well. Our teaching strategy is to present you with examples carrying the minimal complexity, so we hope you can easily follow each lecture. In case you have doubts or comments, feel free to send us a message


Who this course is for:

  • Intermediate and advanced R users
  • Basic R users (with a few weeks of experience) can also take this course. They might find some parts difficult, specially if they lack programming experience