
Begin your step-by-step, spiral-learning journey in R programming with a guided tour from installing R and R Studio to mastering vectors, matrices, and data frames through real-world problems.
Install R and R Studio on Mac or Windows from cran.r-project.org, customize preferences and appearance in R Studio, and run a hello world script to begin learning.
Our page layout has changed. You can download the CSV directly with this link: https://sds.courses/cm/mispriced-diamonds
Learn the core programming principles universal across languages to build a strong foundation before diving into R for data science. Follow the code or skip if you're already comfortable.
Discover the five atomic data types in R: integer, double, complex, character, and logical, and learn to assign and inspect them with the assignment operator and type of.
Learn to create and manipulate variables in R, perform arithmetic and function calls, print results, and handle character strings with paste.
Learn how to use logical variables and operators in R, including true/false values, comparisons, not, or, and, and storing results in a variable.
Learn how the while loop works in R, including its syntax, a logical expression, and the loop body. See how to avoid infinite loops and build a counter example.
Use the console in R Studio to run code, print variables, and see how script lines copy to the console for execution, with saving files for reproducibility.
Master the for loop in R and compare it with the while loop, using vectors like 1:5 to drive iteration and print phrases such as Hello R.
Learn how to use if, else, and else if in R to branch code, nest and chain conditions, and apply to a random number example.
Explore core R data types: integer, double, boolean, and character; learn loops, if statements, and random normal variables for hands-on practice.
Apply the law of large numbers in an R homework by generating standard normal data and counting values between -1 and 1 to compare the sample mean with 68.2 percent.
Explore the fundamentals of R, focusing on vectors, vectorized operations, functions, and packages, and learn how R's math-oriented design shapes your analytical workflow.
Explore how a vector is a sequence of data elements of the same type, a numeric vector. In R, indexing starts at 1; single number is stored as a vector.
Create and inspect vectors in R using c, sequence, and replicate; explore numeric, integer, and character types, type checks with is.numeric, is.integer, and is.double, and data type rules.
Master vector indexing in R by using square brackets to access single or multiple elements, exclude items with negative indices, and combine indices with the c() function for flexible selection.
Explore vectorized operations in R: perform element-wise math and boolean comparisons, understand vector recycling and function arguments, and see why vectors are the language's building blocks.
Explore the power of vectorized operations in R and compare them to de-vectorized approaches, showing how vectorization delivers speed and shorter, clearer code.
Explore how functions in R take inputs, perform operations, and return outputs. See examples of rnorm, sequence, and replicate, learn about default values, named parameters, and the help system.
Explore how R packages extend functionality by providing functions, data, and prepackaged sample data; install from CRAN, activate with library, and use for plotting with ggplot2 and diamonds data set.
Review the fundamentals of R: vectors, their single-type constraint, and creation tools c, seq, and rep, plus type checks like is.numeric and is.character, and indexing with brackets.
Use R to compute monthly profit, after-tax profit (30% tax), and profit margin; identify good and bad months by yearly mean, and the best and the worst months.
Analyze trends of the top ten NBA players' performance, noting when stats rise or fall and injuries. Learn matrices as a representation of tables and a stepping stone to DataFrame.
Analyze the NBA's top-10 paid players' salaries and performance over the past decade using a prepared data set, and learn to work with matrices in R Studio.
Explore how matrices store two-dimensional data in R, learn row and column indexing like A[3,4], and see why uniform data types prepare you for data frames.
Learn to build matrices in R with matrix, rbind, and cbind, populating by rows or columns from vectors, and index rows and columns.
Explore naming dimensions in R by naming matrix rows and columns and accessing elements by their names. Learn to create named vectors and use quotation marks to retrieve elements.
Explore how to create and manipulate named vectors and matrices in R using names, row names, and column names, and learn to assign, query, and clear names with practical examples.
Learn matrix operations in R with a basketball data set: access named matrices, divide one matrix by another to compute field goals per game and minutes per game.
Learn to visualize data in R with matplot, transpose matrices, and apply color legends to compare players. Explore plotting options and compute field goal accuracy by dividing goals by attempts.
Master R subsetting with square brackets for vectors and matrices, including selecting rows and columns. Learn to use drop = false to preserve matrix dimensions and avoid unintended vectors.
Use subsetting to decide what to visualize in R, keep a matrix for matplot with drop = false, and show minutes played for top players.
Create your first function in R to encapsulate code, add parameters for rows and data, and set a default so you can flexibly visualize minutes played across players.
Draw insights from nba data using r by subsetting data and plotting with matplot to compare salaries and field goals per game. Normalize per-game metrics to reveal trends.
Explore how matrices represent tabular data in R, using matrix, rbind, and cbind, with named dimensions and subsetting, then visualize with matplot and transpose, and practice with basketball data insights.
Turn vectors into matrices in R to analyze basketball free throws and free throw attempts. Visualize accuracy and playing style with plots that exclude free throws.
Master data frames in R as a flexible alternative to matrices, accommodating mixed types like numeric, character, and logical data. Learn to import data into tables for big analytics.
Visualize birth rate and internet usage across countries with a scatter plot, categorized by income group, using the demographic data set.
Learn to import data into R studio using two methods: file choose with read.csv and setting a working directory with getwd and setwd, including reading demographic_data.csv.
Explore your dataset in R with nrow, head, tail, str, and summary to inspect a 195-row by 5-column data frame, including country name, country code, birth rate, and internet users.
Discover how the dollar sign accesses data frame columns in R, extract a column as a vector, compare with bracket indexing, and use levels on a column like income group.
Explore basic data frame operations in R, including subsetting rows and columns with the dollar sign, adding and removing columns, vectorized operations, and preserving data frame structure.
Filter data frames in R by rows with true/false vectors and conditional expressions to reveal Malta's country-specific insights on birth rate, internet users, and income group.
Explore visualizing data in R with qplot from ggplot2, map data frames with data=, and control aesthetics using I() to create plots and box plots.
Visualize internet users versus birth rate using qplot in R; color points by income group and adjust size to reveal trends in a scatter plot across income levels.
Create data frames from vectors in R using the data frame function and directly name columns; learn to inspect with head, tail, and summary, and employ cbind and rbind techniques.
Merge two data frames in R with the merge function, bringing region from mydf into stats by country code and removing duplicates to create a unified frame.
Explore visualizing data with qplot in ggplot2 by mapping region to color, adjusting shapes and alpha, and adding a title for internet users versus birth rate in merged data frame.
Recap the essentials of data frames in R: importing with read_csv, exploring with head and summary, and basic operations like filtering, merging, and using the dollar sign.
Create two R scatterplots of life expectancy versus fertility rate by country, for 1960 and 2013, using csv and R vector data and code-based data manipulation for audit trails.
Explore advanced visualization in R using ggplot2, the main function for flexible, powerful charts, as we move from base graphics to ggplot2 in this course.
Visualize the movie ratings dataset from 2007–2011, comparing critics and audience ratings, budgets, and genres, while building five graphs and a genre-level correlation over time in R.
Discover the grammar of graphics with ggplot2, mastering the seven layers—data, aesthetics, geometries, statistics, facets, coordinates, and theme—to build insightful charts.
Learn how to work with factors in R by converting columns to factors, understanding levels, and turning year into a factor for grouping and analysis.
Explore the aesthetics layer in ggplot2 by mapping critic ratings to x and audience ratings to y with aes, then add geom_point, color by genre, and size by budget.
Learn to plot with layers in ggplot by building a base plot object with data and aesthetics, then overlay geoms like geom_point and geom_line to create layered visualizations.
Override aesthetics in ggplot with mapping and setting, using geom_point to adjust x, y, color, and size. Learn to update axis labels with xlab and to distinguish mapping from setting.
Demonstrates mapping vs setting in ggplot2, teaching how aes() maps color to a variable while setting uses a fixed color, with practical tips and pitfalls.
Explore histograms and density charts in R using ggplot, learn binwidth control, aesthetic mapping of fill to genre, add borders, and compare histogram statistics with density plots.
Master starting layer tips for ggplot in R as you build histograms, compare setting versus mapping aesthetics, and learn when to use skeleton plots.
Explore statistical transformations in R with geom_smooth to reveal trends under overplotting, and learn to combine box plots with jitter for clearer, layered visualizations.
Explore how to create and facet ggplot visualizations in r using facets, facet_grid, and scales=free, building from histograms to scatter plots with budget, genre, year, and smooth trends.
Explore ggplot coordinates, apply limits and zoom with xlim, ylim, and cartesian layers, and learn how these controls affect the plotted data.
Master ggplot theming to enhance non-data ink, axis labels, legend placement, and plot titles, transforming a histogram of movie budgets by genre into a polished, presentation-ready chart.
Recap ggplot2 basics, including grammar of graphics, layers, aesthetics, and mapping versus setting, applied to movie data. Review factors, histograms, density charts, facets, coordinates, themes, and key statistical transformations.
Recreate the chart in R using a boxplot with jitter, showing genre on the x-axis and US gross percentage on the y-axis.
Apply the law of large numbers in R by generating normal samples with rnorm, counting values between -1 and 1, and measuring convergence to 0.682 as N grows.
Calculate profit, tax, and profit after tax from revenue and expenses; use vectors to determine profit margin and good months based on mean; present results in thousands with rounding.
Learn r programming for data science by building matrices with rbind, computing free throw accuracy and attempts per game, and visualizing player style excluding free throws.
Load and prepare the data in R, split by year, and merge life expectancy with fertility rate to compare 1960 and 2013 world trends; visualize with qplot by region.
Recreate a genre-versus-gross visualization in R using ggplot2 by importing data, selecting genre, studio, budget, and the gross percentage us, and applying filters to the top genres and studios.
Create a layered ggplot visualization of movie domestic gross by genre, combining box plots and jitter, mapping genre and gross percentage US while refining with budget, studio, and theme.
Celebrate completing the course with a thank you video set in Tasmania, featuring Cradle Mountain and Crater Lake, and invite others to rate and review to help learn data science.
Analyze how box plots are constructed, including min, max, quartiles, median, and outliers using the 1.5x iqr rule, and compare distributions to interpret variance and skewness in data.
Learn R Programming by doing!
There are lots of R courses and lectures out there. However, R has a very steep learning curve and students often get overwhelmed. This course is different!
This course is truly step-by-step. In every new tutorial we build on what had already learned and move one extra step forward.
After every video, you learn a new valuable concept that you can apply right away. And the best part is that you learn through live examples.
This training is packed with real-life analytical challenges which you will learn to solve. Some of these we will solve together, some you will have as homework exercises.
In summary, this course has been designed for all skill levels and even if you have no programming or statistical background you will be successful in this course!
I can't wait to see you in class,
What you will learn:
Learn how to use R Studio
Learn the core principles of programming
Learn how to create vectors in R
Learn how to create variables
Learn about integer, double, logical, character, and other types in R
Learn how to create a while() loop and a for() loop in R
Learn how to build and use matrices in R
Learn the matrix() function, learn rbind() and cbind()
Learn how to install packages in R
Sincerely,
Kirill Eremenko