I want to plot segmented data in R. That is, say I have data of the form
| Product               | Date   | Origination | Rate | Num | Balance   |
|-----------------------|--------|-------------|------|-----|-----------|
| DEMAND DEPOSITS       | 200505 | 198209      | 0    | 1   | 2586.25   |
| DEMAND DEPOSITS       | 200505 | 198304      | 0    | 1   | 3557.73   |
| DEMAND DEPOSITS       | 200505 | 198308      | 0    | 1   | 14923.72  |
| DEMAND DEPOSITS       | 200505 | 198401      | 0    | 1   | 4431.67   |
| DEMAND DEPOSITS       | 200505 | 198410      | 0    | 1   | 44555.23  |
| MONEY MARKET ACCOUNTS | 200505 | 198209      | 0.25 | 2   | 65710.01  |
| MONEY MARKET ACCOUNTS | 200505 | 198211      | 0.25 | 2   | 41218.41  |
| MONEY MARKET ACCOUNTS | 200505 | 198304      | 0.25 | 1   | 61421.2   |
| MONEY MARKET ACCOUNTS | 200505 | 198402      | 0.25 | 1   | 13620.17  |
| MONEY MARKET ACCOUNTS | 200505 | 198408      | 0.75 | 1   | 281897.74 |
| MONEY MARKET ACCOUNTS | 200505 | 198410      | 0.25 | 1   | 5131.33   |
| NOW ACCOUNTS          | 200505 | 198209      | 0    | 1   | 142744.35 |
| NOW ACCOUNTS          | 200505 | 198303      | 0    | 1   | 12191.6   |
| SAVING ACCOUNTS       | 200505 | 198301      | 0.25 | 1   | 96936.24  |
| SAVING ACCOUNTS       | 200505 | 198302      | 0.25 | 2   | 21764     |
| SAVING ACCOUNTS       | 200505 | 198304      | 0.25 | 1   | 14646.55  |
| SAVING ACCOUNTS       | 200505 | 198305      | 0.25 | 1   | 20909.7   |
| SAVING ACCOUNTS       | 200505 | 198306      | 0.25 | 1   | 66434.56  |
| SAVING ACCOUNTS       | 200505 | 198309      | 0.25 | 1   | 20005.56  |
| SAVING ACCOUNTS       | 200505 | 198404      | 0.25 | 2   | 16766.56  |
| SAVING ACCOUNTS       | 200505 | 198407      | 0.25 | 1   | 47721.97  |
I want to plot on the Y-axis a line per 'Product' type by 'Balance'. On the X-axis, I want to put the 'Origination'. I would ideally also like to set colors to distinguish between the lines. The data is not currently in data.frame form so let me know if I need to change back to that.
I haven't been able to find an informative solution online for this, even though I'm sure there is.
Thanks,
 
     
     
    
 
    
