Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Extra Fundamentals of R
Rating: 4.2 out of 5(22 ratings)
1,542 students

Extra Fundamentals of R

Understanding R graphics, how to set up "real-world" simulations, and how to process non-numeric character and text in R
Last updated 7/2020
English

What you'll learn

  • Understand and use the base, lattice and ggplot graphics systems in R.
  • Be able to simulate many 'real-world' and practical "what-if" scenarios to determine likely outcomes.
  • Have a though understanding of, and ability to effectively use, the text and string variable processing capabilities in R.
  • Know how to use and implement R's text-based "regular expression" features and functions.

Course content

8 sections66 lectures12h 20m total length
  • Introduction1:35
  • Comparing Base and GGPlot2 Graphics15:15

    One of the greatest strengths of the R language is surely the base graphics capabilities. Grid graphics, lattice, ggplot2, and the many R packages that interface with javascript D3graphics have added astounding capabilities, well beyond what can be achieved with base graphics alone. Nevertheless, the quick, one line, base graphics plots ( like plot() ) are a tremendous aid to data exploration, and are responsible for a good bit of the "flow" of an R session.

  • Continue Graphics Capabilities and Comparisons7:25

    ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and none of the bad parts. It takes care of many of the fiddly details that make plotting a hassle (like drawing legends) as well as providing a powerful model of graphics that makes it easy to produce complex multi-layered graphics.

  • More Graphics Capabilities and Comparisons15:05

    Graphical Parameters

    You can customize many features of your graphs (fonts, colors, axes, titles) through graphic options.

    One way is to specify these options in through the par( ) function. If you set parameter values here, the changes will be in effect for the rest of the session or until you change them again. The format ispar(optionname=value, optionname=value, ...)

    # Set a graphical parameter using par()<br> <br> par() # view current settings<br> opar <- par() # make a copy of current settings<br> par(col.lab="red") # red x and y labels <br> hist(mtcars$mpg) # create a plot with these new settings <br> par(opar) # restore original settings

    A second way to specify graphical parameters is by providing the optionname=value pairs directly to a high level plotting function. In this case, the options are only in effect for that specific graph.

    # Set a graphical parameter within the plotting function <br> hist(mtcars$mpg, col.lab="red")

    See the help for a specific high level plotting function (e.g. plot, hist, boxplot) to determine which graphical parameters can be set this way.

  • Adding Text to Graphics7:09
  • Mathematical and Drawing Functions11:03

Requirements

  • Students will need to install the no-cost R console and the no-cost RStudio application (instructions and provided).

Description

Extra Fundamentals of R is an extension of the Udemy course Essential Fundamentals of R. Extra Fundamentals of R introduces additional topics of interest and relevance utilizing many specific R-scripted examples. These broad topics include:

(1) Details on using Base, GGPlot and Lattice graphics;

(2) An introduction to programming and simulation in R; and

(3) Character and string processing in R.

All materials, scripts, slides, documentation and anything used or viewed in any one of the video lessons is provided with the course. The course is useful for both R-novices, as well as to intermediate R users. Rather than focus on specific and narrow R-supported skill sets, the course paints a broad canvas illustrating many specific examples in three domains that any R user would find useful. The course is a natural extension of the more basic Udemy course, Essential Fundamentals of R and is highly recommended for those students, as well as for other new students (and for practicing professionals) interested in the three domains enumerated above.

Base, GGplot and Lattice (or "trellis) graphics are the three principal graphics systems in R. They each operate under different "rules" and each present useful and often brilliant graphics displays. However, each of these three graphics systems are generally designed and used for different domains or applications.

There are many different programming and simulation scenarios that can be modeled with R. This course provides a good sense for some of the potential simulation applications through the presentation of 'down-to-earth,' practical domains or tasks that are supported. The examples are based on common and interesting 'real-world' tasks: (1) simulating a game of coin-tossing; (2) returning Top-Hats checked into a restaurant to their rightful owners; (3) collecting baseball cards and state quarters for profit: (4) validating whether so-called "streaky" behavior, such as have a string of good-hitting behavior in consecutive baseball games, is really unusual from a statistical point of view; (4) estimating the number of taxicabs in a newly-visited city; and (5) estimating arrival times for Sam and Annie at the Empire State Building ("Sleepless in Seattle").

R is likely best known for the ability to process numerical data, but R also has quite extensive capabilities to process non-quantitative text (or character) and string variables. R also has very good facilities for implementing powerful "regular expression" natural-language functions. An R user is bested served with an understanding of how these text (or character) and string processing capabilities "work."

Most sessions present "hands-on" material that make use of many extended examples of R functions, applications, and packages for a variety of common purposes. RStudio, a popular, open source Integrated Development Environment (IDE) for developing and using R applications, is utilized in the program, supplemented with R-based direct scripts (e.g. 'command-line prompts') when necessary.

Who this course is for:

  • Any novice or intermediate R user would benefit from this course.
  • Appropriate candidate students for this course include undergraduate and graduate students, college and university faculty, and practicing professionals, particularly in quantitative or analytics fields.
  • It is useful to have some rudimentary exposure to using R in a sample session, executing R script.