I need some help with R. I'm not an expert and just began using it.
I need to check the unicity of values in a table and would like to know how I can do that.
Let say I have a contractID and a contractNumber in the data frame Contract2008 I would like to make sure that there is only 1 contractNumber by Contract ID. I did this :
DT <- data.table(contract2008)
DT[, .(number_of_distinct_numcontract = length(unique("contractNumeber"))), by = "ContractID"]
Is this the right way to do it?
Thank you for your help
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.