wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

R Programming Assessment

Total questions: 30

Worksheet time: 16mins

Name
Class
Date
1.

R runs on the ____________ operating system.

a)

Linux

b)

Windows

c)

Ubuntu

d)

Any operating system

2.

You can download “base” R system from _________

a)

A

b)

B

c)

CRAN

d)

D

3.

What will be the output of the following R code?

> x <- 6

> class(x)

a)

“integer”

b)

“numeric”

c)

“real”

d)

“imaginary”

4.

R was named partly after the first names of____R authors?

a)

One

b)

Two

c)

Three

d)

Four

5.

CRAN stands for comprehensive R Artificial Network

a)

True

b)

False

6.

(a)   function is used to read data from console or a text file

7.

Which of the following graph can be used for simple summarization of data?

a)

Scatterplot

b)

Barplot

c)

Overlaying

d)

None of these

8.

What is the primary purpose of the R programming language?

a)

Web development

b)

Mobile app development

c)

Statistical analysis

d)

Game development

9.

Which of the following is a popular package for data visualization in R?

a)

dplyr

b)

pandas

c)

ggplot2

d)

numpy

10.

What is the Comprehensive R Archive Network (CRAN) used for?

a)

Hosting R packages

b)

Running R programs

c)

Storing R scripts

d)

Debugging R code

11.

What is the difference between `=` and `<-` in R?

a)

`=` is used for assignment, `<-` is used for printing

b)

`=` is used for printing, `<-` is used for assignment

c)

`=` is used for both assignment and printing

d)

There is no difference between the two

12.

How do you create a vector in R?

a)

`x=c(1,2,3)`

b)

`x=[1,2,3]`

c)

`x={1,2,3}`

d)

`x=(1,2,3)`

13.

What is the purpose of the `%>%` operator in R?

a)

To assign a value to a variable

b)

To pipe output from one function to another

c)

To print a message

d)

To create a new function

14.

Which function is used to create a data frame in R?

a)

rbind()

b)

cbind()

c)

data.frame()

d)

str()

15.

Which function is used to add a row to a data frame?

a)

cbind()

b)

rbind()

c)

merge()

d)

append()

16.

What does names(df) return in R?

a)

Row values

b)

Column names

c)

Data summary

d)

Structure of data frame

17.

What symbol is used to access specific rows and columns of a data frame?

a)

{}

b)

[]

c)

()

d)

<>

18.

Which function is used to combine two data frames by adding new columns?

a)

rbind()

b)

cbind()

c)

merge()

d)

append()

19.

Which function gives a statistical summary of a data frame like mean and median?

a)

summary(df)

b)

str(df)

c)

names(df)

d)

class(df)

20.

In an R data frame, which function would you use to display summary statistics such as mean, median, and min/max?

a)

str()

b)

describe()

c)

summary()

d)

analyze()

21.

Considered as heterogeneous data structure where it contains elements in different data types.

a)

Vector

b)

List

c)

Data Frames

d)

Matrices

22.

If a command is not complete at the end of a line, R will give a different prompt, by default it is:

a)

-

b)

+

c)

>

d)

*

23.

Which of the following statements is correct when we create R functions?

a)

b)

c)

Function arguments are passed by reference

d)

None of the mentioned

24.

What is the main difference between a population and a sample?

a)

A sample includes only individuals with specific characteristics, while a population includes all individuals.

b)

A population is always larger than a sample.

c)

A population is a random subset of individuals while a sample is the entire set of individuals.

d)

A population includes all individuals while a sample includes only a portion.

25.

What is the purpose of statistical inference?

a)

To make predictions about future events

b)

To describe the distribution of a single variable

c)

To draw causal relationships between variables

d)

To make generalizations about a population based on a sample

26.

A data analyst is working with a dataset that contains the number of hours per week that a group of employee’s work. Which of the following measures of central tendency is most appropriate to use in this scenario?

a)

Mean

b)

Median

c)

Mode

d)

Range

27.

A company is analyzing the distribution of salaries among its employees. Which of the following visualizations would be most appropriate to use in this scenario?

a)

Bar chart

b)

Scatter plot

c)

Box plot

d)

Histogram

28.

An insurance company is analyzing the ages of its policyholders. Which of the following visualizations would be most appropriate to use in this scenario?

a)

Bar chart

b)

Scatter plot

c)

Box plot

d)

Histogram

29.

Which function in R is used to create a boxplot using the ggplot2 package?

a)

geom-plot()

b)

geom-boxplot()

c)

geom_plot()

d)

geom_boxplot()

30.

Once we created our database folder in any location in our machine, what function we use to set our working directory to where the database will be saved?

a)

setwd()

b)

set.choose()

c)

wd()

d)

None of the mentioned