a) Create a scatter plot with sodium on the x-axis and sugars on the y-axis. Change the labels on each so that the units are indicated. Make it so that the both the x-axis has tick marks every 50 mg from 0 to 350, and the y-axis has tick marks every 2.5 g from 0 to 15. Give the scatter plot an adequate title. Report the scatter plot.
b) Create a scatter plot that includes two sets of data. Plot dietary ﬁber on the x-axis and sodium on the y-axis. Use blue circles as the markers and label the y-axis so that it reads only “milligrams”. Use the points() function to overlay a scatter plot of dietary ﬁber on the x-axis and potassium on the y-axis. Use red triangles as the markers. Create a legend to make a distinction between the two diﬀerent sets of data. Report the scatter plot.
c) c Use the layout() function to create a multi-paneled image. Put a horizontal boxplot for calories in the ﬁrst row. Scatter plots for calories vs fat and calories vs sugars in the second row, and vertical boxplots for both fat and sugars in the third road. Report the image.
Load the 2017NBADraft2.txt data set into R.
a) Create a scatter plot with height on the x-axis and wingspan on the y-axis such that the markers are green
plus signs that are twice as large as usual. Report the scatter plot.
b) Create ﬁve subsets of data consisting of only players in each position. Using the points() function, create a scatter plot with height on the x-axis and wingspan on the y-axis for each of the subsets, with diﬀerent markers and diﬀerent colors used for each subset. Create a legend for the plot. Report the scatter plot.
c) Create a multi-paneled image where the histogram for height, the histogram for wingspan, and the height vs. wingspan scatter plot all appear on a single line. Report this image.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.dat <- read.csv("cereal.txt")
with(dat, plot(sodium, sugars, xaxt = "n", yaxt = "n", main = "Sodium and Sugar scatter plot"))
axis(1, at=seq(0, 350, 50), labels=paste(seq(0, 350, 50), "mg"))
axis(2, at=seq(0, 15, 2.5), labels=paste(seq(0, 15, 2.5), "g"))
with(dat, plot(fiber, sodium,
col = "blue",
pch = 19,
ylab = "milligrams",
main = "Fiber with Sodium and Potassium scatter plot"))
with(dat, points(fiber, potass,
col = "red",
pch = 17))
with(dat, legend(11, 240,
pch = c(19, 17)))...
By purchasing this solution you'll be able to access the following files: