Question

7. Use the Cars93(MASS). (a) Make variable Passengers factor to tabulate. (b) Make proportion table. (c) Draw bar graph with

Using R, please help solve this problem

0 0
Add a comment Improve this question Transcribed image text
Answer #1

library(MASS)
head(Cars93)

a) table(Cars93$Passengers)
b) prop.table(table(Cars93$Passengers))

c)counts <- table(Cars93$Passengers)
barplot(counts, main="passenger Distribution",
        xlab="Number of passengers")

Actually legend can be added only if there are more than one category in bar plot like subdivided bar plot.

you can use extra legend=() in your barplot command. ex legend("topright", c("London","New York","Singapore","Mumbai")

d) pie(counts,legend("topright", c("2","4","5","6","7","8"))

Add a comment
Know the answer?
Add Answer to:
Using R, please help solve this problem 7. Use the Cars93(MASS). (a) Make variable Passengers factor to tabulate. (b...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • need help please 2) a) Solve the IVP using either variation of parameters or integration factor....

    need help please 2) a) Solve the IVP using either variation of parameters or integration factor. Clearly indicate what the varying parameter is if you use variation of parameters or what the integration factor is if you use that method. Also, indicate the general solution to the homogeneous equation. dy 1 dt sin(t) – y, y(0) = 2 b) Draw the direction field and draw in the graph of the particular solution that you found.

  • Please solve the problem 8 only by using matrices a,b,c&d in problem 7. 7. Use elimination...

    Please solve the problem 8 only by using matrices a,b,c&d in problem 7. 7. Use elimination by pivoting to find the inverse of the following mati ces. T 2 3 2 (b) 2 24 -154 -2 ?24-27 (c)2 3 (d)1 24 5 4 6 L-213 1 1 47 (f) 3 5 2 (e) 2 1 3 5 2 5 8. For each matrix A in Exercise 7, solve Ax b, where b - [10, 10, 10].

  • PLEASE USE R language too 2. Ancient Greek pottery. Archeologists excavating excavating the ancient Greek settlement...

    PLEASE USE R language too 2. Ancient Greek pottery. Archeologists excavating excavating the ancient Greek settlement at Phylakopi classified the pottery found in trenches. The next table describes the collection of 837 pottery pieces uncovered in a particular layer at the excavation site, POT CATEGORY Burnished Monochrome Slipped NUMBER FOUND 133 460 59 Painted in curvilinear decoration 20 Painted in geometric decoration 165 Total 837 Construct a relative frequency table for the data. Display the relative frequencies in a bar...

  • Solve the problem. 7) Each day the commuter train transports x passengers to or from the...

    Solve the problem. 7) Each day the commuter train transports x passengers to or from the city at $1.75/passenger. The daily fixed cost for running the train is $1200. Write an equation that relates the daily profit, P, in dollars to the number of passengers each day. Then use the equation to find the daily profit when the train has 920 passengers in a day. 7) 8) Each month a beauty salon gives x manicures for $12.00/manicure. The cost to...

  • please help me using C++ to solve the problem below Use the bisection algorithm to find...

    please help me using C++ to solve the problem below Use the bisection algorithm to find an approximate solution z to the equation x^​(5.3) + (3.5)^x = N where N is your 7-digit phone number, and: (a) z is correct to 2 significant figures. (b) z is correct to 2 decimal places.

  • I'm having trouble with numbers 5 to 7. I need help working out the equation in...

    I'm having trouble with numbers 5 to 7. I need help working out the equation in question 5 so I can graph it for number 6 and using the slope from the graph to solve number 7. 1. 2 points Measure ands record the em.f E of the given cell. E = 5.65 v 2. Connect an external resistance R=12 and measure the terminal voltage V across the resistor. 2 points 1 ohm = 4.42 3. 1 Repeat step 2...

  • I'm having trouble with numbers 5 to 7. I need help working out the equation in...

    I'm having trouble with numbers 5 to 7. I need help working out the equation in question 5 so I can graph it for number 6 and using the slope from the graph to solve number 7. 1. 2 points Measure ands record the em.f E of the given cell. E = 5.65 v 2. Connect an external resistance R=12 and measure the terminal voltage V across the resistor. 2 points 1 ohm = 4.42 3. 1 Repeat step 2...

  • Please help me solve this using the dynamic equilibrium method! problem. Save it for later. The...

    Please help me solve this using the dynamic equilibrium method! problem. Save it for later. The 70-kg cylinder (C 1.3 kg-m2) shown in Figure 1 has a 1-m-long bar with a mass of 20 kg pinned at the center of the cylinder. Determine the acceleration of the center of the cylinder if the system is released from rest. FIGURE 1 .6-m dia p=.3 20°

  • Please help with this C++ problem using Array Use a one-dimensional array to solve the following...

    Please help with this C++ problem using Array Use a one-dimensional array to solve the following problem. Read in 20 numbers, each of which is between 10 and 100. As each number is read validate it and store it in the array. After reading all the values, display only the unique values that the user entered. Make sure you account for the worst case scenario in which all 20 numbers are different. Use the smallest possible array to solve this...

  • I must use R Program to solve them. Please help! Thank you ünif uniform random variable...

    I must use R Program to solve them. Please help! Thank you ünif uniform random variable 1) Draw the graphs of the p.d.f. of the following distributions (a) The standard normal p.d.f (b) The normal pdf with ? = 50, ? = 10 (c) The uniform p.d.f. over interval [10, 20] (d) The exponential P.d.f with parameter ? 4. 2) Illustrating the central limit theorem. Let X be a random variable having the uniform distribution over the interval [6, 12]...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT