Search code examples
rcluster-analysispam

R pamk use of clara


I am wondering how to choose the number of samples when using pamk

pamk <- pamk(d, usepam=F)

This way I use clara instead of pam however when I use clara samples = 5 is default, but i change it

clara = clara(d, k=6, samples = 1000)

How do I use pamk to find optimal number of clusters whilst specifying how many samples is used when computing clara?


Solution

  • If I'm not mistaking, there's a ... argument to pfc::pamk where you can pass arguments pased on to clara. So in your case, that would mean

    pamk(d, usepam = FALSE, k = 6, samples = 1000)
    

    See also page 95 of the manual or ?pamk.