How to perform F-test in R?

Pretty, straight forward question. Does anyone know any way of computing or testing statistical significance for my regression using F-test in R?

We need the F-test to check whether the variances of two Populations A and B are equal or not.
The R function var.test () can be used to compare two variances as follow:

Method 1

var.test(values ~ groups, data, alternative = “two.sided”)

Method 2

var.test(x, y, alternative = “two.sided”)