Hadley Wickham @hadley.nz · 17/12/2024Base R plotting question: what's the equivalent to of ggplot(df, aes(x, y, group = g)) + geom_line()? (Assuming that the ys are irregular). Can you do it without an explicit loop? #rstats 7261 26
Andrew Manderson @hhau.bsky.social · 17/12/2024Cheat and use `pivot_wider` df <- tidyr::pivot_wider(df, id_cols = x, names_from = g, values_from = y) matplot(df$x, y = df[, 2:ncol(df)], type = "l", col = "black", lty = "solid") 240 4
Andrew Manderson @hhau.bsky.social · 17/12/2024Ah but this might not work depending on what you mean by "irregular" 060 6