Now that we have gone through the sales data simulation and we have the necessary fundamentals, the rest of the data simulation will be much easier. Furthermore, we will use many of the functions we created before to simulate the client and client messages data, which is great! Reusing functions like this is very efficient, and over time you will get into the habit of doing so. You will build your own collection of reusable code, which will make you increasingly more efficient when programming.
We start by defining the data frame we will use, just as we did before. In this case we will have the CLIENT_ID, BIRTH_DATE, CLIENT_SINCE, GENDER, and STARS variables. The STARS represent a rating between 1 (bad) and 5 (excellent):
gender_levels <- c("FEMALE", "MALE")
star_levels <- c("1", "2", "3", "...