ST 308 FINAL EXAM QUESTIONS & VERIFIED
ANSWERS
Script
Used to write and save code for later use
Console
Runs code immediately but does not save it
Environment
Displays all objects currently loaded including datasets, variables, vectors
Files/Plots/Help
Navigate files, view graphs, and access documentation
Quarto
allows you to combine code, text, and output into a formatted report like a PDF, HTML,
or Word doc
Scripts only?
contain code and are not formatted for presentation
What is Quarto for?
It is better for assignments and reports because it is reproducible and organized.
Numerical variables use?
<dbl>, <int>
<dbl>
decimals
<int>
integers
, Categorical variables use?
<chr>, <fct>
<chr>
text
<fct>
factor categories
What do you use to check types of variables or datasets?
class( ), str( ), or glimpse( )
How to use brackets?
data[rows, columns]
How to use dollar sign?
data$column_name
How to use column name?
data[, "column_name"]
What do brackets, dollar sign, and column name allow?
To extract specific parts of a dataset.
How do you read data?
Use read.csv("file.csv") or read_csv( )
Your working directory determines what?
where files are read from
When do you use getwd( )?
When you want to check your current working directory. It tells you what folder R is
currently cooking in and where it will try to read files from and save files to.
ANSWERS
Script
Used to write and save code for later use
Console
Runs code immediately but does not save it
Environment
Displays all objects currently loaded including datasets, variables, vectors
Files/Plots/Help
Navigate files, view graphs, and access documentation
Quarto
allows you to combine code, text, and output into a formatted report like a PDF, HTML,
or Word doc
Scripts only?
contain code and are not formatted for presentation
What is Quarto for?
It is better for assignments and reports because it is reproducible and organized.
Numerical variables use?
<dbl>, <int>
<dbl>
decimals
<int>
integers
, Categorical variables use?
<chr>, <fct>
<chr>
text
<fct>
factor categories
What do you use to check types of variables or datasets?
class( ), str( ), or glimpse( )
How to use brackets?
data[rows, columns]
How to use dollar sign?
data$column_name
How to use column name?
data[, "column_name"]
What do brackets, dollar sign, and column name allow?
To extract specific parts of a dataset.
How do you read data?
Use read.csv("file.csv") or read_csv( )
Your working directory determines what?
where files are read from
When do you use getwd( )?
When you want to check your current working directory. It tells you what folder R is
currently cooking in and where it will try to read files from and save files to.