Analytics with R: Create object called “abc” by assigning the number 3. Calculate the number of observation (n), mean, sum, max, min, variance of the vector ‘x”.

Analytics with R: Assignment / Class Work-1

 

  1. How to get a description of the version of R and its attached packages used in the current session?
  2. Create object called “abc” by assigning the number 3.
  3. Create different vectors (“a” is numeric, “b” is character and “c” is logical).
  4. List all the objects in the current session.
  5. Create vector “x” with the values {4, 4, 5, 6, 7, 2, 9}.
  6. Calculate the number of observation (n), mean, sum, max, min, variance of the vector ‘x”.
  7. Also print the 3rd element, odd positions elements and elements from 2 to 6 positions.

 

  1. Create 6×4 matrix(6 rows and 4 columns) using 1 to 24 numbers.
  2. Create data frame with the below vectors
  3. StoreID – (111, 208, 113, 408)
  4. Tenure – (25, 34, 28, 52)
  5. StoreType – (“Type1”, “Type2”, “Type1”, “Type1”)
  6. status – (“Poor”, “Improved”, “Excellent”, “Poor”)
  7. Print the data in different programs.
  8. only storeId, tenure
  9. only storetype and status
  10. only tenure
  11. Create different factors using the below vectors and label the values and order the levels for factors “outcome” and “status”.
  12. ethnicity– “White”, “African Amrican”, “Black”, “Asian”
  13. status– “Poor”, “Improved”, “Excellent”, “Poor”
  14. outcome- c(1, 3, 2, 4, 3, 1, 1) –
  15. labels- “Poor”, “Average”, “Good”, “Excellent”

 

  1. Read the stores.csv data set and find the summary statistics for all the columns.
Type of paper Academic level Subject area
Number of pages Paper urgency Cost per page:
 Total: