I am very new to R, and I am struggling with trying to create a new variable for use with RFM.

I have customer ID per purchase, some of the ID's appear repeatedly, some only once.

I figured that if I were to measure the number of times each ID repeats - for example ID 1 appears 3 times - then I will know that this specific customer's frequency is 3. There are 500 customers, but over 1700 replies.