1.In a single figure, plotthe functions sin, cos, and sin+cos with different colors and line styles, Use 1000 points inthe interval [-10, 10] and label the figure with a title, subtitle, and axislabels
2.Construct two vectors, xand y , such that the S-PLUS command
>plot( x , y, type=‘ l ’)
createsthe following figures:
a) arectangle or square
b) acircle
c) aspiral
Hint:Do not think of y as being a function of x ( in a mathematicalsense), but think of how the trace of the figure can be created. For drawingcircles you might use the property that, for any x, a point ( sin(x), cos(x)) lies on the unitcircle with origin(0,0) and radius 1.
3.Examinethe data set singer. The variable voice.part is afactor with eight levels, Soprano 1and 2, Alto 1and 2, Tenor 1and 2, and Bass 1and 2. Reduce the levels in voice.part to four levels only by putting Soprano 1andSoprano 2into a Soprano category, Alto 1 and Alto 2 into an Alto category, andso on.
Graph the data in a Trellishistogram. Hint: Check for the levels of thefactor variable by using the levels function. Convert the factor variable thatis internally coded as integer to integer numbers and use cut for regroupingthe data