Discover the fundamentals of R, a powerful programming language for statistical computing and data analysis. Learn about its history, key features, installation process, basic syntax, and environment setup.
History and Features of R
Who developed the R programming language? a) John Chambers and Ross Ihaka b) Dennis Ritchie c) Guido van Rossum d) James Gosling
In which year was R first released? a) 1988 b) 1995 c) 2000 d) 1993
R is primarily used for which of the following purposes? a) Web development b) Statistical computing and data analysis c) Mobile app development d) Game development
Which of the following is NOT a feature of the R programming language? a) High-level programming language b) Open-source c) Primarily used for machine learning d) Cross-platform support
R is an implementation of which programming language? a) C b) Scheme c) S d) Java
What type of environment does R provide for statistical computing? a) Development-only b) An interactive programming environment c) A browser-based interface d) A command-line interface only
Which of the following is a major advantage of R? a) Integrated with databases only b) Built-in libraries for data analysis c) Excellent for mobile development d) Mainly used for game development
Which statistical technique does R support natively? a) Linear regression b) Quantum computing c) Parallel programming d) Web scraping
What does the acronym R stand for? a) Reliable b) Random c) Reproducible d) It does not stand for anything specifically
How is R commonly used in the field of academia? a) Web programming and development b) Data analysis, statistical modeling, and research c) Mobile app development d) Video game design
Installing R and RStudio
What is RStudio? a) An IDE for R programming b) A web-based programming tool c) A package manager for R d) A Python framework
What is the first step in setting up R for use? a) Download RStudio b) Install R c) Install Python d) Set up the Jupyter Notebook
Which operating systems does R support? a) Windows only b) Linux and Windows only c) Windows, Linux, and macOS d) Only macOS
How do you install R on a Windows machine? a) Download the .deb file b) Download the .dmg file c) Download the .exe installer d) Use a terminal command to install
After installing R, how can you run it on your computer? a) From the command line using R b) By typing run R in the start menu c) From a graphical interface only d) Using a web browser
What is the purpose of RStudio? a) A text editor for R scripts b) A platform to manage R packages c) An interactive IDE for R d) A tool to run R on the web
How can you install R packages in RStudio? a) By clicking a button in the toolbar b) Using the install.packages() function c) By downloading directly from GitHub d) Using the run R command
What is the RStudio Console used for? a) To execute R code b) To install R packages c) To debug R programs d) To access help documentation
Which of the following can be done in RStudio? a) Write R scripts b) Visualize data c) Run R code interactively d) All of the above
What is the default directory for RStudio projects? a) The user’s Documents folder b) A custom project folder c) The R home directory d) The Desktop folder
Basic Syntax and Environment Overview
In R, which symbol is used for assignment? a) = b) := c) <- d) ->
Which of the following is the correct way to create a vector in R? a) vector <- [1, 2, 3, 4] b) vector <- c(1, 2, 3, 4) c) vector := [1, 2, 3, 4] d) vector <- (1, 2, 3, 4)
How do you comment a line of code in R? a) # This is a comment b) // This is a comment c) /* This is a comment */ d) -- This is a comment
Which of the following functions is used to print output in R? a) echo() b) print() c) out() d) display()
How do you check the version of R installed on your system? a) R -v b) version() c) R.version() d) check_version()
What is the RStudio Environment pane used for? a) To show all installed R packages b) To manage your active R scripts c) To show variables, data frames, and functions in memory d) To run R code interactively
In R, which function is used to create a data frame? a) data.frame() b) create.data() c) data() d) df()
Which of the following is the proper way to display a summary of a data frame in R? a) summary(data_frame) b) head(data_frame) c) display(data_frame) d) data_frame.summary()
Which R function is used to read a CSV file? a) read.table() b) read.csv() c) import.csv() d) load.csv()
What is the correct way to install an R package? a) install.packages("package_name") b) download("package_name") c) library.install("package_name") d) install("package_name")
Answer Key
QNo
Answer (Option with text)
1
a) John Chambers and Ross Ihaka
2
d) 1993
3
b) Statistical computing and data analysis
4
c) Primarily used for machine learning
5
c) S
6
b) An interactive programming environment
7
b) Built-in libraries for data analysis
8
a) Linear regression
9
d) It does not stand for anything specifically
10
b) Data analysis, statistical modeling, and research
11
a) An IDE for R programming
12
b) Install R
13
c) Windows, Linux, and macOS
14
c) Download the .exe installer
15
a) From the command line using R
16
c) An interactive IDE for R
17
b) Using the install.packages() function
18
a) To execute R code
19
d) All of the above
20
b) A custom project folder
21
c) <-
22
b) vector <- c(1, 2, 3, 4)
23
a) # This is a comment
24
b) print()
25
c) R.version()
26
c) To show variables, data frames, and functions in memory