Exercises
Write a program that modifies the function
intro()
(see Section 1.2.4) so that the person who introduces him or herself states a favorite sport. For example, the result of the following function call:intro(name = "Bettina", type = "human", sport = "lacrosse")
should be:
## Hello, I am a human. ## My name is Bettina. ## My favorite sport is lacrosse.
Write a program that modifies the function
intro()
(see Section 1.2.4) so that the person who introduces him or herself says what planet he or she is from. For example, the result of the following function call:intro(name = "Zarg", planet = "Jupiter", food = "rubber bands")
should be:
## Hello, my name is Zarg! ## My home planet is Jupiter. ## I like to eat rubber bands.
Write a program to produce the following output to the console:
## * ## ** ## *** ## ** ## *
Write a program to produce the following output to the console:
## meow! ## hiss! hiss! ## meow! ## hiss! hiss! hiss! ## meow
Suppose we want to
cat
“Hello, World” to the console, and we enter:cat(Hello, World!)
What does R say? What did we do wrong?
Suppose we want to
cat
“Hello, World” to the console, and we enter:"Hello, World!"] cat[
What does R say? What did we do wrong?