We study a longitudinal data model with nonparametric regression functions that may vary across the observed subjects. In a wide range of applications, it is natural to assume that not every subject has a completely different regression function. We may rather suppose that the observed subjects can be grouped into a small number of classes whose members share the same regression curve. We develop a bandwidth-free clustering method to estimate the unknown group structure from the data. More specically, we construct estimators of the unknown classes and their unknown number which are free of classical bandwidth or smoothing parameters. In the theoretical part of the paper, we analyze the statistical properties of our estimators. The technical analysis is complemented by a simulation study and an application to temperature anomaly data.