W3 Schools Ruby/R
Which operator can be used to compare two values?
==
How do you insert COMMENTS in R code?
# This is a comment
Which function can be used to create a data frame?
data.frame()
Which function is used to find the amount of rows and columns in an array?
dim()
How do you call a function in R?
my_function()
Which statement is used to stop a loop?
break
Which function can be used to return the square root of a number?
sqrt()
What is a correct syntax to output "Hello World" in R?
All of the other answers are correct ('Hello World', print("Hello World"), "Hello World")
In R, you must declare the data type of a variable
False
Which function is used to add additional columns in a matrix?
cbind()
How do you start writing an if statement in R?
if (x > y)
How can you assign the same value to multiple variables in one line?
var1 <- var2 <- var3 <- "Orange"
How do you start writing a while loop in R?
while (x < y)
R is an alias of React
False
What will the following function do with the str string: nchar(str)
Find the number of characters in the str string
Which operator is used to add together two values?
The + sign
What is the correct way to create a vector of strings?
fruits <- c("banana", "apple", "orange")
What is the correct way to create a list of strings?
fruits <- list("banana", "apple", "orange")
How do you create a function in R?
my_function <- function()
The following values: 10.5, 55 and 787, belongs to which data type?
numeric
Which function is often used to concatenate elements?
paste()
Which function is used to draw points (markers) in a diagram?
plot()
How do you create a variable named x with the numeric value 5?
x <- 5
The value of a string variable can be surrounded by single quotes.
True
Consider the following code: for (x 1:10). Which keyword is missing inside the for loop to output the numbers 1 to 10?
in