I'm having a weird issue with R.
Basically, I am following this analysis pipeline in order to understand how it works. At some point (right after the first introductory paragraph, the last few lines of the history) I find this piece of code:
#--- clustering ---#
for (n in names(all.sce)) {
g <- buildSNNGraph(all.sce[[n]], k=10, use.dimred='PCA')
clust <- igraph::cluster_walktrap(g)$membership
colLabels(all.sce[[n]]) <- factor(clust)
}
that calls this function colLabels which throws a very weird error:
Error in colLabels(allEnsembl[[n]]) <- factor(clust) : cant find the
function "colLabels<-"
Now, since I am working with a specific kind of data, i.e. single cell data (bioinformatics here), I've looked into this function and it seems to be part of this package called SingleCellExperiment, which I can load successfully before launching the above piece of code.
Once I encountered the error I looked into the R help which can't actually find anything:
> help(colLabels)
No documentation for 'colLabels' in specified packages and libraries: you could try '??colLabels'
> ??colLabels
No vignettes or demos or help files found with alias or concept or title matching 'colLabels' using fuzzy matching.
Problem is...why does the error point to a function (apparently) called colLabels<-?
EDIT: other functions from the mentioned package, i.e. SingleCellExperiment, work and help pages are available.
EDIT 2: I've imported the required library. I also looked into the version I've installed and it seems to be an issue related to the versions. Using sessionInfo()
R tells me I've version 1.8.0 which fits with what stated in the Bioconductor website. The packages version available and also the pdf documentation refers to 1.8.0. BUT I've noticed that in the previous link I've attached I was referring to a development version...probably I need to install it (?)
EDIT 3: ok, I have other issues now. The one in the question was an issue related to the package version since the official SingleCellExperiment was 1.8.0 while the doc I found was related to 1.9.3 which was a development version. Once installed, the help for the function works, but the function itself do not.
sessionInfo()
now states that I have the version 1.9.3 but other functions do not work anymore so, I dont know.