question id: squiggle
3 Computing with R
\[ \newcommand{\dnorm}{\text{dnorm}} \newcommand{\pnorm}{\text{pnorm}} \newcommand{\recip}{\text{recip}} \]
Reading questions
Reading question 3.1 What is the name of the character “\(\LARGE{\sim}\)” ?
Reading question 3.2 What does the R statement in Active R chunk lst-bogus-intro do?
The statement creates a function named b()
whose output is always 13.3.
The statement lets you refer to the value 13.3 by the name b
.
The statement asks whether b
is less than \(-13.3\).
question id: assignment-1
Reading question 3.3 In referring to R computing, what is “argument”?
It’s another word for “function.”
It’s another word for “parameter.”
It’s another word for “input to a function.”
question id: argument-is-what
Reading question 3.4 You will see R commands like those in Active R chunk lst-03-reading-george throughout this book, so we might as well start off with them:
- What name is being given to the function?
question id: makefun-a
- What kind of R/computational thing is
x^2 ~ x
?
question id: makefun-b
- Which of these characters will you aways find in a tilde expression?
x
=
~
question id: makefun-c
- Using Active R chunk lst-03-makefun-d, evaluate the function
george()
on the input value 7. Sincegeorge()
is defined in Active R chunk lst-03-reading-george, make sure to run the code there first.
Note about collecting answers. The contents of interactive R chunks are collected when you submit your work, along with other answers in the document.
- All of these except one is a reasonable way to put the tilde character into words. Which is the exception?
question id: makefun-e
- How many arguments does
makeFun()
take in the above command?
question id: makefun-f
Reading question 3.5 The statement in the following code block makes use of a name that has not previously been assigned a value. This is a mistake, but it is a common one.
- Run the code in Active R chunk lst-unbound-y. It will produce an error message. Following the flag
Error:
is a short message that attempts to explain what went wrong. What does “not found
” mean?
y
is not a name.
The name y
is not bound to a value.
The name x
is not bound to a value.
The parentheses are out of place.
question id: not-found
- Add a line to the code in Active R chunk lst-unbound-y that will assign
y
the value16
. There are two places you can put the new line: before the old one or after the old one. Put it in the right place so that the command formed by the two lines does not generate an error.
Remember: The code you have entered in the R blocks is automatically included when you collect the answers for the assignment.