Now the lines can be smoothend by using ggalt pacakage function geom_xspline (spline_shape= -0.2 to -0.4)
ggplot(dat, aes(x, y, group=group, color=factor(group))) +geom_point(color="steelblue") +geom_xspline(size=0.5, spline_shape=-0.3)
Warning: Using the `size` aesthetic in this geom was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` in the `default_aes` field and elsewhere instead.
The echo: false option disables the printing of code (only output is displayed).