Foundations of R in Data Science Quiz

  1. R’s Origin

    Which programming language was R primarily inspired by in its development?

    1. Python
    2. C++
    3. S
    4. Java
    5. Ruby
  2. Basic Data Types

    In R, which of the following is a basic data type used to store numbers with decimals like 3.14?

    1. integer
    2. character
    3. factor
    4. numeric
    5. logical
  3. Creating Vectors

    Which R function would you use to create a vector containing the numbers 1, 2, and 3?

    1. make()
    2. c()
    3. range()
    4. vec()
    5. row()
  4. Loading Packages

    If you want to use a package you have installed in R, which function do you use to load it?

    1. install.packages()
    2. get.library()
    3. attach()
    4. library()
    5. package()
  5. Reading Data

    To read a comma-separated values (CSV) file named 'data.csv' into R, which function would be most appropriate?

    1. read.table()
    2. read.csv()
    3. importCSV()
    4. load.data()
    5. scan.csv()
  6. Data Frames

    What is the name of the fundamental R data structure for storing tabular data with rows and columns, similar to a spreadsheet?

    1. list
    2. matrix
    3. data.frame
    4. vector
    5. tuple
  7. Subsetting Data

    Which syntax retrieves the second column from a data frame called df in R?

    1. df[2]
    2. df[ ,2]
    3. df{2}
    4. df[2, ]
    5. df$2
  8. Summarizing Data

    If you want to quickly view summary statistics of all columns in your data frame called 'mydata', which command should you use?

    1. sum(mydata)
    2. head(mydata)
    3. tail(mydata)
    4. summary(mydata)
    5. inspect(mydata)
  9. Plotting in R

    To make a basic scatter plot in R of vectors x and y, which function would you typically use?

    1. chart()
    2. plot()
    3. draw()
    4. scatter()
    5. plotter()
  10. R’s Common Application

    Which of the following best describes a primary use of R in data science?

    1. Building mobile apps
    2. Text editing
    3. Statistical analysis
    4. Networking
    5. Game development