Inefficient ways for subsetting in R

#as an R newbie, still struggling with subsetting

#this is slow but it is useful for non-programmers like me

a<-rnorm(50,mean=10,sd=1) #gen normal dist vector
a
row.a<-a[1:10] #select row 1:10
row.a
sex.a<-c(“male”,”female”) #gen a vector with elements “male” and “female”
sex.a
sex.b<-rep(sex.a,25) #replicate male and female 25 times
sex.b
data<-cbind(a,sex.b) #combind 2 vectors
df.data<-data.frame(data)# creata dataframe
class(df.data) #verufy class
View(df.data) #View
str(df.data) #obs structure
df.data$a<-as.numeric(df.data$a) #convert factor to numeric
str(df.data)
male.data<-subset(df.data, sex.b==”male”) #select male data
male.data
male.less.10<-subset(df.data,sex.b==”male” & a<10.00) #select male data with a <10
male.less.10