Question Details

No question body available.

Tags

r scope package seurat

Answers (3)

February 10, 2026 Score: 1 Rep: 47,183 Quality: Medium Completeness: 60%

When you do ?merge with SeuratObject attached, you are offered the chance to look at "Merge Seurat Objects" in SeuratObject. But the first line of the Usage section for that help page says

## S3 method for class 'Seurat'  

which tells you that you are looking at help for merge.Seurat, not just plain merge. If you call merge you'll get the generic function from the base package, and if the first argument happens to be a Seurat object, it will dispatch to merge.Seurat.

It is sometimes hard to tell which generic function is associated with an S3 method. One reliable way is to use get() to get the generic function from the namespace of the package. For example,

> get("merge", envir = asNamespace("SeuratObject"))
function (x, y, ...) 
UseMethod("merge")

This shows you that the generic associated with merge.Seurat is the one in the base package.

February 10, 2026 Score: 1 Rep: 11 Quality: Low Completeness: 40%

It seems that the implementation of merge() in SeuratObject is only a method for specific Seurat objects. I would suggest calling the function from the S4Vectors package: S4Vectors::merge(). Maybe this could solve the issue

February 10, 2026 Score: 0 Rep: 49,941 Quality: Medium Completeness: 80%

This is a general answer about exported and non-exported functions in packages, not specific to the package mentioned.

Section 1.5.1 of the Writing R Extensions help page (which is installed with R or available at https://cran.r-project.org/manuals.html) talks about exported functions from a package. There can be functions that are only intended to be called by other functions in the package. Attempting to call these functions using :: results in the error about a function not being exported from that namespace. The last paragraph in that section mentions using ::: (3 colons) instead of :: to access unexported objects. But it also includes a warning about doing so since there is no guarantee that unexported functions will not change with updates or even routine maintenance.

It is usually best to only call these functions indirectly through the other functions in the package, or using the object oriented mechanisms by calling the generic and allowing it to find the appropriate function. But if you really need to call that function and are willing to take the risk, use the triple colon calling method.