Enter and execute the three command lines below to install and activate the Tidyverse package (a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Enter and execute the three command lines below to install and activate the Tidyverse package (a collection of packages designed to help with data analysis), and to load the msleep dataset. Some patience is required here; it takes a while to install these packages the first time. install packages('tidyverse') library(tidyverse) data(msleep) RStudio provides a variety of methods that can be used to learn more about a data set. For example, you can enter msleep into the Help window search tab or you can type ?msleep in the console; either method will open a file in the Help window pane. (Some features might use the same name in different packages, so you might have to search a bit for the feature you want.) Another approach is to click on the data set in the Environment pane (upper-right), and the data will appear in the upper-left window. You can also enter str(msleep) or summary(msleep) in the Console to see summary information about the data set in the Console. An alternative approach that uses the pipe operator yields more efficient code that is easier to follow. The approach shown below takes the msleep data and processes it through a series of pipe operators, and avoids creating unnecessary objects: The results are: msleep %>% filter(sleep_total > 5)%>% group_by(vore) %>% summarize(Avg_bodywt = mean(bodywt))%>% arrange(desc(Avg_bodywt)) vore carni insecti omni herbi Avg_bodywt 49.3 12.9 12.7 2.32 0.858 Adapt the code from above that uses the pipe operator to create a table showing the average sleep time among the orders and focus on body weight less than 10 kg. Another important statistic is the variance, which measures the variability of the data. Similar to the command used above for the mean, the command to find the variance of a data set x is var(x). Adapt the code used in the previous question so you can create a table showing the variance in sleep times for orders with body weights less than 10 kg. The NA result occurs for several orders because the samples include NA values; the command var() returns NA in that case. 19. How many orders have a variance in sleep time greater than 1.0 hour? Enter and execute the three command lines below to install and activate the Tidyverse package (a collection of packages designed to help with data analysis), and to load the msleep dataset. Some patience is required here; it takes a while to install these packages the first time. install packages('tidyverse') library(tidyverse) data(msleep) RStudio provides a variety of methods that can be used to learn more about a data set. For example, you can enter msleep into the Help window search tab or you can type ?msleep in the console; either method will open a file in the Help window pane. (Some features might use the same name in different packages, so you might have to search a bit for the feature you want.) Another approach is to click on the data set in the Environment pane (upper-right), and the data will appear in the upper-left window. You can also enter str(msleep) or summary(msleep) in the Console to see summary information about the data set in the Console. An alternative approach that uses the pipe operator yields more efficient code that is easier to follow. The approach shown below takes the msleep data and processes it through a series of pipe operators, and avoids creating unnecessary objects: The results are: msleep %>% filter(sleep_total > 5)%>% group_by(vore) %>% summarize(Avg_bodywt = mean(bodywt))%>% arrange(desc(Avg_bodywt)) vore carni insecti omni herbi Avg_bodywt 49.3 12.9 12.7 2.32 0.858 Adapt the code from above that uses the pipe operator to create a table showing the average sleep time among the orders and focus on body weight less than 10 kg. Another important statistic is the variance, which measures the variability of the data. Similar to the command used above for the mean, the command to find the variance of a data set x is var(x). Adapt the code used in the previous question so you can create a table showing the variance in sleep times for orders with body weights less than 10 kg. The NA result occurs for several orders because the samples include NA values; the command var() returns NA in that case. 19. How many orders have a variance in sleep time greater than 1.0 hour?
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 algorithms questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
11. Identify the location of oxidation in an electrochemical cell. A) the salt bridge B) the socket C) the cathode D) the electrode E) the anode 12. Determine the cell notation for the redox reaction...
-
Is there a distinction between thermal energy and internal energy? Which term do physicists prefer?
-
As a new supervisor, youre about to hold your first-ever appraisal interview with one of your subordinates, someone who has not been performing very well for the past 6 months. What should you keep...
-
An object of irregular shape has a characteristic length of \(L=0.5 \mathrm{~m}\) and is maintained at a uniform surface temperature of \(T_{s}=400 \mathrm{~K}\). When placed in atmospheric air at a...
-
On January 1, 2004, Pre Corporation acquired 60 percent of the voting common shares of Sue Corporation at an excess of fair value over book value of $1,000,000. This excess was attributed to plant...
-
A car is designed to get its energy from a rotating flywheel in the shape of a uniform, solid disk of radius 0.550 m and mass 560 kg. Before a trip, the flywheel is attached to an electric motor,...
-
Consider the 2013 declined loan data from LendingClub titled RejectStatsB2013 from the Connect website. Similar to the analysis done in the chapter, lets scrub the risk score data. First, because our...
-
1. What is an Embedded System? What makes it different from a general-purpose computer? 2. List five attributes of embedded systems. 3. What was the first electronic computing device designed with...
-
On January 1, 2017, Teal Industries had stock outstanding as follows. 6% Cumulative preferred stock, $100 par value, issued and outstanding 9,700 shares $970,000 Common stock, $10 par value, issued...
-
Scott received $50,000 in wages in the current year. He also had a $30,000 loss from a rental real estate activity in which he materially participated. Scott worked in the real estate activity for a...
-
Maya Company currently buys a component part for $5 per unit. Maya estimates that making the part would require $2.30 per unit of direct materials and $1.10 per unit of direct labor. Maya normally...
-
How do demographic shifts and changing consumer preferences intersect to shape market trends in advanced markets ?
-
ewis Corporation issued $510,000 of 4%, 10-year bonds payable at a price of 90. The market interest rate at the date of issuance was 5%, and the bonds pay interest semiannually. The journal entry to...
-
You are the financial advisor for Max Zorin and are tasked with deciding on how to allocate Mr. Zorins fortune. Mr. Zorin lives in the island nation of San Monique, and thus is required by law to...
-
A report from the college dean indicates that for the previous semester, the grade distribution for the Department of Psychology included 135 As, 158 Bs, 140 Cs, 94 Ds, and 53 Fs. Determine what kind...
-
Jason and Mary are married taxpayers in 2012. They are both under age 65 and in good health. For this tax year, they have a total of $41,000 in wages and $500 in interest income. Jason and Mary's...
-
Calculate the amount of the child and dependent care credit allowed for 2012 in each of the following cases, assuming the taxpayers had no income other than the stated amounts. a. William and Carla...
-
Sophie is a single taxpayer. For the first payroll period in October 2012, she is paid wages of $3,250 monthly. Sophie claims three allowances on her Form W-4. a. Use the percentage method to...
-
Using a financial calculator, solve for the unknowns in each of the following situations. a. On June 1, 2024, Holly Golightly purchases lakefront property from her neighbor, George Peppard, and...
-
Sally W. Emanual, a teacher, had the following dividends and interest during 2022: Additional information pertaining to Sally Emanual includes The taxable portion of the pension is \($7,000.\) Sally...
-
Ed owns Oak Knoll Apartments. During the year, Fred, a tenant, moved to another state. Fred paid Ed \($1,000\) to cancel the two-year lease he had signed. Ed subsequently began renting the unit to...
Study smarter with the SolutionInn App