R Programming

  1. R Data Structures
    1. Vectors (One-dimensional)
      1. Vector Fundamentals
        1. Homogeneous Data Storage
          1. Vector Length
            1. Atomic vs. List Vectors
            2. Creating Vectors
              1. Combine Function (`c()`)
                1. Sequence Generation (`seq()`)
                  1. Repetition (`rep()`)
                    1. Colon Operator (`:`)
                      1. Vector Creation Functions
                      2. Vector Properties
                        1. Length (`length()`)
                          1. Names (`names()`)
                            1. Attributes
                            2. Vectorization Principles
                              1. Element-wise Operations
                                1. Broadcasting Rules
                                  1. Recycling Rule
                                    1. Performance Benefits
                                    2. Vector Arithmetic
                                      1. Mathematical Operations
                                        1. Comparison Operations
                                          1. Logical Operations
                                            1. Set Operations
                                            2. Vector Indexing and Subsetting
                                              1. Positive Integer Indexing
                                                1. Negative Integer Indexing
                                                  1. Logical Indexing
                                                    1. Character Indexing (Named Vectors)
                                                      1. Out-of-bounds Indexing Behavior
                                                      2. Modifying Vectors
                                                        1. Element Assignment
                                                          1. Vector Concatenation
                                                            1. Vector Sorting
                                                          2. Matrices (Two-dimensional)
                                                            1. Matrix Fundamentals
                                                              1. Rectangular Data Structure
                                                                1. Homogeneous Data Storage
                                                                  1. Row and Column Organization
                                                                  2. Creating Matrices
                                                                    1. `matrix()` Function
                                                                      1. Converting Vectors to Matrices
                                                                        1. Binding Vectors (`rbind()`, `cbind()`)
                                                                          1. Matrix Dimensions
                                                                          2. Matrix Properties
                                                                            1. Dimensions (`dim()`, `nrow()`, `ncol()`)
                                                                              1. Row and Column Names
                                                                                1. Matrix Attributes
                                                                                2. Matrix Operations
                                                                                  1. Element-wise Operations
                                                                                    1. Matrix Addition and Subtraction
                                                                                      1. Matrix Multiplication (`%*%`)
                                                                                        1. Element-wise Multiplication (`*`)
                                                                                          1. Matrix Transpose (`t()`)
                                                                                            1. Matrix Inverse (`solve()`)
                                                                                              1. Determinant (`det()`)
                                                                                                1. Eigenvalues and Eigenvectors (`eigen()`)
                                                                                                2. Matrix Indexing
                                                                                                  1. Single Element Access
                                                                                                    1. Row Selection
                                                                                                      1. Column Selection
                                                                                                        1. Submatrix Selection
                                                                                                          1. Logical Indexing
                                                                                                          2. Matrix Manipulation
                                                                                                            1. Adding Rows and Columns
                                                                                                              1. Removing Rows and Columns
                                                                                                                1. Matrix Reshaping
                                                                                                              2. Arrays (Multi-dimensional)
                                                                                                                1. Array Fundamentals
                                                                                                                  1. Multi-dimensional Extension of Matrices
                                                                                                                    1. Homogeneous Data Storage
                                                                                                                      1. Dimension Specification
                                                                                                                      2. Creating Arrays
                                                                                                                        1. `array()` Function
                                                                                                                          1. Dimension Specification
                                                                                                                            1. Array from Vectors
                                                                                                                            2. Array Properties
                                                                                                                              1. Dimensions (`dim()`)
                                                                                                                                1. Dimension Names (`dimnames()`)
                                                                                                                                2. Array Indexing
                                                                                                                                  1. Multi-dimensional Indexing
                                                                                                                                    1. Dimension Slicing
                                                                                                                                      1. Array Subsetting
                                                                                                                                      2. Array Operations
                                                                                                                                        1. Element-wise Operations
                                                                                                                                          1. Dimension-specific Operations
                                                                                                                                            1. Array Manipulation Functions
                                                                                                                                          2. Lists (Heterogeneous Collections)
                                                                                                                                            1. List Fundamentals
                                                                                                                                              1. Heterogeneous Data Storage
                                                                                                                                                1. Recursive Data Structure
                                                                                                                                                  1. List vs. Vector Differences
                                                                                                                                                  2. Creating Lists
                                                                                                                                                    1. `list()` Function
                                                                                                                                                      1. Named List Elements
                                                                                                                                                        1. Nested Lists
                                                                                                                                                        2. List Properties
                                                                                                                                                          1. List Length
                                                                                                                                                            1. Element Names
                                                                                                                                                              1. List Structure
                                                                                                                                                              2. List Indexing
                                                                                                                                                                1. Single Bracket Indexing (`[]`)
                                                                                                                                                                  1. Double Bracket Indexing (`[[]]`)
                                                                                                                                                                    1. Dollar Sign Indexing (`$`)
                                                                                                                                                                      1. Multiple Element Access
                                                                                                                                                                      2. List Manipulation
                                                                                                                                                                        1. Adding Elements
                                                                                                                                                                          1. Removing Elements
                                                                                                                                                                            1. Modifying Elements
                                                                                                                                                                              1. List Concatenation
                                                                                                                                                                              2. List Functions
                                                                                                                                                                                1. `lapply()` and `sapply()`
                                                                                                                                                                                  1. `unlist()`
                                                                                                                                                                                    1. List Conversion Functions
                                                                                                                                                                                  2. Data Frames (Tabular Data)
                                                                                                                                                                                    1. Data Frame Fundamentals
                                                                                                                                                                                      1. Tabular Data Structure
                                                                                                                                                                                        1. Column-wise Heterogeneous Storage
                                                                                                                                                                                          1. Row-wise Homogeneous Storage
                                                                                                                                                                                            1. Relationship to Matrices and Lists
                                                                                                                                                                                            2. Creating Data Frames
                                                                                                                                                                                              1. `data.frame()` Function
                                                                                                                                                                                                1. From Vectors
                                                                                                                                                                                                  1. From Matrices
                                                                                                                                                                                                    1. From Lists
                                                                                                                                                                                                      1. Reading from Files
                                                                                                                                                                                                      2. Data Frame Properties
                                                                                                                                                                                                        1. Dimensions (`nrow()`, `ncol()`, `dim()`)
                                                                                                                                                                                                          1. Column Names (`names()`, `colnames()`)
                                                                                                                                                                                                            1. Row Names (`rownames()`)
                                                                                                                                                                                                              1. Data Frame Structure (`str()`)
                                                                                                                                                                                                              2. Data Frame Indexing
                                                                                                                                                                                                                1. Column Selection by Name
                                                                                                                                                                                                                  1. Column Selection by Position
                                                                                                                                                                                                                    1. Row Selection
                                                                                                                                                                                                                      1. Cell Selection
                                                                                                                                                                                                                        1. Logical Subsetting
                                                                                                                                                                                                                          1. Subset Function (`subset()`)
                                                                                                                                                                                                                          2. Data Frame Manipulation
                                                                                                                                                                                                                            1. Adding Columns
                                                                                                                                                                                                                              1. Adding Rows
                                                                                                                                                                                                                                1. Removing Columns and Rows
                                                                                                                                                                                                                                  1. Merging Data Frames
                                                                                                                                                                                                                                    1. Sorting Data Frames
                                                                                                                                                                                                                                    2. Data Frame Functions
                                                                                                                                                                                                                                      1. `head()` and `tail()`
                                                                                                                                                                                                                                        1. `summary()`
                                                                                                                                                                                                                                          1. `str()`
                                                                                                                                                                                                                                            1. `View()`
                                                                                                                                                                                                                                              1. Column-wise Operations
                                                                                                                                                                                                                                            2. Factors (Categorical Data)
                                                                                                                                                                                                                                              1. Factor Fundamentals
                                                                                                                                                                                                                                                1. Categorical Data Representation
                                                                                                                                                                                                                                                  1. Levels and Labels
                                                                                                                                                                                                                                                    1. Ordered vs. Unordered Factors
                                                                                                                                                                                                                                                    2. Creating Factors
                                                                                                                                                                                                                                                      1. `factor()` Function
                                                                                                                                                                                                                                                        1. From Character Vectors
                                                                                                                                                                                                                                                          1. From Numeric Vectors
                                                                                                                                                                                                                                                            1. Specifying Levels
                                                                                                                                                                                                                                                              1. Specifying Labels
                                                                                                                                                                                                                                                              2. Factor Properties
                                                                                                                                                                                                                                                                1. Levels (`levels()`)
                                                                                                                                                                                                                                                                  1. Number of Levels (`nlevels()`)
                                                                                                                                                                                                                                                                    1. Factor Length
                                                                                                                                                                                                                                                                    2. Ordered Factors
                                                                                                                                                                                                                                                                      1. Creating Ordered Factors
                                                                                                                                                                                                                                                                        1. Ordering Levels
                                                                                                                                                                                                                                                                          1. Comparisons with Ordered Factors
                                                                                                                                                                                                                                                                          2. Factor Manipulation
                                                                                                                                                                                                                                                                            1. Changing Levels
                                                                                                                                                                                                                                                                              1. Adding Levels
                                                                                                                                                                                                                                                                                1. Dropping Unused Levels
                                                                                                                                                                                                                                                                                  1. Recoding Factors
                                                                                                                                                                                                                                                                                    1. Converting to Other Types
                                                                                                                                                                                                                                                                                    2. Factor Functions
                                                                                                                                                                                                                                                                                      1. `table()` for Frequency Counts
                                                                                                                                                                                                                                                                                        1. `summary()` for Factor Summaries
                                                                                                                                                                                                                                                                                          1. Factor-specific Operations