Enter below the R command to create the test data set. Call…