Programming with R Part 1 Flashcards

1
Q

What is R?

A

Statistical programming language for doing statistical analysis
Derived from the S language
Developed by John Chambers at Bell Labs

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

What are the 5 Basic atomic classes of R

A
Character
Numeric
Integer
Complex
Logical
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How are numbers stored?

A

as Double Precision Real Numbers - if you want an int you need to specify the L suffix

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

how do you store variables?

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

What are vectors?

A

essentially arrays

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

what does a colon do?

A

A range of numbers,

1:5 would generate

1, 2, 3, 4, 5

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

How do you generate a sequence?

A

seq(from, to, by)

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

How do you repeat numbers

A

rep(vector, repetitions)

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

How do you evaluate vectors

A

any() and all()

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

how do you sample?

A

after setting the seed:

sample(vector, size of sample)

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