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...
-
Prometheus Co. records all cash receipts on the basis of its cash register receipts. Prometheus Co. discovered during April 2006 that one of its sales clerks had stolen an undetermined amount of cash...
-
Read the referenced article that fully describes the OR study summarized in the application vignette presented in Sec. 11.3. Briefly describe how dynamic programming was applied in this study. Then...
-
Referring to the information in Brief Exercise 17-28, assume the same information except that the lessee guaranteed the residual value for \(\$ 5,000\) at the end of the lease term. Compute the value...
-
1. Assume you are a financial analyst who works for a major brokerage company that is heavily invested in Bre-X Minerals. a. In what ways would investigating management and directors help determine...
-
Flood Inc. splits job functions in the expenditures cycle among three departments. The purchasing department prepares and sends a purchase order to the vendor. The receiving department accepts the...
-
Diana and Ryan Workman were married on January 1 of last year. Diana has an eight-year-old son, Jorge, from her previous marriage. Ryan works as a computer programmer at Datafile Inc. (DI) earning a...
-
Suppose you have a real estate investment opportunity that will generate $1,200 per month for the next year. What is the present value of this stream of cash flows if the annual discount rate is 6%?
-
Observations with what types of missing values should not be ignored because any analysis that includes the variables with these values will be biased?
-
James is currently on a bridge, 2 1 meters above the water and throws a ball in the horizontal direction. The ball gets to the water surface at a horizontal distance of 1 2 meters from James. ( a )...
-
Sam has two jobs, one for the winter and one for the summer. In the winter, he works as a lift attendant at a ski resort where he earns $13 per hour. During the summer, he drives a tour bus around...
-
Vera Spencer, a divorced mother of one, lived in a house she owned in suburban Mississauga, Ontario. Her daughter Karen was sixteen years old at the time of the events in question. Vera had an...
-
How would you write 139.29% in decimal form?
-
What is your understanding of cognitive psychology? How does cognition play into one's awareness, recollection, understanding, communication, and even learning? How does one's cognition play a key...
-
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...
-
Assume the same facts as in Brief Exercise 14-16, except that Sharp Company does not intend to trade the bonds or to hold them until maturity. a. Prepare the entry for the purchase of the debt...
-
Tracking Co. holds an AFS bond investment in Fields Corp. The carrying value of the investment is \(\$ 4,500\) at December 31, 2020. Tracking Co. determines the fair value of the investment at the...
-
The following information relates to an AFS security investment held by Gomez Inc. Provide the journal entry to adjust the investment to fair value on December 31, 2020. Fair value. Carrying value...
Study smarter with the SolutionInn App