need to fetch unique values in a column

Hi All,

I am currently struck at some issue where I need to fetch the unique column and the complete rows in a dataframe. Like for example, in the below table I need to fetch the unqiue from circuitid and fetch complete rows as well.

Ideally there are only 4 different types of circuitid here. Please help.

we really need some sample data and any code you have available.

Assuming that table is a data.frame, then off the top of my head you should be able to do

unique(mydata$circuitid) 

where your data.frame is mydata
to get the unique ids and then

dat1   <-  subset(mydata, circuitid ==  "SAB00001680")
```

Thank you Sir. This is really helpful.

I somehow managed to get using subset. But this has resolved part of my query and another struggle is that while I do unique on particular circuitid, I need to pick up the max value in another column (in inboundthroughput) like below... Hope you get this....

I'm trying to obtain using this but its not giving me expected output.

df_INT <- subset(top_INT, circuitid == unique(top_INT$circuitid)) & max(top_INT$inboundthroughput)

Thanks in advance. :slight_smile:

I am sorry but without usable sample data and your code, I have no idea what you are doing.

Please read the link I provided above.