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
2
Q
What are the 5 Basic atomic classes of R
A
Character Numeric Integer Complex Logical
3
Q
How are numbers stored?
A
as Double Precision Real Numbers - if you want an int you need to specify the L suffix
4
Q
how do you store variables?
A
5
Q
What are vectors?
A
essentially arrays
6
Q
what does a colon do?
A
A range of numbers,
1:5 would generate
1, 2, 3, 4, 5
7
Q
How do you generate a sequence?
A
seq(from, to, by)
8
Q
How do you repeat numbers
A
rep(vector, repetitions)
9
Q
How do you evaluate vectors
A
any() and all()
10
Q
how do you sample?
A
after setting the seed:
sample(vector, size of sample)