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
What is the primary GUI (Graphical User Interface) used for R?
a) RStudio
b) SPSS
c) Jupyter Notebook
d) PyCharmHow 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")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")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)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")How do you get a summary of a variable 'x' in R?
a) describe(x)
b) summarize(x)
c) summary(x)
d) stats(x)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 aboveWhat function is used to read a CSV file in R?
a) read.csv()
b) import.csv()
c) load.csv()
d) open.csv()How do you write data to a CSV file in R?
a) save.csv()
b) export.csv()
c) write.csv()
d) output.csv()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 bWhat is the data type for whole numbers in R?
a) int
b) integer
c) whole
d) numHow 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 cWhich function is used to get the current working directory in R?
a) getwd()
b) pwd()
c) current.dir()
d) dir.now()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()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 directoryHow 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)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 bHow 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)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 columnHow 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
a) RStudio
a) install.packages("package_name")
c) library("package_name")
b) plot(x, y)
b) devtools::install_github("username/repo")
c) summary(x)
d) All of the above
a) read.csv()
c) write.csv()
d) Both a and b
b) integer
d) Both b and c
a) getwd()
c) data.frame()
b) Shows the first few rows of a data frame
b) x[!is.na(x)]
d) Both a and b
c) paste(a, b)
b) Number of columns
a) install.packages(c("package1", "package2", "package3"))
0 Comments