R coding language Flashcards

1
Q

How to create a value:

A

Name of the value <- value, for a set it must be c(a,b,c,d).

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

How to create a scatter graph:

A

plot (x value, y value)

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

How to change the limits of the graph axis:

A

xlim= c(a,b), ylim= c(c,d)

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

How to change the colour of the graph:

A

(…, col= “colour”,…)

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

How to title a graph:

A

(…,main=”title”,…)

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

Binomial PD:

A

dbinom (x, n, p)

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

Binomial CD:

A

pbinom (x, n, p)

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

Bar graph:

A

barplot (value function…)

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

Sum of binomial values

A

sum(dbinom(a:b, n, p)

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

P value for binomial distributions:

A

qbinom (p value, n, p)

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

Randomly generated deviates for binomial distribution:

A

rbinom (x, n, p)

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

Matrix:

A

New values <- matrix (values, rows, columns)

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

Data Frame:

A

value <- data.frame (ID=value, Name=value)

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

Binomial Distribution Graph:

A

barplot (bin.d, names=bin.d)

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

Histogram:

A

hist(values, prob=TRUE, …)

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

Factorial of a number:

A

Fact <- function(x) {if(x==0){return(1)}else{return(x*Fact(x-1))}}
Fact(5)

17
Q

Explaining functions and values:

18
Q

Specific number of breaks in a graph:

A

hist(…, breaks=20,…)