移除 ggplot 中的垂直线。

huangapple go评论142阅读模式
英文:

Remove vertical lines in ggplot

问题

I am using some longitudinal data to make a line plot with ggplot2. The goal is to plot the data for each individual (Name) across time (Age). However, I don't know why there are vertical lines shown in the plot:

ggplot(sum_data, aes(x=Age, y=Turns, group=Name)) +
  geom_line()

How do I remove those vertical lines? Thanks for any help!

Here is the data:

dput(sum_data)
structure(list(Age = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,

<details>
<summary>英文:</summary>

I am using some longitudinal data to make a line plot with `ggplot2`. The goal is to plot the data for each individual (`Name`) across time (`Age`). However, I don&#39;t know why there are vertical lines shown in the plot:

    ggplot(sum_data, aes(x=Age,y=Turns,group=Name))+
      geom_line()

[!
[1]][1]
How do I remove those vertical lines? Thanks for any help! Here is the data: dput(sum_data) structure(list(Age = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7), Speaker = c(&quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;CHI&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;, &quot;MOT&quot;), Name = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 80L, 81L, 82L, 83L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 80L, 81L, 82L, 83L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 34L, 35L, 36L, 38L, 39L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 55L, 56L, 57L, 59L, 60L, 61L, 62L, 64L, 66L, 67L, 68L, 69L, 70L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 81L, 82L, 83L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 34L, 35L, 36L, 38L, 39L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 55L, 56L, 57L, 59L, 60L, 61L, 62L, 64L, 66L, 67L, 68L, 69L, 70L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 81L, 82L, 83L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 28L, 30L, 33L, 34L, 36L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 55L, 56L, 57L, 58L, 60L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 70L, 71L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 81L, 82L, 83L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 28L, 30L, 33L, 34L, 36L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 55L, 56L, 57L, 58L, 60L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 70L, 71L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 81L, 82L, 83L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 10L, 11L, 12L, 13L, 14L, 16L, 17L, 19L, 20L, 21L, 22L, 25L, 26L, 27L, 28L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 55L, 56L, 57L, 58L, 60L, 61L, 63L, 65L, 66L, 67L, 68L, 70L, 71L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 81L, 82L, 83L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 10L, 11L, 12L, 13L, 14L, 16L, 17L, 19L, 20L, 21L, 22L, 25L, 26L, 27L, 28L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 55L, 56L, 57L, 58L, 60L, 61L, 63L, 65L, 66L, 67L, 68L, 70L, 71L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 81L, 82L, 83L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 10L, 11L, 12L, 13L, 14L, 16L, 17L, 19L, 20L, 21L, 22L, 25L, 27L, 28L, 30L, 32L, 35L, 36L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 47L, 48L, 49L, 50L, 51L, 52L, 58L, 60L, 61L, 62L, 63L, 65L, 66L, 67L, 68L, 73L, 74L, 77L, 78L, 79L, 81L, 82L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 10L, 11L, 12L, 13L, 14L, 16L, 17L, 19L, 20L, 21L, 22L, 25L, 27L, 28L, 30L, 32L, 35L, 36L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 47L, 48L, 49L, 50L, 51L, 52L, 58L, 60L, 61L, 62L, 63L, 65L, 66L, 67L, 68L, 73L, 74L, 77L, 78L, 79L, 81L, 82L), .Label = c(&quot;ace&quot;, &quot;adm&quot;, &quot;aim&quot;, &quot;ali&quot;, &quot;all&quot;, &quot;ana&quot;, &quot;ann&quot;, &quot;apr&quot;, &quot;arl&quot;, &quot;ast&quot;, &quot;bob&quot;, &quot;bra&quot;, &quot;bri&quot;, &quot;brn&quot;, &quot;brt&quot;, &quot;cas&quot;, &quot;cat&quot;, &quot;cha&quot;, &quot;cla&quot;, &quot;con&quot;, &quot;ctr&quot;, &quot;dav&quot;, &quot;dea&quot;, &quot;dev&quot;, &quot;dia&quot;, &quot;don&quot;, &quot;emi&quot;, &quot;eth&quot;, &quot;fra&quot;, &quot;geo&quot;, &quot;gil&quot;, &quot;gre&quot;, &quot;guy&quot;, &quot;ina&quot;, &quot;jac&quot;, &quot;jam&quot;, &quot;jas&quot;, &quot;jea&quot;, &quot;jeb&quot;, &quot;jen&quot;, &quot;jer&quot;, &quot;jes&quot;, &quot;joe&quot;, &quot;joy&quot;, &quot;jus&quot;, &quot;kar&quot;, &quot;kev&quot;, &quot;kur&quot;, &quot;mar&quot;, &quot;may&quot;, &quot;meg&quot;, &quot;mel&quot;, &quot;mia&quot;, &quot;mit&quot;, &quot;mon&quot;, &quot;mor&quot;, &quot;mrk&quot;, &quot;ned&quot;, &quot;nic&quot;, &quot;pau&quot;, &quot;pet&quot;, &quot;ras&quot;, &quot;rau&quot;, &quot;rem&quot;, &quot;ril&quot;, &quot;roc&quot;, &quot;ros&quot;, &quot;sar&quot;, &quot;sea&quot;, &quot;shl&quot;, &quot;sho&quot;, &quot;sop&quot;, &quot;stn&quot;, &quot;sus&quot;, &quot;tam&quot;, &quot;ter&quot;, &quot;tod&quot;, &quot;tom&quot;, &quot;tri&quot;, &quot;tru&quot;, &quot;vic&quot;, &quot;zan&quot;, &quot;zen&quot;), class = &quot;factor&quot;), Turns = c(63L, 349L, 806L, 427L, 440L, 559L, 341L, 76L, 190L, 719L, 260L, 492L, 228L, 110L, 229L, 234L, 209L, 549L, 89L, 252L, 172L, 506L, 202L, 372L, 614L, 230L, 328L, 431L, 164L, 691L, 202L, 293L, 434L, 385L, 119L, 215L, 85L, 312L, 263L, 526L, 298L, 404L, 165L, 281L, 444L, 437L, 206L, 428L, 75L, 647L, 770L, 295L, 255L, 262L, 190L, 224L, 356L, 293L, 453L, 313L, 317L, 275L, 426L, 382L, 363L, 572L, 349L, 436L, 236L, 219L, 260L, 41L, 333L, 87L, 392L, 442L, 313L, 806L, 497L, 528L, 393L, 393L, 650L, 213L, 313L, 625L, 554L, 333L, 1156L, 544L, 521L, 252L, 571L, 323L, 554L, 504L, 233L, 407L, 365L, 403L, 627L, 286L, 512L, 336L, 833L, 566L, 431L, 645L, 302L, 837L, 494L, 362L, 810L, 343L, 470L, 522L, 490L, 253L, 227L, 250L, 462L, 386L, 593L, 525L, 681L, 255L, 371L, 568L, 793L, 516L, 734L, 368L, 816L, 1106L, 438L, 364L, 475L, 282L, 469L, 481L, 487L, 856L, 453L, 517L, 372L, 516L, 603L, 533L, 918L, 121L, 460L, 234L, 420L, 617L, 90L, 807L, 321L, 1111L, 733L, 781L, 863L, 695L, 828L, 658L, 391L, 852L, 256L, 534L, 188L, 147L, 241L, 290L, 366L, 102L, 222L, 226L, 318L, 248L, 353L, 315L, 375L, 379L, 258L, 187L, 204L, 178L, 341L, 695L, 205L, 293L, 414L, 141L, 282L, 112L, 134L, 579L, 283L, 461L, 326L, 543L, 248L, 355L, 227L, 234L, 276L, 536L, 285L, 391L, 106L, 788L, 658L, 431L, 187L, 200L, 126L, 560L, 153L, 622L, 343L, 421L, 291L, 565L, 248L, 282L, 152L, 382L, 185L, 140L, 229L, 222L, 753L, 489L, 550L, 58L, 367L, 381L, 628L, 302L, 303L, 228L, 783L, 666L, 492L, 124L, 298L, 466L, 483L, 564L, 390L, 453L, 662L, 140L, 530L, 341L, 240L, 472L, 815L, 256L, 520L, 640L, 297L, 462L, 278L, 340L, 873L, 479L, 364L, 429L, 647L, 380L, 558L, 455L, 391L, 299L, 1134L, 541L, 465L, 312L, 807L, 669L, 600L, 331L, 419L, 328L, 1014L, 218L, 877L, 494L, 726L, 646L, 425L, 336L, 622L, 428L, 1048L, 512L, 403L, 510L, 487L, 709L, 540L, 484L, 304L, 813L, 580L, 211L, 436L, 386L, 229L, 637L, 163L, 317L, 463L, 446L, 347L, 534L, 325L, 329L, 473L, 95L, 206L, 187L, 436L, 464L, 582L, 435L, 44L, 441L, 665L, 606L, 422L, 695L, 470L, 473L, 543L, 453L, 505L, 348L, 505L, 212L, 445L, 230L, 365L, 324L, 752L, 537L, 438L, 380L, 91L, 252L, 261L, 260L, 483L, 434L, 348L, 531L, 266L, 856L, 372L, 89L, 239L, 345L, 328L, 80L, 553L, 395L, 754L, 540L, 570L, 322L, 288L, 735L, 186L, 415L, 238L, 367L, 894L, 390L, 157L, 707L, 490L, 442L, 481L, 407L, 217L, 598L, 263L, 301L, 144L, 526L, 953L, 954L, 451L, 43L, 510L, 1256L, 393L, 424L, 534L, 653L, 618L, 397L, 547L, 829L, 301L, 583L, 103L, 540L, 324L, 396L, 513L, 453L, 524L, 727L, 362L, 484L, 210L, 268L, 270L, 463L, 479L, 336L, 635L, 286L, 672L, 566L, 156L, 250L, 627L, 622L, 244L, 610L, 427L, 892L, 703L, 404L, 415L, 341L, 99L, 240L, 48L, 131L, 269L, 316L, 313L, 42L, 113L, 43L, 300L, 107L, 275L, 155L, 90L, 123L, 278L, 181L, 465L, 289L, 160L, 133L, 719L, 478L, 351L, 126L, 230L, 300L, 178L, 365L, 234L, 217L, 297L, 424L, 185L, 187L, 273L, 73L, 248L, 60L, 293L, 45L, 561L, 392L, 300L, 128L, 97L, 373L, 65L, 307L, 376L, 136L, 167L, 108L, 368L, 358L, 261L, 335L, 43L, 128L, 248L, 145L, 293L, 272L, 324L, 209L, 208L, 330L, 101L, 286L, 53L, 97L, 247L, 478L, 301L, 239L, 61L, 12L, 277L, 102L, 251L, 62L, 54L, 150L, 318L, 244L, 534L, 410L, 162L, 134L, 1042L, 499L, 505L, 92L, 324L, 396L, 267L, 378L, 319L, 234L, 453L, 398L, 305L, 207L, 214L, 33L, 288L, 66L, 347L, 51L, 503L, 617L, 304L, 156L, 158L, 466L, 74L, 399L, 451L, 235L, 172L, 104L, 136L, 466L, 485L, 357L, 40L, 196L, 336L, 190L, 381L, 268L, 224L, 215L, 150L, 534L, 183L, 539L, 60L, 221L, 404L, 80L, 250L, 113L, 277L, 451L, 598L, 257L, 245L, 58L, 199L, 19L, 363L, 195L, 644L, 185L, 685L, 593L, 337L, 181L, 316L, 416L, 165L, 837L, 288L, 457L, 562L, 264L, 331L, 143L, 208L, 166L, 180L, 591L, 284L, 259L, 207L, 377L, 432L, 362L, 227L, 341L, 69L, 319L, 293L, 203L, 150L, 361L, 853L, 300L, 643L, 362L, 73L, 596L, 121L, 97L, 218L, 279L, 217L, 268L, 54L, 453L, 480L, 283L, 329L, 93L, 288L, 92L, 400L, 155L, 709L, 217L, 720L, 493L, 818L, 316L, 212L, 140L, 353L, 849L, 326L, 447L, 636L, 221L, 191L, 29L, 381L, 205L, 376L, 314L, 231L, 443L, 181L, 145L, 307L, 304L, 353L, 328L, 185L, 105L, 218L, 560L, 430L, 324L, 779L, 319L, 377L, 159L)), class = c(&quot;grouped_df&quot;, &quot;tbl_df&quot;, &quot;tbl&quot;, &quot;data.frame&quot;), row.names = c(NA, -686L), groups = structure(list( Age = c(1, 1, 2, 2, 3, 3, 5, 5, 7, 7), Speaker = c(&quot;CHI&quot;, &quot;MOT&quot;, &quot;CHI&quot;, &quot;MOT&quot;, &quot;CHI&quot;, &quot;MOT&quot;, &quot;CHI&quot;, &quot;MOT&quot;, &quot;CHI&quot;, &quot;MOT&quot; ), .rows = structure(list(1:83, 84:166, 167:235, 236:304, 305:371, 372:438, 439:506, 507:574, 575:630, 631:686), ptype = integer(0), class = c(&quot;vctrs_list_of&quot;, &quot;vctrs_vctr&quot;, &quot;list&quot;))), class = c(&quot;tbl_df&quot;, &quot;tbl&quot;, &quot;data.frame&quot; ), row.names = c(NA, -10L), .drop = TRUE)) [1]: https://i.stack.imgur.com/i6t1A.png [1]: https://i.stack.imgur.com/nbxAd.png </details> # 答案1 **得分**: 2 由于您的数据包含多个 `Speaker`,您最终会得到多个关于 `name` 的观察结果。因此,要去掉垂直线,您需要考虑 `Speaker`,例如通过根据 `Speaker` 和 `name` 的交互分组来实现: ```R library(ggplot2) ggplot(sum_data, aes( x = Age, y = Turns, group = paste(Name, Speaker, sep = "."), color = Speaker )) + geom_line()

[![输入图像描述][1]][1]


[1]: https://i.stack.imgur.com/lwbxx.png
<details>
<summary>英文:</summary>
As your data contains multiple `Speaker`s you end up with multiple obs. per `name`. Hence, to get rid of the vertical lines you have to take the `Speaker`s into account by e.g. grouping by the interaction of `Speaker` and `name`:

library(ggplot2)

ggplot(sum_data, aes(
x = Age, y = Turns,
group = paste(Name, Speaker, sep = "."), color = Speaker
)) +
geom_line()


[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/lwbxx.png
</details>

huangapple
  • 本文由 发表于 2023年3月7日 02:28:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/75654527.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定