STAT 705 Homework Problem Set 1, Due Wednesday September 6, 2017. -------------------------------------------------------- Assigned 8/28/2016, Due 9/6/2017 ------- 12 points For each of the following problem parts, your submitted HW solution should contain (a few) R code lines, together with at least one more code line showing IN BRIEF that your code works as desired. LENGTHY OUTPUTS ARE DISCOURAGED -- YOU MAY OF COURSE GENERATE THEM FOR YOUR OWN CHECKING, BUT I AM LOOKING FOR BRIEF WAYS TO VERIFY SOME NON-OBVIOUS ASPECT (your choice) OF THE R OBJECTS YOU GENERATE. (a) Give the R code lines to create a single long integer vector named LongI in your workspace, consisting of: a concatenation of k repetitions of the vector 1:k , for k=1,2,...,20. Relevant R commands: "rep", "list", "for" (b) Check that the vector you generate in (a), has the correct length, and give the 777'th and 1200'th entries of it. (Explain how you know that these are correct.) (c) Give a table of the frequencies of occurrence of all of the decimal digits 0,...,9 occurring by concatenating the numbers in your vector in (a). (Again: indicate how you know what the answers should be if you generated the vector in (a) correctly.) Relevant R commands: "table", "hist" (d) Create a 5x10 matrix CMAT of character labels of the form "xy" where "x" is a name from the list {"John","James","Henry","Doug","Richard"} and "y" is the character version of a 3-digit number (with leading 0 allowed) consisting of the leading three digits (after the decimal point) of abs(sin(100*k)) as k ranges from 1 to 10. Relevant R commands: "paste", "substr", "outer" (e) Concatenate the character strings in your matrix (along columns) into one long character string "LongStr", and convert it into a vector "CharVec" of single characters. (f) Create a list "CombList" with named components containing all of the named objects generated in (a), (c), (d), (e). What is the meaning of the output when you type, > sapply(CombList, class) ? Relevant R commands: "sapply", "class"