In R there is a built-in data frame named 'mtcars'. Use different R functions to explore...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In R there is a built-in data frame named 'mtcars'. Use different R functions to explore data frame 'mtcars'. Note that because this is practice, there is some repetition with different functions providing similar or even the same information. Complete code below to do the following: 1) Show the first 6 rows of data frame called 'mtcars'. Name the output A (Hint: function to use head()). 2) Show the last 6 rows of data frame called 'mtcars'. Name the output B (Hint: function to use tail()). 3) Return the dimensions of data frame called 'mtcars' (i.e. number of rows and number of columns). Name the output C (Hint: function to use dim()). 4) Return the number of rows in data frame called 'mtcars'. Name the output D (Hint: function to use nrow()). 5) Return the number of columns in data frame called 'mtcars'. Name the output E (Hint: function to use ncol()). 6) Return the column names of data frame called 'mtcars'. Name the output F (Hint: function to use names ()). 7) Return the column names of data frame called 'mtcars' (same as above). Name the output G (Hint: function to use colnames()). 8) Return the class of each column of data frame called 'mtcars'. Name the output H (Hint: function to use sapply()). 9) Return the class of data frame called 'mtcars'. Name the output I (Hint: function to use class()). 10) Calculate the mean of column 'mpg' in data frame called 'mtcars'. Name the output xbarmpg (Hint: function to use mean()). 11) Calculate the standard deviation of column 'mpg' in data frame called 'mtcars'. Name the output sdm.pg (Hint: function to use sd()). In R there is a built-in data frame named 'mtcars'. Use different R functions to explore data frame 'mtcars'. Note that because this is practice, there is some repetition with different functions providing similar or even the same information. Complete code below to do the following: 1) Show the first 6 rows of data frame called 'mtcars'. Name the output A (Hint: function to use head()). 2) Show the last 6 rows of data frame called 'mtcars'. Name the output B (Hint: function to use tail()). 3) Return the dimensions of data frame called 'mtcars' (i.e. number of rows and number of columns). Name the output C (Hint: function to use dim()). 4) Return the number of rows in data frame called 'mtcars'. Name the output D (Hint: function to use nrow()). 5) Return the number of columns in data frame called 'mtcars'. Name the output E (Hint: function to use ncol()). 6) Return the column names of data frame called 'mtcars'. Name the output F (Hint: function to use names ()). 7) Return the column names of data frame called 'mtcars' (same as above). Name the output G (Hint: function to use colnames()). 8) Return the class of each column of data frame called 'mtcars'. Name the output H (Hint: function to use sapply()). 9) Return the class of data frame called 'mtcars'. Name the output I (Hint: function to use class()). 10) Calculate the mean of column 'mpg' in data frame called 'mtcars'. Name the output xbarmpg (Hint: function to use mean()). 11) Calculate the standard deviation of column 'mpg' in data frame called 'mtcars'. Name the output sdm.pg (Hint: function to use sd()).
Expert Answer:
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these finance questions
-
The following questions are based on a Human Resources Capability Model developed by the Australian Public Service (APS) for HR managers who work in government agencies. People who work with HR...
-
The following graph shows the population growth rates of the 204 countries recognized by the United Nations. Growth rate is measured as the average annual percent change in the total human population...
-
Design a suitable angle section to carry a factored tensile force 210 kN assuming a single row of M20 bolts. The yield strength and ultimate strength of the material is 250 MPa and 410 MPa,...
-
In each of the cases below, assume Division X has a product that can be sold either to outside customers or to Division Y of the same company for use in its production process. The managers of the...
-
Find the change of variable x = Py that transforms the quadratic form x T Ax into y T Dy as shown. 5x + 5x + 3x3 + 10x1x2 + 4x1x3+4x2x3 = 11y+2y
-
Refer to the information in Exercise 16-6. Assume that Fields uses the FIFO method of process costing. 1. Calculate the equivalent units of production for the forming department. 2. Calculate the...
-
River Companys chart of accounts includes the following selected accounts. 101 Cash 401 Sales Revenue 112 Accounts Receivable 414 Sales Discounts 120 Inventory 505 Cost of Goods Sold 301 Owners...
-
MATH 114 MATH 114 ENERGY YEARLY PROJECTIONS USING ELECTRICITY, COAL, AND OIL PROJECT ASSIGNMENT INSTRUCTIONS OVERVIEW Ever wonder how your electricity bill is computed? The following tables gives the...
-
Solve the two questions below. You may right of the question by hand and submit a picture, or submit the answers on MS WORD. Do not just put a final answer, you must show your work to get a good...
-
6. A firm has beginning retained earnings of $4200 and ending retained earnings of $4650.What is the amount of dividends paid of the firm earned a net income of $1950?
-
explain the interplay between respiratory metabolism and cellular signaling pathways, such as AMP-activated protein kinase (AMPK) and mammalian target of rapamycin (mTOR), in regulating energy...
-
Tall Trees, Inc. is using the modified internal rate of return (MIRR) when evaluating projects. The company is able to reinvest cash flows received from the project at an annual rate of 10.34...
-
how to write code in java Create a program called Account Value. This will display the growth in value of an amount with a fixed interest rate over a number of months. The program needs the monthly...
-
What are the mechanisms underlying organelle biogenesis and dynamics, including membrane fusion, fission, and organelle inheritance, and how are these processes regulated to maintain organelle...
-
Find the indicated z-scores shown in the graph. Click to view page 1 of the table, Click to view page 2 of the table. 0.0233 0.0233 za? ze? The z-scores are (Use a comma to separate answers as...
-
Could a set of three vectors in span all of? Explain. What about n vectors in when n is less than m? R4
-
In the text, we demonstrated the equilibrium that emerges when two oligopolists compete on price when there are no fixed costs and marginal costs are constant. In this exercise, continue to assume...
-
For a long period, the U.S. government focused its attempts to meet housing needs among the poor through public housing programs. Eligible families could get on waiting lists to apply for an...
-
There are many equity or fairness based arguments for government engagement in anti-poverty programs and for general government redistribution programs. But is there an efficiency case to be made...
-
Consider the logistic map discussed in the text. To gauge the density of bifurcations, one uses a measure of distance between fixed points as follows. Define \(d=x^{*}-(1 / 2)\) as the distance...
-
Consider the equation of motion \[\frac{d^{2} u}{d \varphi^{2}}+u-\frac{1}{p}=3 \lambda u^{2}\] where \(p\) and \(\lambda\) are constants. Find the solution using perturbation theory to first order...
-
Using numerical methods, solve the differential equation \[\frac{d q}{d t}=-\alpha q+\beta\] Compare your results with the exact solution as a function of the discrete time-step you use, and the...
Study smarter with the SolutionInn App