Skip to main content
Link
Menu
Expand
(external link)
Document
Search
Copy
Copied
The R-kheion
About
Levels - sections
Guidelines
Level 1 - Total Novice
The contents of a script
Symbol characters
Level 2 - Advanced Beginner
Getting (re)started
Types and Variables
Variables
Operators
Logical Operators
Numeric Operators
Mathematical functions
Special Values
Type detection
Basic character strings
Simple strings
Basic character operations
Conditionals
If statements
If and else statements
Nested if statements
Simple functions
Reason
Basic Function Syntax
Iteration basics
Loops with
while
Example application
Basic plotting
Plotting concepts
Simple geometries
Vectors
Combining values
Replications
Sequences
Numeric subscripts
Numeric subscript for replacement
Names attributes
Character subscripts
Iteration with
for
The definition of a
for
loop
Matrices and arrays
Matrix basics
Numeric subscripts for matrices
Row and column names
Character subscripts
On using matrices
Randomness
Shuffling and sampling
The r*dist* set of functions
Vectorization
Vector subscripts
Vectorized functions
Logical subscripts
Vectorized operations
Vectorized plotting
Vectorized points
Vectorized shapes
Lines
Polygons
Lists
Creating Lists
List element subscripts
Using Files
Reading and Saving R objects
Other reading and writing functions
Paths and working directories
Summary of Level 2
Summary Exercises
Level 3 - Competent (Later!)
Level 4 - Proficient (Later!)
Level 5 - Advanced (Later!)
Exercises
Types of exercises
Exercise registry
Operator types
Expanding R statements
Messaging pasted values
Exercises with Boolean algebra
Length of character strings
Types of variables
Messaging the length of character strings
Compliment based on character length
Correcting syntax of if statements
Message based on calculation result
Predict results of these function calls
Correct function definition syntax
The volume of a sphere
Fahrenheit to Celsius Calculator
Printing types
Type dependent feedback
Is x a number and positive?
Printing numbers from 1 to 10
Multiplication with a
while()
loop
Calculating
n!
Degrees to radians calculator
Repeat message n times
Printing values divisible by 7
Visualize the approximation of the Euler's number
e
Drawing a circle
Golden Rectangles
Circles in circle
Exponents with while
Estimate Euler's number with a given number of iterations
Add axis to the right side of a plot
Approximate Euler's number and store intermediates in a vector
Repeat a value a number of times
Assess the validity of file paths
Read in files and execute scripts
Number-coded message
Paraphrasing a sequence
Length of geologic periods
Counting the occurrences of
Favia
Number epochs in geological periods
Body mass of penguins in 2009
Carnivore genera in the Paleobiology Database
Brachiopods in OBIS
Nested if statements
Replacing values based on divisibility
Printing numbers from 1 to 10 with a for loop
Repeat message n times with for
Distance matrix between points
Matrix of circle points
Longest same-results sequence of heads or tails
Subset every third value in a vector
Drawing a circle - take 2
Subset vector to divisible parts
Are these functions vectorized?
Drawing a circle - take 3 (polygon)
IUCN Chameleon Data
The mollusk subset of Sepkoski's compendium
Resources
Level 2 - Advanced Beginner
Simple functions
Simple functions
This sections introduces the basics of writing functions.
Table of contents
Reason
Basic Function Syntax