Add the line of code to library the tidyverse package as the first line in the script Run this code by having your cursor on
Add the line of code to library the tidyverse package as the first line in the script
Run this code by having your cursor on this line of code and pressing ctrl+enter (PC) or command+return (MAC)
To re-create the sample dataset, copy and paste the code block into your script from the webpage that I duplicated here:
set.seed(55)
scatter_data <- tibble(x_var = runif(100, min = 0, max = 25), y_var = log2(x_var) + rnorm(100))
Add code to re-create the simple scatterplot using x_var and y_var from scatter_data
Run this line of code to generate the scatterplot in the Plots frame of RStudio
Click Export and choose Copy to Clipboard to copy the figure that you created
Paste the image of this basic scatterplot to a Word document
Re-create the scatterplot from 4. and change the color of the points to red
Run this code to generate the new scatterplot, copy it to the clipboard, and paste it to the Word document
Re-create the scatterplot from 7. and change the size of the points to 4
Run this code to generate the new scatterplot, copy it to the clipboard, and paste it to the Word document
Re-create the scatterplot from 9. and add a linear trend line to the data
Run this code to generate the new scatterplot, copy it to the clipboard, and paste it to the Word document
Read this overview on how to create axis labels and a figure title: A quick introduction to ggplot titles - Sharp Sight (sharpsightlabs.com)
Re-create the scatterplot from 11. and add the following elements:
A label to the Y-axis, Number of puppies kicked
A label to the X-axis, Number of beers drank
A title, The relationship between drinking beer and kicking puppies
Run this code to generate the new scatterplot, copy it to the clipboard, and paste it to the Word document
Re-create the basic figure from Question 12 of Part 1 using the code I have duplicated below:
ggplot(data = mpg, aes(x = displ, y = hwy)) +
geom_point()
In geom_point, change the following attributes about the data points (TIP: Dont forget to add commas in between each attribute!):
Change the color of the points to be blue
Change the size of the points to be 3
Change the opacity of the points by adding alpha = .5
Add meaningful x- and y-axis labels and a title to the figure
Add a linear trendline to the data
In geom_smooth, after method = lm, add the following attributes (TIP: Dont forget to add commas in between each attribute!):
Remove the error bar by adding se = False
Change the size of the line by adding size = 2
Change the color of the line by adding col="firebrick"
Run the code to generate this scatterplot, copy it to the clipboard, and paste it to the Word document
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started