Trouble with layer(geom="line") in ggplot <p>I would like to plot a line chart in ggplot2. Here is how my data look like</p> <pre><code>query,trace,precision,recall safe.order.q3.txt,rstr_oper_50000_100m,49.8406,24.9156 safe.order.q3.txt,sstr_cpu_50000_100m,49.774,24.8442 safe.order.q3.txt,sstr_oper_50000_100m,49.8735,24.885 safe.sem.q1.txt,ran_50000_100m,74.9204,24.8125 safe.sem.q1.txt,sys_50000_100m,58.1995,11.8975 safe.sem.q1.txt,rstr_cpu_50000_100m,75.6115,25.1855 safe.sem.q1.txt,rstr_oper_50000_100m,75.2262,24.9382 safe.sem.q1.txt,sstr_cpu_50000_100m,74.997,25.0963 safe.sem.q1.txt,sstr_oper_50000_100m,75.4195,25.3233 safe.sem.q2.txt,ran_50000_100m,78.6449,24.6323 safe.sem.q2.txt,sys_50000_100m,10.9353,0.255188 safe.sem.q2.txt,rstr_cpu_50000_100m,79.3762,24.6961 </code></pre> <p>And here is the ggplot code that I store in the file <code>recprec.r</code></p> <pre><code>w &lt;- read.csv(file="../queryResults/comparison.100m.dat", head=TRUE, sep=",") sem1 &lt;- subset(w, query=="safe.sem.q1.txt") p1 &lt;- ggplot(data=sem1, aes(x=trace, y=precision)) + layer(geom="line") + geom_text(aes(y=precision + .4, label=precision)) print(p1) </code></pre> <p>The execution of the code produce the following error and the char depicted in the image below where lines between values are not displayed</p> <pre><code>&gt; source("recprec.r") geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic? </code></pre> <p><img src="https://i.stack.imgur.com/UEvUi.png" alt="enter image description here"></p> <p>What did I missed ?</p>