Chapter 2 Flashcards

1
Q

What is R?

A

R is a free statistical computing software widely used in fields like psychology, bioinformatics, and machine learning.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the recommended editor for writing R commands?

A

R Studio is the recommended editor for writing and modifying R commands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the basic arithmetic operations in R?

A

Basic arithmetic operations include addition (+), subtraction (-), multiplication (*), and division (/).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What logical operators are used in R?

A

Logical operators include <, <=, ==, !=, >=, >, which return boolean values (TRUE or FALSE).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some common mathematical functions in R?

A

Common mathematical functions include sqrt(), log10(), sin(), abs(), round(), and mean().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you assign values to variables in R?

A

Values are assigned to variables using the <- operator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the rules for naming variables in R?

A

Variable names must be case-sensitive, avoid minus signs, and not overlap with function names.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How are strings represented in R?

A

Strings are represented as character sequences enclosed in double quotes, e.g., “Text”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you create vectors in R?

A

Vectors can be created using c() for concatenation or numeric(n) for a vector of zeros.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What functions can be used on vectors in R?

A

Functions like mean(), var(), and sum() can be applied to vectors. Sequences can be generated with : or seq().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you create matrices in R?

A

Matrices can be created by combining vectors with cbind() or by importing data using read.csv().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you access elements in a matrix in R?

A

Elements in a matrix can be accessed using d[row, column] or $column_name for specific columns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can new columns be added to matrices or data frames in R?

A

New columns can be added by assigning values to a new column name, e.g., d$new_col <- values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you extend R’s functionality?

A

R’s functionality can be extended by installing and loading packages using library(package).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Where can you find resources and tutorials for learning R?

A

Resources include the official R manual at CRAN and tutorials at StatMethods.net.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly