So I have 4 different versions -- not sure if any of them are what you are thinking of:
# Library & Input Data
suppressPackageStartupMessages(library(tidyverse))
testdata <- tibble::tribble(
~TID, ~time_sec, ~z_um,
0, 0, 0,
0, 120, 13.8,
0, 240, 7.5,
0, 360, 7.2,
0, 480, 8,
1, 0, 12.9,
1, 120, 8.5,
1, 240, 8.4,
1, 360, 7.9,
1, 480, 7.8
)
# Method 1
ggplot(data = testdata, aes(x=time_sec, y=z_um, group=TID))+
geom_line()+
geom_point()

# Method 2
ggplot(data = testdata, aes(x=time_sec, y=z_um, color=as.factor(TID)))+
geom_line()+
geom_point() +
labs(color = "TID")

# Method 3
ggplot(data = testdata, aes(x=time_sec, y=z_um))+
geom_line()+
facet_wrap(~TID) +
geom_point()

# Method 4
make_gg <- function(df0, TID0) {
df1 <- df0 %>% dplyr::filter(TID == TID0)
gg1 <- ggplot(data = df1, aes(x=time_sec, y=z_um))+
geom_line()+
geom_point() +
labs(title = paste0("TID: ", TID0))
print(gg1)
}
purrr::walk(.x = unique(testdata$TID), .f = make_gg, df0 = testdata)


Created on 2019-08-26 by the reprex package (v0.3.0)