Question
Exercise 1.6: The goal of this exercise is to see how you would discover what symbols are available for plotting and how to generate these
Exercise 1.6: The goal of this exercise is to see how you would discover what symbols are available for plotting and how to generate these different symbols on a plot. To do this, you will create a scatter plot of all the available symbols. So that you can identify the integer index associated with a particular plotting symbol, x-values used in the plot should use the valid integer values available for the pch argument. For convenience, initially you can use these same values for the y-values. Use the help system on the points() method. Read this help documentation to find out what the valid integer values are for the pch argument. Create a variable named "symbols" that contains a vector of these valid integer values for the pch argument. Then use the plot() method to create a scatterplot of the different symbols where the corresponding x-value is the integer code for symbol plotted. Note that the font argument to plot() will have to be used to access all of the available plotting symbols - more information on this is in the documentation on points(). This initial plot causes the plotted symbols to overlap a lot because there are so many of them lying in a straight line and thus they are not very distinguishable. Find a way to randomize the y-values on this plot so that the symbols are not so cluttered and can generally be seen better. Note that it may be helpful to use the length() method which will give the length of a vector - in particular, the length of your "symbols" vector may be useful information. This plot is still too cluttered to exactly identify the index on the x-axis for a particular symbol you might see and decide that you want to use. From this plot, identify a narrow range of indices that the "heart" symbol lies within. Then create a new plot of symbols that covers only this more narrow range and from it, identify the exact pch integer code for the heart symbol.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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