Question

• What is an R package? How to install a package in R? How to use a function contained in a package? • We have been using the dplyr functions such as arrange(), filter(), select(), mutate(), and summarise(). What is each of them for? • How to use ggplot() function to visualize data?

          • What is an R package? How to install a package in R? How to use a function contained in a package?
• We have been using the dplyr functions such as arrange(), filter(), select(), mutate(), and summarise(). What is each of them for?
• How to use ggplot() function to visualize data?
        
Show more…
• What is an R package? How to install a package in R? How to use a function contained in a package?
• We have been using the dplyr functions such as arrange(), filter(), select(), mutate(), and summarise(). What is each of them for?
• How to use ggplot() function to visualize data?

Added by Kate M.

Close

Elementary Statistics a Step by Step Approach
Elementary Statistics a Step by Step Approach
Allan G. Bluman 9th Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
help explain
Close icon
Play audio
Feedback
Powered by NumerAI
Jennifer Stoner Danielle Fairburn
Kathleen Carty verified

Jon Southam and 100 other subject Intro Stats / AP Statistics educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
what-is-an-r-package-how-to-install-a-package-in-r-how-to-use-a-function-contained-in-a-package-we-have-been-using-the-dplyr-functions-such-as-arrange-filter-select-mutate-and-summarise-what-is-each-o

help me understand this

Sanchit J.

install-the-package-if-you-never-did-install-packages-ggplot2-load-the-pacakge-library-ggplot-2-load-the-mpg-dataset-data-diamonds-problem-1-1-x-5-5-points-use-ggplot2-to-visualize-the-data-34884

# Install the package if you have not installed it before ("ggplot2") # Load the package library (ggplot2) Load the mpg dataset data ("diamonds") Problem 1 (1 x 5 = 5 points) Use ggplot2 to visualize the data. You need to paste the resulting plots and related code in order to get the full points. For each ggplot plot: • make it complete/readable, in other words, it should include axis label(s), title, and legend if necessary; • write 1-2 sentences about what the chart tells you about the data. (a) Choose bin number or binwidth (Hint: See page 11 of lecture_04c.pdf), explain why; and create a histogram of carat. (b) Make a scatter plot of y = price against x = carat and set the color to clarity. (c) Make a scatter plot of y = price against x = carat and add a smooth line to each group of points defined by clarity. (d) Make a scatter plot of y = price against x = carat and facet it by clarity. (e) Show carat VS cut, make a point, jitter, box plot, and a violin plot, respectively. Which one is the best for visualization?

Sri K.

r-programming-using-textbook-the-art-of-r-programming-a-tour-of-statistical-software-design-by-norman-matloff-in-section-53-page-110-of-our-textbook-the-merge-function-only-works-when-all-ki-82398

In Section 5.3 of our textbook, the merge() function only works when all kids appearing in d1 also appear in d2. Use the following vectors to complete this problem of merging frames: d1.Kids <- c("Jack", "Jill", "Jillian", "John", "James") d1.States <- c("CA", "MA", "DE", "HI", "PA") # construct d1 as a dataframe using d1.Kids and d1.States d1 <- data.frame(Kids = d1.Kids, States = d1.States) d2.Ages <- c(10, 7, 12, 30) d2.Kids <- c("Jill", "Jillian", "Jack", "Mary") # construct d2 as a dataframe using d2.Ages and d2.Kids d2 <- data.frame(Ages = d2.Ages, Kids = d2.Kids) You need to construct two dataframes and merge them. For missing data, please use NA as the value for the output. The output must display the content of d1, d2, and the result of merging d1 and d2. Hint: check the usage of set operations union() and match() or %in% operator. You cannot use merge(x,y,all) or any form of merge(). The output should look like the following: kids ages states 1 Jack 12 CA 2 Jill 10 MA 3 Jillian 7 DE 4 John NA HI 5 James NA PA 6 Mary 30 NA If you cannot figure out how to do this, you may use merge() for the highest score of 10/25. Write a program in R to generate a list containing the following information: Your first name, Your last name, Your Age, Your favorite movie (only one). Do the same for three close friends, and then write a program to answer the following questions: (a) What is the mean age of the moviegoers for each movie? (b) How many people are there in each family identified by the same last name? You are not allowed to use any loop or if-statements. Hint: You can hard code the list as my.list. You can create a dataframe using data.frame(name=c("A", "B"), age=c(15,20)). Draw the curve f(α) = (α^2 + 1)^0.5 for t between 0 and 5. You must use the Mathematical Markup Language (MML) to annotate your graphic. You need to add parameters: xlab, ylab, and main correctly. Hint: The function curve() requires to use x in the first argument instead of α.

Sri K.


*

Recommended Textbooks

-
Elementary Statistics a Step by Step Approach

Elementary Statistics a Step by Step Approach

Allan G. Bluman 9th Edition
achievement 1,112 solutions
The Practice of Statistics for AP

The Practice of Statistics for AP

Daren S. Starnes, Daniel S. Yates, David S. Moore 4th Edition
achievement 1,063 solutions
Introductory Statistics

Introductory Statistics

Barbara Illowsky, Susan Dean 1st Edition
achievement 1,602 solutions

*

Transcript

-
00:01 Today we're going to look at some r packages.
00:03 We're going to use the arrange function, the filter function, these select function, the mutate function, and the summarize function.
00:32 And they're all functions within the d -pliar package.
00:39 So we're going to load that up and show you how this works.
00:41 So let's go ahead and tackle this.
00:42 So let's get r studio going.
00:45 And i made some data to play around with today.
00:49 So in order to install the package, you need to do install.
00:53 Packages.
00:54 And then you put quotes around the package.
00:57 I've already done it.
00:58 And to run it, you press this little run button.
01:01 Like i said, i've already done it.
01:02 So i need to do it.
01:03 And then once you install it, you need to actually blow it into your r sessions.
01:09 You have to do library de -plyer, run it.
01:12 Now we're good to go.
01:12 And let's first do a range.
01:16 So what a range does is it reorders the rows of a data frame based on one more variable.
01:22 So it's like a sorting function.
01:26 So for example, here's some data that i made, name, age, and then numbed cats.
01:32 So let's run that.
01:34 And if you look at the data frame, there it is, alice, bob, charlie, david, their ages, and the number of cats.
01:39 So we can do sort it, df, and then this little print percent greater than percent that is a pipe operator.
01:50 It takes the df and then it's the object that a range is using the data from.
01:58 What you're going to do is take pump an age into it, so you're going to sort it by age.
02:03 You run this.
02:05 And you can do, if you don't put descending, d .e.
02:10 S -c and then the variable it's going to go ascending.
02:15 Let's run that and here we see in both.
02:18 So here's the sorted age from least to greatest.
02:22 Here's sorted descending, grace to least.
02:27 All right, so is that.
02:28 Now filter, what we're going to do is it selects a subset of rows based on specified conditions.
02:42 So what you're going to do, we're going to sort, or excuse me, filter the data from d .s.
02:46 For people who are older than 25.
02:50 So df, pipe operator, filter when age is greater than 25.
02:55 So we run that.
02:56 Let's take a look at the data.
02:58 There it is.
02:58 So it's only bob and david.
02:59 Their ages are greater than 25.
03:01 But if you want to make it equal to you, just put greater than equal to 25.
03:04 And you can see we've captured alice as well because she is 25.
03:08 All right, so filter.
03:11 Now we're going to do select.
03:12 And select is used to choose specific columns from the data frame.
03:20 So for our data frame, which has name, age, and numcats, we're just going to do name and numcats...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Join the community

18,000,000+

Students on Numerade


Trusted by students at 8,000+ universities

Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever