See mlr implementation: https://github.com/mlr-org/mlr/blob/master/R/extractFDAFeaturesMethods.R#L55 Could also directly be implemented in the tf package