Sorting a Vector in R with Mixed Alphanumeric and Non-Alphanumeric Strings
I need to sort a vector of strings in R according to specific criteria. The vector contains both numeric and non-numeric entries. The criteria for sorting are:
R: order (some) observations by specific values
I need to re-order some of the rows of my dataframe. I have a list of observations (names) that I need to be at the top. It’s a string variable, and just a selection of them need to be at the top–the rest can be in their existing order.
Is there an R function for identifying every unique pattern a sequence is record as, and returning an example of each please?
I have thousands of three-letter codes separated by either “/”, “-” or “*” or a combination of them. I would like to understand how many unique formats they are written in, please. The letters in the code do not matter, just how they are separated, therefore I have just used A’s in the example table below: