Homework Problem 3, Due Friday February 8. ------------------------------------------ (a) Define and test an R function "matcols" which does the following. Your input arguments are to be: xvec, a numeric vector (of arbitrary length) outcol, a number of non-constant columns (at least 1) On output, your function should produce a matrix consisting of a first column of all 1's (same length as xvec), then the column xvec itself, then xvec^2, ... up to xvec^outcol. (b) Define and test an R function "convtype" which does the following: Your input arguments are: a data-frame infram; also there should be character input arguments: "charac", "numer", and "bool". These character arguments are to be optional, with default value "NULL". If "charac" is equal to "factor", then the character columns, if any, are to be converted to type "factor". (No other non-null values for "charac" are allowed.) Similarly, if "numer" is "charac", then the numeric columns, if any, are to be converted to "character" type columns. Finally, if "bool" is "charac" (respectively "numer"), then the logical columns of infram , if any, are to be converted to "character" (respectively "numeric") type. On output, you should have created a data-frame the same size as infram , with the column type conversions performed as indicated as above from the input arguments. A typical call to the function you write might be: > outfram = convtype(dfram, charac = "factor", bool="numer") in which case outfram should have the character columns of dfram converted to be factor-type and the logical columns of dfram should have been converted to numeric (1's instead of T, 0's for F). MAKE SURE TO TEST YOUR FUNCTIONS (and show some of the test results) TO CONFIRM THAT YOUR R FUNCTIONS DO THE REQUIRED TASKS CORRECTLY !