The function rep() in R will repeate a number or a sequence of numbers n times. For example, typing rep(5, 5) wiull print the number 5 five times. Check out the following posts if you need to extract elements from datetime in e.g. a vector:

R is a system for statistical computation and graphics. It provides, among other things, a programming language, high level graphics, interfaces to other languages and debugging facilities. ... See Writing R documentation in Writing R Extensions. • Syntax and examples • Arguments ... , round, signif, rep and seq.int. The first thing that ...

DA:14PA:87MOZ Rank:75

kknn function - R Documentation and manuals | R Documentation

Performs k-nearest neighbor classification of a test set using a training set. For each row of the test set, the k nearest training set vectors (according to Minkowski distance) are found, and the classification is done via the maximum of summed kernel densities. In addition even ordinal and continuous variables can be predicted.