Show the R-code for the following steps and write the resulting output only where asked. a)
Question:
Show the R-code for the following steps and write the resulting output only where asked.
a) Create a vector k1 with numbers from 22 to 17, and a vector k2 with numbers from 55 to 60. Show only the R-code.
b) Create a third vector k3 with 6 elements with the following values: "Comedy", "Action", "Drama", "Horror", "Romance", "Mystery". Show only the R-code.
c) Create a dataframe object kDF using the data.frame command to combine the vectors k1, k2 and k3. Show only the R-code.
d) Name the columns of the dataframe kDF as "Item", "Cid", "Genre". Show only the R-code.
e) Show the R-code and the output for the following.
(i) element of the dataframe kDF in the 2nd row, 1st column
(ii) entire second column of the dataframe kDF
(iii) entire first row of the dataframe kDF
(iv) 1st and 2nd columns of the 1st and 3rd rows of the dataframe kDF
(v) referring by its name, print the third column of the dataframe kDF
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill