China Naming Network - Auspicious day query - How to randomly select two boys from the list of student numbers with R language?

How to randomly select two boys from the list of student numbers with R language?

R language reads (loads) the data in txt format as a dataframe, and randomly extracts the data of 10 students from the dataframe according to the student number field.

The detailed coding is as follows.

report card 1 = read . table(file = ' test 1 . txt ',header=TRUE)

report card 2 = read . table(file = ' test 2 txt ' header = TRUE)names(report card 1)names(report card 2) report card = merge(report card report card 2,by = xh)print(head(report card))xh = sample(report card $ xh,size= 10, replace = TRUE)samples = report card[report card $ xh % in % xh]print(samples).