- 1. R Programming
- 2. R - basics
- 2.1. Background
- 2.2. Alternatives
- 2.3. Install R
- 2.4. Install R Studio
- 2.5. Launch interactive R, get help, and quit
- 2.6. Running R on the command line using Rscript
- 2.7. Comments
- 2.8. R and simple math operations
- 2.9. R variables
- 2.10. R assignment (left-assignment, right-assignment)
- 2.11. Variable types (numeric, character, logical, function)
- 2.12. Variable types are deducted
- 2.13. paste (join) strings and numbers together
- 2.14. Operator preference order and parentheses
- 2.15. Operators comparing numbers
- 2.16. Operators comparing strings (characters)
- 2.17. Convert string (character) to numeric
- 2.18. Boolean (logical) operations
- 2.19. Concatenate strings
- 2.20. Convert between types using as.
- 2.21. Printing with cat
- 3. Vectors
- 3.1. R vectors
- 3.2. Variable types of vectors are deducted
- 3.3. One element vector is the same a single value
- 3.4. Sum of values in vectors
- 3.5. Size of vector (length of vector)
- 3.6. Access the n-the element of a vector
- 3.7. R Vector: Negative index, exclude element
- 3.8. R vector: Access several elements (slice)
- 3.9. R vector: Exclude several elements
- 3.10. Some basic statistical functions
- 3.11. 3 ways to create vectors
- 3.12. R - sequences and ranges
- 3.13. Range of numbers
- 3.14. Filter values
- 3.15. Index of true elements - which
- 3.16. which
- 3.17. Matix TBD
- 3.18. Vector operations - reuse values from shorter vector
- 3.19. Summary of numeric data
- 3.20. Change element of vector
- 3.21. Assign vector to another name
- 3.22. Reverse vector
- 3.23. Sort vector
- 3.24. Sort using order
- 3.25. Operators comparing vectors
- 3.26. Convert vector of strings to numerics
- 3.27. Repeate the same number
- 3.28. Boolean (logical) operations on vectors
- 3.29. Factors
- 3.30. Append to end of vector
- 4. Data Frames
- 4.1. Data Frame functions
- 4.2. Iris dataset
- 4.3. Built-in Iris data set
- 4.4. Load Iris dataset
- 4.5. Sort dataset by a column
- 4.6. Order dataframe by two columns (secondary sort)
- 5. Strings (characters)
- 5.1. Substitute first occurence using sub
- 5.2. Substitute all occurences using gsub
- 6. Functions
- 6.1. Functions overview
- 6.2. Simple add function
- 6.3. Recursive Fibonacci
- 6.4. Fibonacci
- 7. Testing
- 7.1. Testthat
- 7.2. Test Example
- 8. Files
- 8.1. Filesystem pathes
- 8.2. Filesystem get current working directory (cwd)
- 8.3. Concatenate pathes
- 8.4. Change directory
- 8.5. Recursively list files and directories
- 8.6. Write to a textfile
- 8.7. Read a textfile
- 8.8. Counter with file storage
- 9. Graphs
- 9.1. Bar plot
- 9.2. Associate name with each value
- 9.3. Quick graphs
- 9.4. Random numbers in normal distribution
- 10. Packages
- 10.1. CRAN
- 10.2. Install CRAN packages
- 10.3. Install CRAN packages from the command line
- 10.4. Install several CRAN packages from the command line
- 10.5. Read CSV file
- 10.6. Read JSON file
- 11. Other
- 11.1. Exit - quit
- 11.2. Script name
- 11.3. Command line arguments
- 11.4. if-statement
- 11.5. for loop