DSCI 100 CORRECT EXAMS ANSWERS AND
QUESTIONS SET A+
✔✔relative path - ✔✔where a file is with respect to your working directory/where you
are currently on the computer
✔✔absolute path - ✔✔where the file is with respect to the computer's file system base,
regardless of where you are
- starts with slash /
✔✔is relative or absolute path preferred and why - ✔✔relative path
- shorter and easier to type can be run on a different computer
✔✔read_csv("data/... .csv", skip = 3) - ✔✔if we wanted to skip (ie) 3 lines when reading
in the data
✔✔read_tsv(...) - ✔✔if the columns are separated by tabs rather than commas
- produces identical data frames to read_csv
✔✔What function is used to read a tab-separated values file in R? - ✔✔read_delim
✔✔What does the 'delim' argument specify in the read_delim function? - ✔✔It specifies
the delimiter used to separate values in the file.
✔✔What does col_names = FALSE indicate when using read_delim? - ✔✔It indicates
that there are no column names in the data.
✔✔Why is delim considered a more flexible method to get data into R? - ✔✔Because it
allows for different delimiters to be specified.
✔✔What is a benefit of databases regarding data storage? - ✔✔They enable storing
large data sets across multiple computers with backups.
, ✔✔How do databases ensure data integrity? - ✔✔They provide mechanisms for
ensuring data integrity and validating input.
✔✔What security feature do databases provide? - ✔✔They provide security and data
access control.
✔✔What capability do databases offer for user access? - ✔✔They allow multiple users
to access data simultaneously and remotely without conflicts/errors.
✔✔value of an R data frame - ✔✔a single measurement of a single variable for a given
entity
✔✔What is a vector in programming? - ✔✔An object that can contain one or more
elements, but must be of the same data type.
✔✔How can a vector be created in programming? - ✔✔Using the c function.
✔✔5 basic data types in R - ✔✔character (chr), double (dbl), integer (int), logical (lgl),
factor (fct)
✔✔character data type - ✔✔letters or numbers surrounded by quotes
✔✔double data type - ✔✔numbers with decimal values
✔✔integer data type - ✔✔numbers without decimal values
✔✔logical data type - ✔✔either true or false
✔✔factor data type - ✔✔used to represent data with a limited number of values, usually
categories
✔✔list - ✔✔basically a vector, but elements within a single list can be different data
types
✔✔data frame - ✔✔a list of either vectors or lists of the same length with column names
✔✔3 criteria for tidy data - ✔✔- each row is a single observation
- each column is a single variable
- each value is a single cell
✔✔pivot_longer(data, cols = ..., names_to "...", values_to = "...") - ✔✔combine values
that are stored in separate columns but are part of the same variable
QUESTIONS SET A+
✔✔relative path - ✔✔where a file is with respect to your working directory/where you
are currently on the computer
✔✔absolute path - ✔✔where the file is with respect to the computer's file system base,
regardless of where you are
- starts with slash /
✔✔is relative or absolute path preferred and why - ✔✔relative path
- shorter and easier to type can be run on a different computer
✔✔read_csv("data/... .csv", skip = 3) - ✔✔if we wanted to skip (ie) 3 lines when reading
in the data
✔✔read_tsv(...) - ✔✔if the columns are separated by tabs rather than commas
- produces identical data frames to read_csv
✔✔What function is used to read a tab-separated values file in R? - ✔✔read_delim
✔✔What does the 'delim' argument specify in the read_delim function? - ✔✔It specifies
the delimiter used to separate values in the file.
✔✔What does col_names = FALSE indicate when using read_delim? - ✔✔It indicates
that there are no column names in the data.
✔✔Why is delim considered a more flexible method to get data into R? - ✔✔Because it
allows for different delimiters to be specified.
✔✔What is a benefit of databases regarding data storage? - ✔✔They enable storing
large data sets across multiple computers with backups.
, ✔✔How do databases ensure data integrity? - ✔✔They provide mechanisms for
ensuring data integrity and validating input.
✔✔What security feature do databases provide? - ✔✔They provide security and data
access control.
✔✔What capability do databases offer for user access? - ✔✔They allow multiple users
to access data simultaneously and remotely without conflicts/errors.
✔✔value of an R data frame - ✔✔a single measurement of a single variable for a given
entity
✔✔What is a vector in programming? - ✔✔An object that can contain one or more
elements, but must be of the same data type.
✔✔How can a vector be created in programming? - ✔✔Using the c function.
✔✔5 basic data types in R - ✔✔character (chr), double (dbl), integer (int), logical (lgl),
factor (fct)
✔✔character data type - ✔✔letters or numbers surrounded by quotes
✔✔double data type - ✔✔numbers with decimal values
✔✔integer data type - ✔✔numbers without decimal values
✔✔logical data type - ✔✔either true or false
✔✔factor data type - ✔✔used to represent data with a limited number of values, usually
categories
✔✔list - ✔✔basically a vector, but elements within a single list can be different data
types
✔✔data frame - ✔✔a list of either vectors or lists of the same length with column names
✔✔3 criteria for tidy data - ✔✔- each row is a single observation
- each column is a single variable
- each value is a single cell
✔✔pivot_longer(data, cols = ..., names_to "...", values_to = "...") - ✔✔combine values
that are stored in separate columns but are part of the same variable