ST 308 I QUIZ #1 REVIEW QUESTIONS
Basic use of R - Answers - reading, manipulating, and plotting data
Console (Terminal) - Answers - Where we submit our code
Scripting and Viewing Window - Answers - Where we write our code
<- - Answers - Storage Arrow for storing data/info/function in R objects
Class() - Answers - Describes the class attribute of an R object
Typeof() - Answers - determines the (R internal) type or storage mode of any object
Str() - Answers - Compactly displays the internal structure of an R object
Atomic Vector - Answers - One-dimensional object whose elements are all the same
type (homogeneous)
Data Frame - Answers - A two-dimensional object where each column is a vector; these
vectors can be of differing types (Heterogeneous)
List - Answers - one-dimensional object whose elements can be of different types
c() - Answers - Combine function -Used to combine elements into a vector
seq() - Answers - Inputs = from, to, by
Outputs = A sequence of numbers
R does what kind of math on vectors? - Answers - Element-wise meaning
: - Answers - Can be used to create a sequence.
Ex 1:20
[ ] - Answers - Return vector elements
Negative indices [ ,-1] - Answers - returns vectors without the elements mentioned
data.frame() - Answers - constructs a data frame
What symbol do we often use at the end of a data frame to return a single column
(variable)? - Answers - $
, True or False: We can use [ ] after a data frame object to subset that data frame. -
Answers - True [Rows, Columns]
list() - Answers - A generic term for a programming data structure that holds multiple
items. Function that creates a list
What is used to access multiple list elements? - Answers - [ ]
What is used to access a single list element? - Answers - [[ ]]
If list elements are named, what can be used(instead of brackets)? - Answers - $
What is the connection between list, data frames, and vectors? - Answers - A data
frame is a list of equal length vectors.
R package - Answers - a collection of R functions, data, and compiled code in a well-
defined format
Tidyverse - Answers - a collection of open source R packages that share a common
philosophy are designed to work together
Installing an R package - Answers - First time using it must be installed with:
intsall.packages() or through menu
Each session, packages must be read in with? - Answers - library() or require()
: : - Answers - Call functions without loading full library; If not specified, most recently
loaded package takes precedent.
Delimited Data - Answers - data that is stored in text format and separated by
delimiters, such as commas or tabs
Delimiter - Answers - A character that separates data entries from one another.
Function to read Comma Delimited - Answers - read.csv (utils)
read_csv (readR)
Function to read Semicolon Delimited - Answers - read.csv2() (utils)
read_csv2 (readR)
Function to Read tab delimited - Answers - read.delim() (utils)
read_tsv() (readR)
Working Directory - Answers - the folder on your computer where R is looking for files
be default
Basic use of R - Answers - reading, manipulating, and plotting data
Console (Terminal) - Answers - Where we submit our code
Scripting and Viewing Window - Answers - Where we write our code
<- - Answers - Storage Arrow for storing data/info/function in R objects
Class() - Answers - Describes the class attribute of an R object
Typeof() - Answers - determines the (R internal) type or storage mode of any object
Str() - Answers - Compactly displays the internal structure of an R object
Atomic Vector - Answers - One-dimensional object whose elements are all the same
type (homogeneous)
Data Frame - Answers - A two-dimensional object where each column is a vector; these
vectors can be of differing types (Heterogeneous)
List - Answers - one-dimensional object whose elements can be of different types
c() - Answers - Combine function -Used to combine elements into a vector
seq() - Answers - Inputs = from, to, by
Outputs = A sequence of numbers
R does what kind of math on vectors? - Answers - Element-wise meaning
: - Answers - Can be used to create a sequence.
Ex 1:20
[ ] - Answers - Return vector elements
Negative indices [ ,-1] - Answers - returns vectors without the elements mentioned
data.frame() - Answers - constructs a data frame
What symbol do we often use at the end of a data frame to return a single column
(variable)? - Answers - $
, True or False: We can use [ ] after a data frame object to subset that data frame. -
Answers - True [Rows, Columns]
list() - Answers - A generic term for a programming data structure that holds multiple
items. Function that creates a list
What is used to access multiple list elements? - Answers - [ ]
What is used to access a single list element? - Answers - [[ ]]
If list elements are named, what can be used(instead of brackets)? - Answers - $
What is the connection between list, data frames, and vectors? - Answers - A data
frame is a list of equal length vectors.
R package - Answers - a collection of R functions, data, and compiled code in a well-
defined format
Tidyverse - Answers - a collection of open source R packages that share a common
philosophy are designed to work together
Installing an R package - Answers - First time using it must be installed with:
intsall.packages() or through menu
Each session, packages must be read in with? - Answers - library() or require()
: : - Answers - Call functions without loading full library; If not specified, most recently
loaded package takes precedent.
Delimited Data - Answers - data that is stored in text format and separated by
delimiters, such as commas or tabs
Delimiter - Answers - A character that separates data entries from one another.
Function to read Comma Delimited - Answers - read.csv (utils)
read_csv (readR)
Function to read Semicolon Delimited - Answers - read.csv2() (utils)
read_csv2 (readR)
Function to Read tab delimited - Answers - read.delim() (utils)
read_tsv() (readR)
Working Directory - Answers - the folder on your computer where R is looking for files
be default