How can I write R codes that other people can understand and use? In the exercises below we cover some of the best practices while writing a small piece of R code or a full automated script. These are some of the practices which should be kept in mind while coding, trust me it will […]

## If else sequences Exercises

Answers to the exercises are available here. Exercise 1 What is the output of: ifelse(sqrt(9)<2,sqrt(9),0) Exercise 2 What is the output of: ifelse(sqrt(100)>9,sqrt(100),0) Exercise 3 What is the output y of: x=12 if(is.numeric(x)) y=x*2 Exercise 4 What is the output x,y of: z=-1 if(z<0){x=abs(z);y=z*3} Exercise 5 What is the output y of: z=6 if(z<0) y=z*3 […]

## Descriptive Analytics-Part 4 : Data Manipulation

Descriptive Analytics is the examination of data or content, usually manually performed, to answer the question “What happened?”. In order to be able to solve this set of exercises you should have solved the part 0, part 1, part 2 ,and part 3 of this series but also you should run this script which contain […]

## Bonus: Timeseries modelling (part 1)

We just added this week’s set of bonus exercises! Bonus exercises are weekly exercises sets, available to subscribers to our weekly newsletter. Please sign up using the form on the right, and receive further details by email how to download the bonus exercises (and solutions, of course). This and next week’s bonus exercises aim to […]

## Nonparametric Tests Exercises

In this set of exercises you will be presented with real-life problems in marketing. Your task will be to choose appropriate nonparametric statistical technique and solve the problem using appropriate R functions. Answers to the exercises are available here. Exercise 1 A company wants to learn if sales income is equaly distributed among the stores. […]

## Generating Data Exercises

Let’s make data R is good a making simulated data sets. These data sets are useful for learning programming. Instead of having to spend all your time cleaning up your data you have data ready to use for learning how to program. The data that will be generated here will be about cats, toys and […]

## Vectors Vol. 2 Exercises

[For this exercise, first write down your answer, without using R. Then, check your answer using R.] Answers to the exercises are available here. Exercise 1 Consider two vectors, x, y x=c(4,6,5,7,10,9,4,15) y=c(0,10,1,8,2,3,4,1) What is the value of: x*y Exercise 2 Consider two vectors, a, b a=c(1,2,4,5,6) b=c(3,2,4,1,9) What is the value of: cbind(a,b) Exercise […]

## Sampling Exercise Part 1

In this Exercise, we will dive quickly through some basic sampling methods. Follow along this series to use these methods later for our decision trees modelling exercise. We will sample using the package caTools and caret. This is a beginner level exercise. Please refer to the help section for set.seed(), sample.split(),createDataPartition(), and createFolds() functions. You […]

## Bonus: Rebuild a figure (step-by-step)

We just added this week’s set of bonus exercises! Bonus exercises are weekly exercises sets, available to subscribers to our weekly newsletter. Please sign up using the form on the right, and receive further details by email how to download the bonus exercises (and solutions, of course). This week’s bonus exercises aim to practise building […]

## Come tell us what you want!

Welcome! We are making this post today to address a burning question in our minds. And you can help us with! We just expanded our author team for creating exercise sets once more. One of our goals is to deliver content that you really want to practice with and incorporate in your daily R work […]