R session aborts when running bclust function from bclust package in RStudio

Hi. I am devastatingly in need of help with a problem I am encountering while using function bclust in rstudio.

I am frusterated while trying to figure out why my r session aborts every single time when I try to use fucntion 'bclust' from bclust package. The function works fine with the dataset 'gaelle' that comes with the package, however, it doesn't work with my own dataset that has 146 metabolites in columns and 1715 observations in rows. I have tried updating rstudio, using a smaller dataset, resintalling r and a few more tricks after reading answers to similar problems on this platform. Nothing seems to work. I am providing complete code that I am running to get the results and link to a subset of my dataset to reproduce the problem I am facing. The problem persists when I run my codes in Terminal.

Link to the dataset:

https://github.com/Sidra85/sidra/commit/9e7a6a335e24c09b12e7af5dc3721808aad32166

Codes:

median_center <- function(x) {apply(x, 2, function(y) y - median(y))}
centered_dat <- median_center(dat)
mc.dat <- meancss(centered_dat, rep.id=1:nrow(centered_dat))
optimfunc <- function(theta) { -loglikelihood(x.mean=mc.dat$mean, x.css=mc.dat$css, repno=mc.dat$repno, transformed.par=theta)}
transpar <- optim(rep(0, 6), optimfunc, method="BFGS")$par
bclust(centered_dat, transformed.par=transpar)

I will be immensely obliged to have received any kind of help here.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.