R Flashcards

1
Q

R language is used for?

A

data analysis and Statistical Computing

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

it is especially relevant for data science professionals due to its data cleaning, importing, and visualization capabilities.

A

R

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

You can use R to create

A

graphics and charts

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

What are the 2 reasons why this language is called R

A
  1. R is the first letter in the inventors’ names
  2. R is a play on the name of its parent language S,
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Who developed S language

A

Bell Telephone Laboratories.

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

When does R language created

A

early 1990s

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

Who created R language?

A

Ross Ihaka and Robert Gentleman.

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

Ihaka and Gentleman are both statistics professors in what university?

A

New Zealand university

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

How to print/output a text

A

Use single or double quotes.

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

Print/output Numbers

A

Just type the number (without quotes)

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

Print/output simple calculations’

A

just type the equation without = sign

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

Can you output a code without using a print function?

A

YES

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

When do you need to use the print()

A

when your code is inside an expression or inside curly brace { }

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

What should we use to create a comment in R language

A

#

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

Does R language have a command for declaring a variable?

A

It does not have

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

<- is use for?

A

it is use to assign value to a variable

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

TRUE or FALSE:

To print the variable value, just type the variable name.

A

TRUE

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

When you are working with loops, what can you use to print a variable?

A

print ( ) / print function

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

it is use to concatenate or join two or more elements

A

paste ( ) / paste function

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

In R, we can use this to combine both text and variable

A

comma ( , )

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

It can also use to add a variable to another variable

A

comma ( , )

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

can you combine a string (text) and a number?

A

No

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

TRUE OR FALSE:

You can’t assign the same value to multiple variables in one line.

A

FALSE

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

How do we assign the same value to multiple variables?

A

variable 1 <- variable 2 <- variable 3 <- “Hello world”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
TRUE OR FALSE: A variable name must start with a letter and can be a combination of letters, digits, period(.)
TRUE
26
TRUE OR FALSE: A variable name can start with a number or underscore (_)
FALSE
27
Is Variable name in R language is case-sensitive?
Yes
28
TRUE or FALSE: Reserved words can be used as variables
FALSE
29
Enumerate the Data Types in R language
1. Numeric 2. Integer 3. Complex 4. Character 5. Logical
30
Contains any number with or without decimal
Numeric
31
It is a Numeric data without Decimal
Integer
32
What should we use at the end of the data type integer?
L
33
What data type is in this form: a + bi
Complex
34
Also known as String
Character
35
Also known as boolean
Logical
36
What can we use to check the data type of a variable?
class ( )
37
What are the 3 Number types in R?
Numeric Integer Complex
38
3 Type conversion
as.numeric() as.integer() as.complex()
39
OPERATORS
+ - * / ^ %% %/%
40
Build in math functions
min() max() sqrt() abs() ceiling() floor()
41
use to find the lowest number in a set
min()
42
use to find the largest number in a set
max()
43
Returns the square root of a number
sqrt()
44
Returns the absolute value of a number
abs()
45
Rounds a number upwards to its nearest integer
ceiling()
46
Rounds a number downwards to its nearest integer
floor()
47
Is use to find the number of characters in a string
nchar()
48
Use to check if a character or a sequence of characters are present in a string
grepl()
49
To merge/concatenate two strings
paste()
50
what can we use to insert characters that are illegal in a string
Escape Characters
51
\\
Backslash
52
\n
Newline
53
\r
Carriage Return
54
\t
Tab
55
\b
Backspace
56
ENUMERATE GRAPHICS IN R
Plot Line Scatterplot Pie charts bars
57
what function can we use to plot a point
plot()
58
what function can we use to create a line
plot ( ) & type parameter
59
what function can we use to create a scatterplot
Plot()
60
what function can we use to create a pie chart
pie()
61
what function can we use to create a bar graph
barplot()