R Basic Flashcards
Learn basics of R
What does IDE stand for?
Interactive Development Environment
FUNCTION: install a package in R
install.packages (“packagename”)
FUNCTION: load and attach an R Package to a session
Library (packagename)
FUNCTION: List of objects
ls()
FUNCTION: square root
sqrt
FUNCTION: find the object data type
class(object)
What is a data frame?
a table
FUNCTION: load a data set
data(“data set name”)
What is the $ called?
the accessor
What is an accessor?
a function that allows a user to interact with slots of an object
== is what
logical operator, will be true or false
what is data type “factor”?
categorical data
FUNCTION: levels()
returns categories/options from a “factor data” type object
FUNCTION: names()
designed to extract the column names from a data frame
Can also be used to assign names to numeric values
ie.
cost
R name for “data type”
class
FUNCTION: table()
takes a vector as input and returns the frequency of each unique element in the vector
> x table(x)
x
a b c
2 3 1