add R codes for FMclustering