Please download the answer file and edit it on Rstudio. Write your student number in the correct place at the beginning of the answer file. You should be able to Knit HTML and get the same results as the document you have in paper. Please do Knit often and verify that your document has no errors. If your document does not Knit, you will not have full grade.
When you finish, send the answers.Rmd
file to my mailbox (andres.aravena+cmb@istanbul.edu.tr
). Be sure to use the correct email address and send only one file.
IMPORTANT: Write your student number in the correct place at the beginning of the answer file.
[1] "x" "y" "y" "z" "z" "z"
# write your answer here
[1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
# write your answer here
Assign this vector to the variable x
. Then show the content of x
one two three four
1 2 3 4
# write your answer here
two
in the vector x
two
2
# write your answer here
Your R system has already some vectors to be used for exercises. One of them is letters
, containing the English alphabet
letters
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s"
[20] "t" "u" "v" "w" "x" "y" "z"
# write your answer here
[1] "b"
# write your answer here
[1] "j"
# write your answer here
TRUE
for the vowels in letters
. In English the vowels are c("a", "e", "i", "o", "u")
[1] TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE
[13] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE
[25] FALSE FALSE
# write your answer here
[1] "z"
# write your answer here
[1] "a" "b" "c" "d" "e" "f"
# write your answer here
[1] "t" "u" "v" "w" "x" "y" "z"
# write your answer here
[1] "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v"
[20] "w" "x" "y" "z"
# write your answer here
[1] "e" "g" "i" "k" "m" "o"
# write your answer here
Other vectors already included in R are used to describe USA states. They include state.area
and state.name
, which we will use in this exercise.
In the future we will work with other countries’ data, but these are easier to use for this homework.
TRUE
for the elements of state.area
that are greater than 5E4 [1] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE FALSE TRUE
[13] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
[25] TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE TRUE
[37] TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE FALSE
[49] TRUE TRUE
# write your answer here
state.name
[1] "Alabama" "Alaska" "Arizona" "Arkansas"
# write your answer here
state.name
, except the first 40 [1] "South Dakota" "Tennessee" "Texas" "Utah"
[5] "Vermont" "Virginia" "Washington" "West Virginia"
[9] "Wisconsin" "Wyoming"
# write your answer here
state.name
corresponding to states whose area is greater than 2E5[1] "Alaska" "Texas"
# write your answer here