Skip to Content
R Programming By Example
book

R Programming By Example

by Omar Trejo Navarro
December 2017
Beginner to intermediate
470 pages
12h 29m
English
Packt Publishing
Content preview from R Programming By Example

Simulating the sales data

Enough concepts; let's start programming. To get a clear idea of where we're heading, we start by initializing the sales data frame we will be using, with zero observations for now. We do so by defining the available categories for each factor variable, and defining empty values with the data type we need for each variable. As you can see, it has the identifiers SALE_ID and CLIENT_ID, which will allow us to link this data with the one from clients and client_messages. To understand this, let's have a look at the following code:

status_levels <- c("PENDING", "DELIVERED", "RETURNED", "CANCELLED")protein_source_levels <- c("BEEF", "FISH", "CHICKEN", "VEGETARIAN")continent_levels <- c("AMERICA", "EUROPE", "ASIA")delivery_levels ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Efficient R Programming

Efficient R Programming

Colin Gillespie, Robin Lovelace
R Programming

R Programming

Jared P. Lander

Publisher Resources

ISBN: 9781788292542Supplemental Content