data-science

  1. Nicole Seaman

    YouTube R Programming: Introduction: ggplot for capital market line (CML, R Intro-08)

    In this video, I'd like to show you the bare minimum of what we need to know to render a visualization in ggplot. The bare minimum is that we need to use the three essential layers (three out of seven possible). Those three essential layers are data, aesthetics, and giome (short for geometries...
  2. Nicole Seaman

    YouTube R Programming Tidyverse: readr package to import data (csv, tab-separated, fixed-width) (tidy-02)

    David introduces the package that's called readr, which is part of the tidy verse, and this is the package that we would use to import external files into our R environment as usable R objects. In the tidy verse those would be called Tibbles, but a Tibble is just an enhanced user-friendly...
  3. Nicole Seaman

    YouTube R Programming Intro: Load flat/CSV/excel file with built-in read.table function or readxl (intro-07)

    read.table() is the core function for loading files external file into R dataframes; it is part of the utils package which is automatically loaded when you start R. Aside from the header argument, the sep and quote arguments define the field separators. The read.csv() function is a wrapper...
  4. Nicole Seaman

    YouTube R Programming Tidyverse: What is tidy data?

    Tidy data meets three conditions: 1. Each variable must have its own column; 2. each observation must have its own row; and 3. Each value must have its own cell.
  5. Nicole Seaman

    YouTube R Programming: Introduction: How to subset (R intro-06)

    R has three subset operators: [, [[, and $. Given data frame df, both of these return a data frame: df["z"], df[3]. Given a data frame df, all three of these commands are identical and return a vector: df$z, df[["z"]], df[[3]]. David's script is here...
  6. Nicole Seaman

    YouTube R Programming Introduction: Matrices (R intro-05)

    In R a matrix is an atomic vector with the dimension attribute. In this example, the correlation matrix is entered as a vector with sixteen elements: rho_v <-c(1.000, ...). Then the vector is translated into a matrix with rho <- matrix(rho_v, nrow = 4, ncol =4). Now it is a matrix because it has...
  7. Nicole Seaman

    YouTube R Programming: Introduction: Factors (R Intro-04)

    Factors are categorical vectors. Specifically, they are (integer) vectors that store categorical values, or ordinal values. Ordinal values are *ranked* categories (but they are not intervals). Factors can only contain predefined values. A classic example of a factor are male/female. An example...
  8. Nicole Seaman

    YouTube R Programming: Introduction: Data Frames (R Intro-03)

    Data frames are the most common structure in R. A data frame is a list of equal-length vectors; ie, it's a rectangle. Create a data frame with data.frame(). Single-brackets, stocks[1], returns a dataframe. Double-brackets, stocks[[1]], returns a vector and is equivalent to stocks$ticker. We can...
  9. Nicole Seaman

    YouTube R Programming: Introduction: List Data Structure (R Intro - 02)

    Unlike atomic vectors, list (vectors) are flexible: each element can be a different type (char, integer, numeric, logical or even a sub-list!). List returns the i-th element as a list, while list[] returns the element as a vector. If the element is named, then list[["name"]] = list[] =...
Top