powered by
Function to get the subset of data compared to a string after trimming the white spaces
return_equal_str_col(col, the_data, the_str)
the form of medication either tablet or patch
the data to be get the subset from
the string to be compared
the subset data
# NOT RUN { the_data <- as.data.frame(cbind(c("one", "two"), c("a", "b"))) colnames(the_data) <- c("name", "brand") ans <- return_equal_str_col(2, the_data, "a") # }
Run the code above in your browser using DataLab