In: Math
What is the formula using RStudio to plot these 3 columns of data?
| Y1 | Y2 | Y3 |
| 43595 | ||
| 43032 | ||
| 47474 | 27829 | |
| 55141 | 35865 | |
| 62946 | 40311 | |
| 66920 | 47186 | |
| 77191 | 56664 | |
| 89661 | 68040 | |
| 101373 | 64008 | |
| 123904 | 79400 | |
| 149453 | 96731 | |
| 168672 | 100517 | |
| 200977 | 89685 | |
| 192985 | 105709 | |
| 205667 | 120532 | |
| 187450 | 127457 | |
| 165613 | 117306 | |
| 200871 | 106498 | |
| 229394 | 79543 | |
| 283229 | 106599 | |
| 25092.23 | 289717 | 126328 |
| 24271.51 | 270585 | 160896 |
| 25828.99 | 279514 | 174346 |
| 27697.5 | 349768 | 176014 |
| 27956.23 | 339689 | 184417 |
| 29924.43 | 331610 | 174960 |
| 30216.83 | 351175 | 174960 |
| 32613.5 | 450569 | 104885 |
| 36053.17 | 421513 | 188069 |
| 38472.75 | 426166 | 236275 |
| 38420.89 | 265729 | 212260 |
y_2=c(43595,43032,47474,55141,62946,
66920,77191,89661,101373,123904, 149453,
168672,200977,192985,205667,187450,
165613,200871,229394,283229,289717,270585, 279514,349768,339689,
331610, 351175,
450569, 421513, 426166,265729)
y_1=c(0,0,0,0,0,0,
0,0,0,0, 0,
0,0,0,0, 0, 0, 0, 0, 0,
25092.23, 24271.51,25828.99, 27697.5, 27956.23, 29924.43, 30216.83,
32613.5, 36053.17, 38472.75, 38420.89)
y_3=c(0,0,27829,
35865,40311,47186,56664,68040,64008,79400,96731,100517,89685,105709,120532,127457,117306,106498,79543,106599,126328,160896,174346,176014,184417,174960,174960,104885,188069,236275,212260
)
i=1:31
plot(i,y_2)
lines(spline(i,y_2),col="red")
y_1
lines(i,y_1,col="blue")
lines(i,y_3,col="green")
red is y_2
blue is y_1
green is y_3
The following code will plot the 3 columns of data in one plot .
You can modify the plot by adding xlab ylab etc in the code