Very basic question here (so that I'm afraid to ask). Suppose I have 50 pairs of data and I want to linearly model my data and predict a single new pair to my single input. What should I do?

    a= matrix (rnorm(100),50)
    l= lm (a[,2]~a[,1])
    predict (l, 2.1)

doesn't work.
Try this example:

    # reproducible example input
    set.seed(1); a <- data.frame(matrix(rnorm(100), ncol = 2))
    head(a)
    #           X1         X2
    # 1 -0.6264538  0.3981059
    # 2  0.1836433 -0.6120264
    # 3 -0.8356286  0.3411197
    # 4  1.5952808 -1.1293631
    # 5  0.3295078  1.4330237
    # 6 -0.8204684  1.9803999
    
    # get fit
    l <- lm (X2 ~ X1, data = a)
    
    # new input data with only X1 column, because we want to predict X2
    newData <- data.frame(X1 = 2.1)
    
    newData$X2 <- predict(l, newData)
    newData
    #    X1         X2
    # 1 2.1 0.02624987