1 + "one"What type of variable is “age”?
Classify the recorded variable as continuous numerical, discrete numerical, nominal categorical, or ordinal categorical.
What type of variable is “age” here?
What type of variable is “age” here?
What type of variable is “age” here?
Basic coding
Make your best educated guess about what the following blocks of code will do when run.
What will happen if you run this code?
What will happen if you run this code?
a is a vector of length fourlog and sqrt are functions that, when passed a vector as input, will return a vectors with the function applied to each element.What will happen if you run this code?
a will still be equal to 3.a requires the assignment operator. Something like: a <- a + 1What will happen if you run this code?
You already did the Intro to Coding tutorial. Right?
Anyway we’ll go through a bit together, then get to work.
Head to stat20.datahub.berkeley.edu!
> and press enter/return to run them. The Console is in the lower-left pane.R allows all of the standard arithmetic operations.
R allows all of the standard arithmetic operations.
You can create/save objects using the assignment operator <- . This is the equivalent of = in other programming languages. . . .
In order to be recognized as a valid object name, you have to follow certain conventions; namely, the object name should begin with a letter.
| good names | names that cause errors |
|---|---|
| a | 1trial |
| b | $ |
| FOO | ^mean |
| my_var | my var |
A vector is the simplest structure used in R to store data. It can be created using the function c().
It’s right at the top of the course website.
Then start on Lab 1 (link on website).

05:00
20:00
