Given the following R Code for input data. Do not change anything in the given code....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Given the following R Code for input data. Do not change anything in the given code. A<-2L B<-c(1,8,24,5000) C<-c(TRUE, FALSE, TRUE, TRUE) D<-rep(20,4) Follow step (i) to (v) to format and print. Write comments in your code to indicate which part you are doing and then answer Questions (1) to (5). (i) Set working directory to 'C:\Users\your student ID' and save your workspace. (ii) Create a 4 by 2 matrix call M1 with vector B and D in order (iii) Create a 4 by 4 data frame call D1 with vector A, B, C, and D in order. (iv) Create 4 vectors call mod, len, dou, and num. Vector mod and len are the mode and length of vector A, B, C, and D, respectively. Vector dou and num are the logical results of is.double and is.numeric for vector A, B, C, and D. Combine the 4 vectors mod, len, dou, and num into a data frame call D2. (v) Calculate the product of transpose of M1 and vector C. Name the result matrix as M2. Given the following R Code for input data. Do not change anything in the given code. A<-2L B<-c(1,8,24,5000) C<-c(TRUE, FALSE, TRUE, TRUE) D<-rep(20,4) Follow step (i) to (v) to format and print. Write comments in your code to indicate which part you are doing and then answer Questions (1) to (5). (i) Set working directory to 'C:\Users\your student ID' and save your workspace. (ii) Create a 4 by 2 matrix call M1 with vector B and D in order (iii) Create a 4 by 4 data frame call D1 with vector A, B, C, and D in order. (iv) Create 4 vectors call mod, len, dou, and num. Vector mod and len are the mode and length of vector A, B, C, and D, respectively. Vector dou and num are the logical results of is.double and is.numeric for vector A, B, C, and D. Combine the 4 vectors mod, len, dou, and num into a data frame call D2. (v) Calculate the product of transpose of M1 and vector C. Name the result matrix as M2.
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these electrical engineering questions
-
QUESTION 3 (43 marks) Samson Studio is a studio for clients to use for photos shots. Adjusting entries are performed on a monthly basis and closing entries are prepared annually on December 31. An...
-
Using R Studio to generate 1000 observations from a Poisson distribution with lambda=2.4 Use the 1000 observations you generated: a) Compute the average lambda over the 1000 observations b) Generate...
-
Using R Studio pick an airport (not IND) and year of your choice in the data set airlines. You should be using the function subset () to pick year and airport. Next, add a column called delay, which...
-
A trait determined by an X-linked dominant allele shows 100 percent penetrance and is expressed in 36 percent of the females in a population. Assuming that the population is in HardyWeinberg...
-
This chapter discusses many types of costs: opportunity cost, total cost, fixed cost, variable cost, average total cost, and marginal cost. Fill in the type of cost that best completes each sentence:...
-
Which of the following is mandated by federal law to communicate special protection information to employees regarding use of chemicals? A. Material Safety Data Sheets B. Minimum Data Sets C. Product...
-
A goodness-of-fit test is performed to test the null hypothesis that each of the six faces on a die has probability 16 of coming up. The null hypothesis is rejected. True or false: We can conclude...
-
Gladmark Company produces two types of get-well cards: scented and regular. Drivers for the four activities are as follows: The following activity data have been collected: Inspecting products...
-
Write about a time when tried to convince someone to do something. what reasons and/or evidence did you offer? were you successful in your argument? why or why not? the position you were trying to...
-
In this exercise you will be assuming the role of an Account Manager working within our Personal Care Appliances category during Amazon Black Friday. You act as a general manager responsible for...
-
The following expression gives the integral coordinate plane (the plane (the tu-plane) Sketch the region M3 sect integral -N3 I 3 Lost dudt. . region in a and (5 Cartesian evaluate the
-
Warren Co . , located in Canada, purchased raw materials from a supplier in US for $ 8 5 , 0 0 0 US on June 1 6 , 2 0 2 2 on credit with payment date as October 1 6 , 2 0 2 2 . Warren Co . prepares...
-
Go to the Bureau of Labor Statistics website. Click on and review the following links to describe about the relationship between age, race, gender, and unemployment? 1: Employment Situation Summary...
-
A uniform electric field of strength E = 24.6 N/C exists in a region between two oppositely charged plane parallel plates separated by a distance d = 2.53 cm. A charged particle with a mass of...
-
Explain why accurate accounting information helps with the overall analysis of the business. Discuss how inaccurate or false information impacts the business. In your opinion, discuss the importance...
-
Part A A ball is dropped from the top of a 55.0 m -high cliff. At the same time, a carefully aimed stone is thrown straight up from the bottom of the cliff with a speed of 20.0 m/s. The stone and...
-
Hosne's Production Possibilities Frontier At 10 9- 8 7 wallets 1 2 4 5 8 9 10 parses Merve's Production Possibilities 10 wallets 9 123 Refer to Figure 3-16. Hosne's opportunity cost of one purse is...
-
CdF2 (s) Cd+ (aq) + 2 F- (aq) 1. A saturated solution of CdF2 is prepared. The equilibrium in the solution is represented above. In the solution [Cd+] eq = 0.0585 M and [F-] eq = 0.117 M. a....
-
Quince Interests is a partnership with a tax year that ends September 30, 2012. During that year, Potter, a partner, received $3,000 per month as a guaranteed payment, and his share of partnership...
-
Jim (age 50) and Martha (age 49) are married with three dependent children. They file a joint return for 2012. Their income from salaries totals $50,000, and they received $10,000 in taxable...
-
Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is...
-
In the ammonia synthesis reaction \(\mathrm{N}_{2}+3 \mathrm{H}_{2}=2 \mathrm{NH}_{3}+22.4 \mathrm{kcal}\), the formation of \(\mathrm{NH}_{3}\) will be favoured by (a) High temperature (b) Low...
-
The internal energy of an ideal gas depends on (a) Temperature, specific heat and volume (b) Temperature and specific heat (c) Temperature, specific heat and pressure (d) Pressure, volume and...
-
For steady flow, the first law of thermodynamics (a) Is concerned with heat interaction (b) Is an energy balance for a specified mass of fluid (c) Accounts for all energy entering and leaving a...
Oracle PL/SQL Programming Database Management Systems 1st Edition - ISBN: 978-1565921429 - Free Book
Study smarter with the SolutionInn App