Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This program is to be run in R please help me with question number 3 part D 3. Using the built-in matrix state.x77, create/process the
This program is to be run in R please help me with question number 3 part D
3. Using the built-in matrix state.x77, create/process the following vectors/dataframes:
a. df3a as a data frame create from state.x77
d. df3b as a data frame whose data is identical to df3a; however, change the row names such that even numbered rows have the number for row name and d numbered rows retain the original row name i.e. Alabama, 2, Arizona, 4 so on.
compose the R script after carefully reading all the following instructions. The submitted scripts wil be graded using a grader script, so it is important the R script being submitted adheres to the instructions/requirements (names of variables used, names of functions used, case of the names etc.) stated in each of the tasks/questions. Please make sure that the script being submitted runs to completion without throwing any errors. Scripts that throw errors may receive a penalty of up to 50%. Create a variable named ewid and assign your CWID as its value. 2) Using the built-in mtcars data frame, create process the following vectors/datafrarnes: a. b. c. df2a with all rows and even numbered columns from mtcars df2b with odd numbered rows and all columns from mtcars df2c with every 4th row (1, 5, 9 ...) and every 3rd column (1, 4, 7 ...) from mtcars dE2d with all rows and all columns from mtcars with rows appearing in reserve order as compared to mtcars df2e with all rows and all columns from mtcars with columns appearing in reserve order as compared to mtcars d. e. Hint: See help on nrow; ncol. Using the built-in matrix state. x77, create/process the following vectors/dataframes: a. df3a as a data frame create from state.x77 b. vecColNames as a vector containing the column names from df3a c. vcRowNames as a vector containing the row names from df3a d. 3. dE3b as a data frame whose data is identical to de3a; however, change the row names such that even numbered rows have the number for row name and d numbered rows retain the original row name i.e. "Alabama", "2", "Arizona", "4" so on. Hint: See help on as.data.frame; rownames; colnames. Using the built-in matrix iris, create/process the following vectors/dataframes: a. 4. dfsa identical to iris; however, set Sepal.Length to 6.0 wherever the original (iris) values are greater than 5.5 and less than or equal to 6.7Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started