I am developing my skills to work on R as I am fairly new.
I have a data frame with n columns and n rows. I require to plot line graph (may be using ggplot), with the first column as x axis (it has Year Data) and running loops for rest of the columns. I need n-1 number of graphs for n column.
Let's say the data frame (df) has 5 columns of which the 1st will be used for x axis and loop should run 2 and onward. Values for the 2:5 columns will create line plots. Every new column should form a new graph representing values from respected cities. The below mentioned data frame, Followed by the code that I have been reading a lot about, resembles by data frame.
Year C1 C2 C3 C4
2002 1 8 6 3
2003 5 2 6 5
2004 4 7 8 4
2005 5 1 1 2
I tried some codes similar to following but it did not extract any results.
for (i in 2:5) {
ggplot(df......)
}
Please guide me through the process.




