Question: Exercises Write a program using R language to create a vector vec1 from 0.1 to 1 with an increment of 0.1. Find the length of

Exercises

  1. Write a program using R language to create a vector vec1 from 0.1 to 1 with an increment of 0.1.
    1. Find the length of this vector.
    2. Next create a 5x2 matrix called mat1 using vec1.
      1. Name each row and column as row1, col1, etc.
      2. Change the value of the element located in the 3rd row and 2nd column to 10.
      3. Print both the 3rd row and the 2nd column.
    3. Hints:
      1. Use seq() function to generate a sequence of numbers with certain increment.
      2. Search in R Documentation for matrix() function to see how to give names to rows and columns. Basically create two vectors and initialize them with the names, then pass these two vectors as a list to matrix() function as the value of dimnamesExercises Write a program using R language to create a vector vec1
  2. Write a program using R language to create the following data frame and call it practiceDF.
    1. Include your name in the first row, and then also include the following information.
    2. from 0.1 to 1 with an increment of 0.1. Find the length
    3. Create a second data frame from practiceDF by dropping the first two columns and call it practiceRes.
    4. Create a third data frame from practiceDF by dropping the following rows: 2, 4, 5, 8, and 9 and call the new data frame as practiceQual.
      1. Hints: Use subset() function to return a subset from the data frame. Search R Documentation to see how this function can be used to select vectors which meet certain conditions.
  3. Write a program using R language to convert temperature measurements from Fahrenheit, F, to Celsius, C, using the following equation:
    1. C=59(F32)
    2. Test your program using the following vector of Fahrenheit values: (45, 77, 19, 101, 120)

Usage Matrix (data NA, nrowl, ncol-i, byrow FALSE, dimnames=NULL, sparse - NULL, doDiag - TRUE, forceCheck = FALSE) 3. yes VOUAWN name score attempts qualify 1 Anastasia 12.5 1 Dima 9.0 no 3 Katherine 16.5 yes James 12.0 no Emily 9.0 no Michael 20.0 yes Matthew 14.5 yes Laura 13.5 no Kevin 8.0 no Jonas 19.0 1 yes MNMNMN 2. 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!