0

In contrast to the other requests that want unique values of the whole list, the intention of the request is to remove all the values that appear more than one time AND not keep them remaining.

#create a list in R:    
f <- c(1,2,3,4,5,6,7,8,3,2,4,523,23,1,2,3,4,5)

And the goal is to have a list of:

6,7,8,523,23

My attempt is to create a table of f in order to get the frequencies:

table(f)

This results in the following output:

> f
  1   2   3   4   5   6   7   8  23 523 
  2   3   3   3   2   1   1   1   1   1 

There is a related request here: How to delete rows with specific values in a (frequency) table in R? But it was a workaround solution by transforming the frequency table into a data frame. I wonder if there is a direct way.

I appreciate any help or ideas on how to process this task.

0 Answers0