
Learn to import, structure, query, and clean data using data.table, reshape, and the TDR package; compare data.frame, data.table, and tidy formats, and master mutating and filtering joins.
Discover a practical roadmap for data management and cleaning, covering data import, preprocessing, outlier detection, missing data handling, dates and times, and text manipulation using R and add-on packages.
Define data preprocessing as shaping data between collection and analysis, emphasizing tidy data and class-aware steps. Learn import, class selection, cleaning, missing data imputation, outlier detection, and querying.
Apply a practical R data preprocessing workflow using the lower sales data set: import, clean, convert types, fuse names, handle outliers and missing values, and query insights with data.table.
Import data into R studio using standard csv formats with base and reader interfaces, adjust delimiters and encoding, and copy-paste snippets with the can function.
Explore how the fread function from data.table speeds importing big data in R, auto detects separators, returns a data.table, and supports clipboard paste and optional data.frame class.
Choose among data frame, data table, and data underscore frame to store and manipulate data; data table offers faster, lower-code operations, while data underscore frame enforces equal lengths.
Access the exercise database at Mianus Tutorials Dotcom, featuring blocks of 10 R questions on functions, data, frame handling, and graphs you can open and work on.
Learn how tidy data looks and how to clean a new data frame after import using tidyr to switch between wide and long formats and ensure one variable per column.
Convert a wide data set to long form in R using gather or melt, turning header columns into a single weight column with counts for each region.
Split a mixed biometrics column into hate and sex using the separate function after the third position. Rely on an equal-length pattern and fixed splitting points to simplify analysis.
Convert long form data to wide form by spreading the performance column into top and low counts using the spread function (TTR) or diecast, with optional fills for missing values.
Discover the data.table package as an advanced, faster alternative to data frames for pre-processing, manipulation, and querying in R, with an SQL-like i, j, by structure.
Learn to compare data.frame and data.table objects, set up test data, and use bracket-based querying to retrieve rows or columns in R.
Extract and rename column data in data.table using j and dot notation; compare list vs dot shorthand, count with .N, and filter with i or subset for data.frame equivalents.
Master the by parameter in data.table to group and summarize data, using i and j to sum column c for selected rows and count with .N.
Set keys in data.table to order and query data by a multi-column key. Transform row IDs into a sortable reference and learn to index and search by key in R.
Work with data.table on the diamonds dataset from ggplot2, converting to newdiam and solving exercises on price, color, cut, and data.table versus data.frame.
Explore data.table solutions in R for data pre-processing and data management, including counting diamonds with price greater than 10.000, grouping by color, and filtering by cut.
Develop skills in queries, filtering, and subsetting using the DataDot frame and data table systems for core data science tasks at entry-level roles.
Explore data frames through hands-on exercises on subsetting, filtering, and reformatting variables using iris and diamonds datasets, with guidance on data frame classes and base R functionality.
Explore hands-on data wrangling with iris and empty cars: subset and filter rows by species, compute sepal length–width differences, convert classes, and apply rep and round for clean data.
Explore data pre-processing in R with the diamonds data: filter by clarity and depth, count observations, convert to data frame or tibble, and use table-based extractions for targeted views.
Explore 10 practical data.table exercises in R to master fast data manipulation, subsetting, column operations, and key-based queries on the college data set.
Learn data.table techniques for pre-processing the college data set: convert to data table, subset, compute enrollment ratios, and reorder columns with set.
Master data.table techniques to add and remove columns, create a high-interest marker for APS over 10,000, and perform fast counts, subsetting, and ordering using keys and by.
Explore the deployer package and its five single table verbs—filter, arrange, select, mutate, and samurais—to manage tidy data frames with efficient storage and direct column references.
Learn how two-table mutating joins and filtering joins in R combine data frames by common keys, including inner, left, right, and full joins, with practical examples.
Explore filtering joins in R using inner_join, semi join, and anti join to control row matching and keep data from the first data frame, with by for mismatched column names.
Explore set operations with two data frames using union, intersect, and setdiff in the Deployer package, showing how identical structure enables inner, outer, left, and right joins on tidy data.
Explore how the deployer package translates R code to sql for Escorial database via translate_underscore. Compare numeric versus integer, object versus string, and boolean concepts as they convert to sql.
Learn to run sql-like queries inside R to filter the diamonds data frame, selecting carat > 3 and combining carat > 2.5 with color or x > 4.1.
Set up an on-machine SQLite database in R with the CircuLite package, load the diamonds dataset, and create and query the table with prices and colors.
Identify how outliers influence results, apply three-sigma and box-plot rules, and compare model-based and proximity-based multivariate detection methods for clear visualization.
Identify outliers in univariate data using simple methods like the esd interval and box plot statistics, then validate with the Dixon and graps test from the outliers package.
Detect outliers in multivariate data using sign one, sign two, and pick out methods that rely on PCA and covariance matrices, with practical R tools.
Learn to handle strings in R, define text data, and use base functions to lower, upper, and split, with regular expressions for text mining and data cleaning.
Explore the gsub and sub family of functions in R to perform pattern-based substitutions, ignore case, and manipulate strings, including removing numbers and spaces with regular expressions.
Master regular expressions syntax in R to match digits, spaces, words, and punctuation, using brackets, quantifiers, and replacements to clean text and remove nongraphic characters.
Explore the stringer package for string manipulation in r, using sdr_ functions to concatenate strings, count occurrences, locate positions, and perform replace and replace all operations.
Practice using regular expressions and a global substitute in R to clean strings, converting to lowercase, removing punctuation, spaces, and the euro sign, then extract the pattern is with str_extract_all.
Master time series management by standardizing date formats, handling time zones and units, and importing series from Excel, using the lubricant package in tidy reverse.
Import a monthly time series from Excel by cleaning headers and ensuring a data vector in R with scan, then create ts with start and frequency and plot to verify.
Compare base date-time tools in R, including POSIXct and POSIXlt and the Date class, with chron and lubridate to manage time zones, leap years, and seconds efficiently.
Install and activate the lubricate package to input dates in y, ymd, and dmy. Create time points with UTC or Central European Time, extract minute and day, and adjust hours.
Use lubridate's W Day function to identify the weekday and display the day name with label, then translate time points between zones and create intervals with interval and class interval.
Create a three-column data frame in R with date, time, and measurement using lubridate, explore multiple time input formats, and bind columns into a cohesive data frame.
Learn to perform time calculations with lubridate, handling minutes, seconds, and durations, and compare the years command with duration_years to understand leap year behavior.
Practice lubridate data handling by creating time points with year, month, day, and hour, adjusting minutes, and comparing Central European Time with London's Greenwich Mean Time to compute differences.
Explore the exercise database at Mianus Tutorials, organized in blocks of ten questions on topics like functions, data, frame handling, and graphs. Complete questions and outputs first to avoid cheating.
Let’s get your data in shape!
Data Pre-Processing is the very first step in data analytics. You cannot escape it, it is too important. Unfortunately this topic is widely overlooked and information is hard to find.
With this course I will change this!
Data Pre-Processing as taught in this course has the following steps:
1. Data Import: this might sound trivial but if you consider all the different data formats out there you can imagine that this can be confusing. In the course we will take a look at a standard way of importing csv files, we will learn about the very fast fread method and I will show you what you can do if you have more exotic file formats to handle.
2. Selecting the object class: a standard data.frame might be fine for easy standard tasks, but there are more advanced classes out there like the data.table. Especially with those huge datasets nowadays, a data.frame might not do it anymore. Alternatives will be demonstrated in this course.
3. Getting your data in a tidy form: a tidy dataset has 1 row for each observation and 1 column for each variable. This might sound trivial, but in your daily work you will find instances where this simple rule is not followed. Often times you will not even notice that the dataset is not tidy in its layout. We will learn how tidyr can help you in getting your data into a clean and tidy format.
4. Querying and filtering: when you have a huge dataset you need to filter for the desired parameters. We will learn about the combination of parameters and implementation of advanced filtering methods. Especially data.table has proven effective for that sort of querying on huge datasets, therefore we will focus on this package in the querying section.
5. Data joins: when your data is spread over 2 different tables but you want to join them together based on given criteria, you will need joins for that. There are several methods of data joins in R, but here we will take a look at dplyr and the 2 table verbs which are such a great tool to work with 2 tables at the same time.
6. Integrating and interacting with SQL: R is great at interacting with SQL. And SQL is of course the leading database language, which you will have to learn sooner or later as a data scientist. I will show you how to use SQL code within R and there is even a R to SQL translator for standard R code. And we will set up a SQLite database from within R.
7. Outlier detection: Datasets often contain values outside a plausible range. Faulty data generation or entry happens regularly. Statistical methods of outlier detection help to identify these values. We will take a look at the implemention of these.
8. Character strings as well as dates and time have their own rules when it comes to pre-processing. In this course we will also take a look at these types of data and how to effectively handle it in R.
How do you best prepare yourself for this course?
You only need a basic knowledge of R to fully benefit from this course. Once you know the basics of RStudio and R you are ready to follow along with the course material. Of course you will also get the R scripts which makes it even easier.
The screencasts are made in RStudio so you should get this program on top of R. Add on packages required are listed in the course.
Again, if you want to make sure that you have proper data with a tidy format, take a look at this course. It will make your analytics with R much easier!