Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

If you would like to use the ForestForesight package you need some basic scripting knowledge in R. We have provided the following twenty questions to test your knowledge. If you can successfully answer about 90% of them you have the required skills to use ForestForesight the package. The answers are at the bottom

  1. What is the primary GUI (Graphical User Interface) used for R?
    a) RStudio
    b) SPSS
    c) Jupyter Notebook
    d) PyCharm

  2. How do you install a package in R?
    a) install.packages("package_name")
    b) library(package_name)
    c) require(package_name)
    d) get.package("package_name")

  3. Which function is used to load a package in R?
    a) load("package_name")
    b) use("package_name")
    c) library("package_name")
    d) import("package_name")

  4. How do you create a simple scatter plot in R?
    a) scatter(x, y)
    b) plot(x, y)
    c) ggplot(x, y)
    d) scatterplot(x, y)

  5. What command is used to update a package from GitHub?
    a) update.packages("username/repo")
    b) devtools::install_github("username/repo")
    c) github::update("username/repo")
    d) install.packages("github::username/repo")

  6. How do you get a summary of a variable 'x' in R?
    a) describe(x)
    b) summarize(x)
    c) summary(x)
    d) stats(x)

  7. In RStudio, how can you view the contents of a variable?
    a) Click on the variable name in the Environment pane
    b) Type the variable name in the console
    c) Use the view() function
    d) All of the above

  8. What function is used to read a CSV file in R?
    a) read.csv()
    b) import.csv()
    c) load.csv()
    d) open.csv()

  9. How do you write data to a CSV file in R?
    a) save.csv()
    b) export.csv()
    c) write.csv()
    d) output.csv()

  10. Which of the following is the correct way to assign a value to a variable in R?
    a) x <- 5
    b) x = 5
    c) x := 5
    d) Both a and b

  11. What is the data type for whole numbers in R?
    a) int
    b) integer
    c) whole
    d) num

  12. How do you create a vector of numbers from 1 to 10 in R?
    a) vector(1:10)
    b) c(1:10)
    c) seq(1,10)
    d) Both b and c

  13. Which function is used to get the current working directory in R?
    a) getwd()
    b) pwd()
    c) current.dir()
    d) dir.now()

  14. How do you create a data frame from vectors in R?
    a) as.data.frame()
    b) create.data.frame()
    c) data.frame()
    d) make.data.frame()

  15. What does the function head() do in R?
    a) Returns the first element of a vector
    b) Shows the first few rows of a data frame
    c) Displays the column names of a data frame
    d) Retrieves the top-level directory

  16. How do you remove missing values from a vector 'x' in R?
    a) remove.na(x)
    b) x[!is.na(x)]
    c) delete.na(x)
    d) clean(x)

  17. Which function is used to get help on a specific R function?
    a) help(function_name)
    b) ?function_name
    c) info(function_name)
    d) Both a and b

  18. How do you concatenate two strings 'a' and 'b' in R?
    a) a + b
    b) concat(a, b)
    c) paste(a, b)
    d) join(a, b)

  19. What does the function length() return when applied to a data frame?
    a) Number of rows
    b) Number of columns
    c) Total number of elements
    d) Length of the longest column

  20. How do you install multiple packages at once in R?
    a) install.packages(c("package1", "package2", "package3"))
    b) install_multiple(package1, package2, package3)
    c) library(package1, package2, package3)
    d) get.packages(package1, package2, package3)

Answers

  1. a) RStudio

  2. a) install.packages("package_name")

  3. c) library("package_name")

  4. b) plot(x, y)

  5. b) devtools::install_github("username/repo")

  6. c) summary(x)

  7. d) All of the above

  8. a) read.csv()

  9. c) write.csv()

  10. d) Both a and b

  11. b) integer

  12. d) Both b and c

  13. a) getwd()

  14. c) data.frame()

  15. b) Shows the first few rows of a data frame

  16. b) x[!is.na(x)]

  17. d) Both a and b

  18. c) paste(a, b)

  19. b) Number of columns

  20. a) install.packages(c("package1", "package2", "package3"))

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.