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
Q

TRUE OR FALSE:

A variable name must start with a letter and can be a combination of letters, digits, period(.)

A

TRUE

26
Q

TRUE OR FALSE:

A variable name can start with a number or underscore (_)

A

FALSE

27
Q

Is Variable name in R language is case-sensitive?

A

Yes

28
Q

TRUE or FALSE:

Reserved words can be used as variables

A

FALSE

29
Q

Enumerate the Data Types in R language

A
  1. Numeric
  2. Integer
  3. Complex
  4. Character
  5. Logical
30
Q

Contains any number with or without decimal

A

Numeric

31
Q

It is a Numeric data without Decimal

A

Integer

32
Q

What should we use at the end of the data type integer?

A

L

33
Q

What data type is in this form:

a + bi

A

Complex

34
Q

Also known as String

A

Character

35
Q

Also known as boolean

A

Logical

36
Q

What can we use to check the data type of a variable?

A

class ( )

37
Q

What are the 3 Number types in R?

A

Numeric
Integer
Complex

38
Q

3 Type conversion

A

as.numeric()
as.integer()
as.complex()

39
Q

OPERATORS

A

*
/

%%
%/%

40
Q

Build in math functions

A

min()
max()
sqrt()
abs()
ceiling()
floor()

41
Q

use to find the lowest number in a set

A

min()

42
Q

use to find the largest number in a set

A

max()

43
Q

Returns the square root of a number

A

sqrt()

44
Q

Returns the absolute value of a number

A

abs()

45
Q

Rounds a number upwards to its nearest integer

A

ceiling()

46
Q

Rounds a number downwards to its nearest integer

A

floor()

47
Q

Is use to find the number of characters in a string

A

nchar()

48
Q

Use to check if a character or a sequence of characters are present in a string

A

grepl()

49
Q

To merge/concatenate two strings

A

paste()

50
Q

what can we use to insert characters that are illegal in a string

A

Escape Characters

51
Q

\

A

Backslash

52
Q

\n

A

Newline

53
Q

\r

A

Carriage Return

54
Q

\t

A

Tab

55
Q

\b

A

Backspace

56
Q

ENUMERATE GRAPHICS IN R

A

Plot
Line
Scatterplot
Pie charts
bars

57
Q

what function can we use to plot a point

A

plot()

58
Q

what function can we use to create a line

A

plot ( ) & type parameter

59
Q

what function can we use to create a scatterplot

A

Plot()

60
Q

what function can we use to create a pie chart

A

pie()

61
Q

what function can we use to create a bar graph

A

barplot()