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

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 

Step by Step Solution

3.33 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Create a vector k1 w... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!