What is R commonly used for?
Statistical computing, data analytics, and scientific research.
What are the very basic data types in R called?
Vectors.
1/196
p.1
Introduction to R Programming

What is R commonly used for?

Statistical computing, data analytics, and scientific research.

p.19
Data Types and Structures in R

What are the very basic data types in R called?

Vectors.

p.20
Data Types and Structures in R

What is the most common data structure in R?

Vector.

p.11
R Installation and Setup

Where can R be started in Windows?

In 'My Documents' or the user's home directory.

p.13
Basic R Syntax and Commands

What are reserved words in R programming?

A set of words that have special meaning and cannot be used as identifiers.

p.18
Data Types and Structures in R

What does creating a variable in R do?

It reserves some space in memory.

p.11
Basic R Syntax and Commands

What is the output of the command ls() after creating objects a, b, c, and sum?

[1] 'a' 'b' 'c' 'sum'

p.17
Basic R Syntax and Commands

What are the names of the months in R?

January, February, March, April, May, June, July, August, September, October, November, December.

p.4
Introduction to R Programming

What programming language is R built on top of?

The S programming language.

p.22
Data Types and Structures in R

What does the function length(vector_name) return in R?

The total number of elements in the vector.

p.10
Basic R Syntax and Commands

How do you execute R language commands in an R session?

By typing them line by line and pressing the enter key.

p.14
R Variables and Constants

What is the error message when trying to assign a value to 'TRUE'?

Error in TRUE <- 1: invalid (do_set) left-hand side to assignment.

p.16
Basic R Syntax and Commands

What is the hexadecimal representation of 255?

0xff.

p.13
Basic R Syntax and Commands

What does NULL represent in R?

The absence of a value or an undefined value.

p.20
Data Types and Structures in R

What function is used to determine the class of an object in R?

class()

p.13
Basic R Syntax and Commands

What does Inf represent in R?

Infinity, such as when 1 is divided by 0.

p.9
R Installation and Setup

What command can you type to quit R?

'q()'.

p.6
R Installation and Setup

Where can R be downloaded from?

The comprehensive R Archive Network (CRAN) at http://cran.r-project.org.

p.12
Basic R Syntax and Commands

What happens when you run rm(list = ls()) in R?

It removes all objects from the current R environment.

p.3
Features and Benefits of R

How can R programming experience benefit job applicants?

It can make them stand out from the crowd.

p.4
Features and Benefits of R

What makes R programming simple to learn?

It allows you to learn as you go with just data and a clear intent to draw conclusions.

p.23
Matrices and Arrays in R

How can you transform a vector into a matrix with specific dimensions?

By setting the dimensions using dim() function.

p.6
R Installation and Setup

What should you run if you install both R and R Studio?

You need to run R Studio only.

p.17
Basic R Syntax and Commands

Why is it not good to rely on month names and abbreviations in R?

Because they are implemented as variables whose values can be changed.

p.19
Data Types and Structures in R

What is the output when 'v' is assigned the value 'TRUE'?

[1] "character"

p.14
R Variables and Constants

Give examples of valid identifiers in R.

total, Sum, .fine.with.dot, this_is_acceptable, Number5.

p.4
Statistical Computing and Machine Learning with R

Why is data science considered a highly sought-after profession?

It involves using large amounts of data to make better decisions, and R is a key tool for data scientists.

p.1
Features and Benefits of R

What are some important features of R?

Conditionals, loops, user-defined recursive functions, and effective data handling.

p.13
Basic R Syntax and Commands

How should multi-line comments be formatted in R?

They should be put inside either single or double quotes.

p.14
R Variables and Constants

Can 'True' be used as a variable name in R?

Yes, it can be used as a variable name.

p.11
Basic R Syntax and Commands

How can you list the names of objects in the current R session?

By using the ls() command.

p.6
R Installation and Setup

How is R installed on Windows and Mac?

Just like installing any other program.

p.22
Data Types and Structures in R

What is implicit coercion in R?

The automatic conversion of one data type to another without explicit instruction.

p.11
Basic R Syntax and Commands

How can you remove a specific object from the current R session?

By using the rm() command with the object's name.

p.16
Basic R Syntax and Commands

How can character constants be represented in R?

Using either single quotes (') or double quotes ("), e.g., 'example' or "example".

p.13
Basic R Syntax and Commands

What does NaN stand for in R?

Not a Number, such as when 0 is divided by 0.

p.12
Basic R Syntax and Commands

What command is used to set the current working directory in R?

setwd()

p.1
Features and Benefits of R

Is R free software?

Yes, R is freely available under the GNU General Public License.

p.22
Matrices and Arrays in R

What is the function to create a matrix in R?

matrix(nrow = x, ncol = y).

p.19
Data Types and Structures in R

How is the string 'Hello' stored in R when converted to raw format?

"Hello" is stored as 48 65 6c 6c 6f

p.11
R Installation and Setup

How do you start an R session?

By using the command 'R'.

p.20
Data Types and Structures in R

What are the basic data types in R?

Logical, integer, numeric, complex, and character.

p.22
Data Types and Structures in R

What happens when you coerce an existing numeric vector with as.numeric()?

It does nothing.

p.5
Alternatives to R Programming

What is a popular alternative to R for statistical computing?

Python.

p.23
Matrices and Arrays in R

What command is used to create a matrix from a vector in R?

matrix()

p.6
R Installation and Setup

What is R Studio?

A free IDE for R available at http://www.rstudio.com.

p.17
Basic R Syntax and Commands

What are the abbreviations for the months in R?

Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.

p.19
Data Types and Structures in R

What class does the variable 'v' belong to after assigning it a complex number (2 + 5i)?

[1] "complex"

p.1
Features and Benefits of R

What languages can R integrate with for efficiency?

C, C++, .Net, Python, or FORTRAN.

p.22
Matrices and Arrays in R

How are matrices defined in R?

As a special vector with added dimensions (rows and columns).

p.6
Basic R Syntax and Commands

Is R case-sensitive?

Yes, R is case-sensitive.

p.17
Basic R Syntax and Commands

What is the value of pi in R?

3.141593.

p.2
Features and Benefits of R

What kind of data analysis can be performed in R?

Any type of data analysis.

p.10
Basic R Syntax and Commands

What file is created if you choose to save the workspace?

.RData is written to the present working directory.

p.7
R Installation and Setup

What should you click on the left sidebar to start the R installation?

Click on the CRAN link.

p.22
Data Types and Structures in R

What is the coercion rule order in R?

logical -> integer -> numeric -> complex -> character.

p.5
Statistical Computing and Machine Learning with R

What is R commonly used for?

Implementing machine learning algorithms in various fields like finance, genetics research, retail, marketing, and health care.

p.9
R Installation and Setup

What are the two ways to execute R programming?

Typing commands in an R session or saving commands as a script file.

p.16
Basic R Syntax and Commands

What is the result of 0XF + 1?

16.

p.1
Basic R Syntax and Commands

What type of programming language is R?

An interpreted computer language that allows branching, looping, and modular programming using functions.

p.22
Data Types and Structures in R

What is the result of coercing a character vector like c('a', 'b', 'c') to numeric?

It does not work and returns NA.

p.4
Basic R Syntax and Commands

How might programmers from other languages find R initially?

Quirky and confusing due to its different syntax.

p.3
Features and Benefits of R

Why is the adoption of R by tech giants significant?

It indicates the programming language's potential.

p.5
Alternatives to R Programming

When might R be a better choice than Python?

When analyzing a dataset and presenting findings in a research paper.

p.9
R Installation and Setup

What command provides online help in R?

'help()'.

p.23
Lists and Data Frames

What is a list in R?

A container that can hold different data types and structures.

p.21
Data Types and Structures in R

What is the purpose of the length() function in R?

To determine the number of elements in a vector.

p.12
Basic R Syntax and Commands

What command provides information about a specific file in R?

file.info('filename')

p.3
Features and Benefits of R

How does Ford use R?

To analyze social media for design decisions.

p.4
Statistical Computing and Machine Learning with R

What is R's role in statistical computing?

It is the most popular programming language among statisticians, built specifically for them.

p.15
Basic R Syntax and Commands

What is the preferred practice for naming variables in current versions of R?

Using period (.) as word separators.

p.20
Vectors and Their Operations

How do you create an empty vector in R?

Using vector() function, e.g., x <- vector().

p.15
Basic R Syntax and Commands

What are the basic types of constants in R?

Numeric constants and character constants.

p.19
Data Types and Structures in R

What is the common source of frustration among beginners in R?

Understanding basic data types and structures.

p.4
Statistical Computing and Machine Learning with R

In what areas has R found significant use?

Predictive analytics and machine learning.

p.7
R Installation and Setup

What do you need to select after clicking the CRAN link?

Select a mirror.

p.11
Basic R Syntax and Commands

What happens to the workspace when R is restarted?

The workspace and all created objects are restored automatically from the '.RData' directory.

p.13
Basic R Syntax and Commands

Name three reserved words used for conditions and loops in R.

if, else, while.

p.23
Matrices and Arrays in R

How are matrices constructed in R?

Matrices are constructed columnwise.

p.10
Basic R Syntax and Commands

How do you get help on a function in R?

Type help(function-name) in the R prompt.

p.19
Data Types and Structures in R

What is the result of printing the class of an integer vector in R?

[1] "integer"

p.14
R Variables and Constants

What is an identifier in R?

A unique name given to a variable, function, or object.

p.21
Data Types and Structures in R

How do you create a logical vector in R?

Using c(TRUE, TRUE, FALSE, FALSE).

p.18
Data Types and Structures in R

What are some frequently used R-Objects?

Vectors, Lists, Matrices, Arrays, Factors, Data Frames.

p.2
Features and Benefits of R

What makes R different from most other statistical software packages?

R is an object-oriented programming environment.

p.18
Data Types and Structures in R

What is the simplest R-object?

The vector object.

p.16
Basic R Syntax and Commands

What are the built-in constants for uppercase letters in R?

LETTERS: "A", "B", "C", ..., "Z".

p.9
R Installation and Setup

What does the command 'demo()' do in R?

It shows some demos.

p.8
R Installation and Setup

What should you click to download the base distribution of R?

Click on the link that downloads the base distribution.

p.21
Data Types and Structures in R

How can you add an element to an existing vector in R?

Using c(z, 'Annette').

p.20
Vectors and Their Operations

What are atomic vectors in R?

Vectors that can be of characters, logical, integers, or numeric.

p.1
Features and Benefits of R

How does R handle graphical representation?

It provides graphical facilities for data analysis and display.

p.18
Data Types and Structures in R

What is an example of a numeric data type in R?

12.3, 5, 999.

p.21
Data Types and Structures in R

What does Inf represent in R?

Infinity, which can be positive or negative.

p.5
Alternatives to R Programming

What is a downside of SPSS?

It is expensive.

p.23
Lists and Data Frames

What does the function is.recursive() check in R?

It checks if an object is a recursive list.

p.15
Data Types and Structures in R

What does a numeric constant followed by 'i' signify in R?

It is regarded as complex.

p.13
Basic R Syntax and Commands

What is the purpose of multi-line comments in R?

To provide explanations without interfering with the actual program.

p.12
Basic R Syntax and Commands

What command is used to list all objects in the current R environment?

ls()

p.16
Basic R Syntax and Commands

How are numeric constants interpreted when preceded by 0x or 0X?

They are interpreted as hexadecimal numbers.

p.6
R Installation and Setup

What is the latest release version of R mentioned?

R - 3.4.0.

p.10
Basic R Syntax and Commands

What happens when you type a variable name in an R session?

It prints the value of the variable on the screen.

p.12
Basic R Syntax and Commands

How can you get the current working directory in R?

By using the getwd() command.

p.14
R Variables and Constants

What are variables used for in R?

To store data, whose value can be changed according to our need.

p.9
R Installation and Setup

What output is generated when starting an R session?

R version information and copyright details.

p.20
Data Types and Structures in R

What function is used to find the storage mode of an object in R?

storage.mode()

p.10
Basic R Syntax and Commands

What happens if you choose 'n' when asked to save the workspace image?

All memory of current session commands and variables is lost.

p.16
Basic R Syntax and Commands

What is the output of typeof("5") in R?

"character".

p.3
Features and Benefits of R

What type of decisions do companies make based on R?

Decisions backed by concrete analysis of data.

p.20
Data Types and Structures in R

What are the main data structures in R?

Vector, list, matrix, data frame, factors, and tables.

p.13
Basic R Syntax and Commands

Is R a case-sensitive language?

Yes, TRUE and True are not the same.

p.17
Basic R Syntax and Commands

How can you change the value of pi in R?

By assigning a new value, e.g., pi <- 56.

p.12
Basic R Syntax and Commands

How do you write a single-line comment in R?

By starting the line with #.

p.5
Alternatives to R Programming

Why is SPSS considered easy to learn?

It is similar to Excel, making it user-friendly for non-statisticians.

p.18
Data Types and Structures in R

What is an example of an integer data type in R?

2L, 34L, 0L.

p.15
Basic R Syntax and Commands

How can you check the type of a numeric constant in R?

Using the typeof() function.

p.2
Features and Benefits of R

What is a significant advantage of R being open source?

R is free to download and can be used in commercial applications without legal issues.

p.15
Data Types and Structures in R

What is the output of typeof(5) in R?

"double".

p.7
R Installation and Setup

What is the first step to run R programming on a Windows computer?

Go to the official site of R programming (https://www.r-project.org/).

p.14
R Variables and Constants

What does the word 'TRUE' represent in R?

A logical constant.

p.3
Features and Benefits of R

What is the average salary for data scientists in the US?

$144,000.

p.9
R Installation and Setup

What command is used to start an R session?

'R' from the command line.

p.20
Data Types and Structures in R

What function is used to determine the type of an object in R?

typeof()

p.1
Introduction to R Programming

Who created R?

Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand.

p.18
Data Types and Structures in R

What types of data can be stored in R variables?

Character, wide character, integer, floating point, double floating point, Boolean, etc.

p.21
Data Types and Structures in R

What type of vectors can you create in R?

Logical vectors, character vectors, numeric vectors, and complex vectors.

p.18
Data Types and Structures in R

How does R handle variable data types compared to languages like C and Java?

In R, variables are not declared with a data type; they are assigned R-Objects, and the data type of the R-object becomes the variable's data type.

p.11
Basic R Syntax and Commands

What command removes all objects created in the current R session?

rm(list = ls())

p.14
R Variables and Constants

What are the rules for writing identifiers in R?

1. Can include letters, digits, period (.), and underscore (_). 2. Must start with a letter or a period (not followed by a digit). 3. Reserved words cannot be used.

p.4
Data Types and Structures in R

What types of programming constructs does R use instead of traditional loops?

Vectors, lists, frames, data tables, matrices, etc.

p.10
Basic R Syntax and Commands

What is the workspace in R?

A memory portion where R objects created and loaded are stored.

p.5
Alternatives to R Programming

What is SAS primarily used for?

Analytics needs in private enterprises.

p.6
Basic R Syntax and Commands

What is the file extension for R scripts?

.R

p.23
Lists and Data Frames

How can you create a list in R?

Using the list() function or coercing other objects with as.list().

p.2
Features and Benefits of R

What are R's capabilities in terms of graphics?

R has state-of-the-art graphics capabilities to visualize complex data.

p.18
Data Types and Structures in R

What is an example of a logical data type in R?

TRUE, FALSE.

p.2
Features and Benefits of R

How can R be integrated with other programming languages?

R functionality can be integrated into applications written in C++, Java, Python, PHP, SAS, and SPSS.

p.3
Features and Benefits of R

What contribution did Microsoft make to R?

Released Microsoft R Open and Microsoft R Server.

p.4
Statistical Computing and Machine Learning with R

How many packages does R have for statistical functions?

More than 9100 packages.

p.20
Vectors and Their Operations

How do you create a numeric vector in R?

Using c() function, e.g., x <- c(1, 2, 3).

p.3
Features and Benefits of R

Is R programming easy to learn?

It's a difficult question; many researchers learn it as their first language.

p.15
Data Types and Structures in R

What does a numeric constant followed by 'L' signify in R?

It is regarded as an integer.

p.8
R Installation and Setup

What is the syntax for using the help.search function?

> ??search_term.

p.10
Basic R Syntax and Commands

What command is used to exit the R session?

Type quit() in the R prompt.

p.5
Alternatives to R Programming

Why is Python favored by data scientists?

It is a powerful high-level, object-oriented programming language with easy-to-use syntax.

p.2
Features and Benefits of R

What type of programming language is R?

An open source programming language and software environment for statistical computing and graphics.

p.20
Data Types and Structures in R

What function is used to find the length of an object in R?

length()

p.21
Data Types and Structures in R

What function can you use to examine the type of a vector in R?

typeof(z).

p.12
Basic R Syntax and Commands

How can you list the names of files in the current directory in R?

By using the list.files() command.

p.3
Features and Benefits of R

What is one application of R at Twitter?

Monitoring user experience.

p.5
Alternatives to R Programming

What makes SAS a good tool for companies?

Its GUI, comprehensive documentation, and reliable technical support.

p.1
Statistical Computing and Machine Learning with R

What kind of tools does R provide for data analysis?

A large, coherent, and integrated collection of tools.

p.23
Lists and Data Frames

What makes lists fundamentally different from atomic vectors in R?

Lists can contain elements of different classes and even other lists.

p.12
Basic R Syntax and Commands

Does R support multi-line comments?

No, but you can use a trick to simulate them.

p.2
Features and Benefits of R

What platforms does R run on?

Windows, Unix, and Mac OS X.

p.23
Lists and Data Frames

How can lists be useful inside functions in R?

They can combine different types of results into a single object.

p.17
Basic R Syntax and Commands

What is the purpose of variables in programming?

To store various information.

p.8
R Installation and Setup

What is the syntax to use the help function in R?

> help(Syntax) or > ?Syntax.

p.15
Data Types and Structures in R

What is the output of typeof(5L) in R?

"integer".

p.23
Matrices and Arrays in R

What functions are used to bind columns or rows in R?

cbind() and rbind().

p.13
Basic R Syntax and Commands

What does NA represent in R?

Not Available, used to represent missing values.

p.8
R Installation and Setup

What is the first step to install R on Windows?

Click 'Download R for Windows'.

p.15
Basic R Syntax and Commands

What are some examples of invalid identifiers in R?

tot@l, 5um, .0ne.

p.22
Matrices and Arrays in R

What does dim(m) return for a matrix m?

The dimensions of the matrix (number of rows and columns).

p.16
Basic R Syntax and Commands

What are the built-in constants for lowercase letters in R?

letters: "a", "b", "c", ..., "z".

p.10
Basic R Syntax and Commands

What is the typical working directory in Linux for R?

The directory from where R was launched.

p.16
Basic R Syntax and Commands

What is the value of the built-in constant pi in R?

3.141593.

p.9
R Installation and Setup

What does the command 'contributors()' provide?

Information about contributors to R.

p.8
R Installation and Setup

Should I install the 32-bit or 64-bit version of R?

Most people don’t need to worry; both versions run seamlessly on 64-bit Windows.

p.17
Basic R Syntax and Commands

How can you concatenate multiple items in R?

Using the paste() function.

p.21
Data Types and Structures in R

What does NaN mean in R?

Not a number, indicating an undefined value.

p.21
Data Types and Structures in R

What are some attributes that can be part of an object in R?

Names, dimnames, length, and class.

p.2
Features and Benefits of R

What is the median salary for data scientists according to a 2014 survey?

$98,000 worldwide.

p.18
Data Types and Structures in R

How many data types are there for atomic vectors in R?

Six data types.

p.4
Statistical Computing and Machine Learning with R

What did Harvard Business Review call data scientists?

The 'sexiest job of the 21st century.'

p.9
R Installation and Setup

What is the purpose of the 'license()' command in R?

To view distribution details.

p.5
Alternatives to R Programming

What is SPSS commonly used for?

Statistical analysis, especially in the social sciences.

p.23
Lists and Data Frames

What is the output format of lists when printed in R?

Each element prints on a new line.

p.3
Features and Benefits of R

What is one way the New York Times uses R?

For infographics and data journalism.

p.2
Features and Benefits of R

Why is R considered extensible?

R can be expanded by installing additional packages.

p.19
Data Types and Structures in R

What is the fundamental concept about everything in R?

Everything in R is an object.

p.15
Basic R Syntax and Commands

What was the traditional assignment operator in earlier versions of R?

Underscore (_).

p.8
R Installation and Setup

What should you do after downloading the R installation file?

Run the file and follow the steps in the instructions to install R.

p.21
Data Types and Structures in R

What does the seq() function do in R?

Creates a sequence of numbers.

p.17
Basic R Syntax and Commands

How can you suppress quotes in the output of print()?

By using the argument quote = FALSE.

p.1
Introduction to R Programming

Why is R considered the #1 choice for data scientists?

Due to its wide usage, effective tools, and support from a vibrant community.

p.4
Statistical Computing and Machine Learning with R

What capabilities does R offer for data visualization?

It allows you to plot data and create interesting visualizations from any dataset.

p.8
R Installation and Setup

How can you get help on specific topics in R?

Use the help() function along with the topic you want to search.

p.8
R Installation and Setup

What function can be used for a search engine type of search in R?

The help.search() function.

p.15
Data Types and Structures in R

What is the output of typeof(5i) in R?

"complex".

p.17
Basic R Syntax and Commands

What function is used to print output in R?

The print() function.

p.19
Data Types and Structures in R

Why is it important to understand basic data types in R?

They are manipulated on a day-to-day basis in R.

p.19
Data Types and Structures in R

How many basic atomic classes does R have?

5 basic atomic classes.

p.8
R Installation and Setup

When might you consider installing the 32-bit version of R?

If your production environment is 32-bit due to potential compatibility issues.

p.20
Vectors and Their Operations

How do you explicitly create integers in R?

By adding an 'L' at the end, e.g., x1 <- c(1L, 2L, 3L).

p.2
Features and Benefits of R

How popular is R as a programming language?

R was ranked 5th in popularity among programming languages in 2016, up from 6th in 2015.

Study Smarter, Not Harder
Study Smarter, Not Harder