You can find the most frequent record using table() and which.max() , then you can index the original vector with a logical vector containing unequal records, for example: data [data! = Mostfrequent]. You can get help ?table() and ?which.max() , comment if you need more.
Your sample vector
x <- c(378, 380, 380, 380, 380, 360, 187, 380)
Find the frequency of each number in it using table . For convenience, in the future we will convert it to a data frame.
counts <- as.data.frame(table(x), stringsAsFactors = FALSE)
which.max allows us to find the modal value (the most common).
modal_value <- which.max(counts$Freq)
Other values ββcan then be found using indexing.
as.numeric(counts[-modal_value, "x"])
source share