Building Blocks Flashcards
Functions argument?
What we pass in the parentheses after the function name
What do you use functions to create?
Objects (object < - Function ()
What are Vector attributes?
Names, dimension and classes
Indexing and slicing is used for?
Selecting values from a vector
What can you used indexing & slicing for?
Adding a new variable, Editing variables and slicing & indexing Matrices & data frames
How do you select a value from an object?
vector.name[n]
What is the command for slicing?
Vector.name[n1 : nk]
Why are classes important?
Gives R the base information needed to create an object…all object of a class share features
What is recycling?
Repeating values in order to reach the necessary vector length to complete an operation
When indexing a matrix row?
You type the index for the row in square brackets then follow by a comma [n, ]
When indexing a matrix column
You type a comma in square brackets then follow by the index of the column [ ,n ]