Below are the solutions to these exercises for answering probability questions with simulation. #################### # # # Exercise 1 # # # #################### # Number of simulation. The higher this number is, the better our estimates. n <- 1e5L # Number of flips nflips <- 100L # How many in a row for a success […]

## Answer probability questions with simulation

Probability is at the heart of data science. Simulation is also commonly used in algorithms such as the bootstrap. After completing this exercise, you will have a slightly stronger intuition for probability and for writing your own simulation algorithms. Most of the problems in this set have an exact analytical solution, which is not the case […]

## Soccer data sparring: Scraping, merging and analyzing exercises

While understanding and spending time improving specific techniques, and strengthening indvidual muscles is important, occasionally it is necessary to do some rounds of actual sparring to see your flow and spot weaknesses. This exercise set forces you to use all that you have practiced: to scrape links, download data, regular expressions, merge data and then […]

## Soccer data sparring: Scraping, merging and analyzing Solutions

Below are the solutions to these exercises on Soccer data sparring: Scraping, merging and analyzing. #################### # # # Exercise 1 # # # #################### # Using package rvest library(rvest) # Webpage that contains links to the data page <- html("http://www.football-data.co.uk/germanym.php") ## Warning: ‘html’ is deprecated. ## Use ‘read_html’ instead. ## See help("Deprecated") # Get […]

## Protected: Back to basics, practice writing custom functions in R solutions

There is no excerpt because this is a protected post.

## Protected: Back to basics, practice writing custom functions in R

There is no excerpt because this is a protected post.

## Working with the xlsx package Exercises (part 2)

This exercise set provides (further) practice in writing Excel documents using the xlsx package as well as importing and general data manipulation. Specifically we have loops in order for you to practice scaling. A previous exercise set focused on writing a simple sheet with the same package, see here. We will use a subset of […]

## Working with the xlsx package solutions (part-2)

Below are the solutions to these exercises on working with the xlsx package. #################### # # # Exercise 1 # # # #################### # Install if necessary # install.packages(“xlsx”, dependencies = TRUE) # Load: require(xlsx) ## Warning: package ‘rJava’ was built under R version 3.3.2 #################### # # # Exercise 2 # # # #################### # […]

## Using the xlsx package to create an Excel file

Microsoft Excel is perhaps the most popular data anlysis tool out there. While arguably convenient, spreadsheet software is error prone and Excel code can be very hard to review and test. After successfully completing this exercise set, you will be able to prepare a basic Excel document using just R (no need to touch Excel […]

## Using the xlsx package to create an Excel file solutions

Below are the solutions to these exercises on creating an Excel file using the xlsx package. #################### # # # Exercise 1 # # # #################### install.packages(“xlsx”, dependencies = TRUE) require(xlsx) #################### # # # Exercise 2 # # # #################### wb <- createWorkbook(type = “xlsx”) #################### # # # Exercise 3 # # # […]