I have a time series data in R, and I am using functional clustering. I would like to interpret a figure that is output below the code. Furthermore, I would like to control line colors and thickness in the figure.


1 Answer 1


I do not know the first part of your question but for the second part of it the quick answer is that it is not easy. If you really want to change the color and thickness, here is the solusion.

if we take a look at kmeans.fd function, we have two sub functions that draw the plots kmeans.assig.groups and kmeans.centers.update. There are some lines, points and plot functions inside that you can modify to get your proper results.

Note: See the following structure to see subfunctions. "name of package":::"name of function" for example, fda.usc:::kmeans.fd

For changing color and thickness you need to look for 'col=' and 'lwd=' respectively

If you want to replace the function with a modified one, you need to define a function with exactly the same name (just copy and paste the original function and modify that).

Another solution is to download the package source from CRAN, then modify that and compile that.


Not the answer you're looking for? Browse other questions tagged or ask your own question.