powered by
Function to return the column number for column name
get_column_no_colnames(data, column_name)
a data frame
column names of the data frame
column number, if success -1, if failure
# NOT RUN { get_column_no_colnames(data.frame(age = rep(20, 4), sex = rep("male", 4)), "sex") # }
Run the code above in your browser using DataLab