Skip to content

error in evaluating the argument 'object' in selecting a method for function 'fitted' for a pcaRes object #27

Description

@jcm6t

Here is the use case:

Main R script :

library(pcaMethods)
source("myfunctionlib.R")

and myfunctionlib.R loads a set of project library functions, one of which is:
imputeProtProbPCA() which calls kEstimateFast()

I get the following error when calling imputeProtProbPCA() for a matrix data set:

Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'object' in selecting a method for function 'fitted': missing value where TRUE/FALSE needed
Calls: imputeProtProbPCA ... kEstimateFast -> fitted -> pca -> ppca -> .handleSimpleError -> h

What I think is happening is that kEstimateFast() calls fitted() but under this distributed library structure stats::fitted() is being called instead of pcaMethods:::fitted()

There is a workaround - simply load the library(pcaMethods) in the main program and call kEstimateFast() directly in the main prog also but that restricts any sort of custom developer/env structure.

The simple fix is to go through the source code and wherever fitted() is called check that the function is really expecting a pcaRes object and if so, replace with pcaMethods:::fitted() . In any case, this is the development standard for imported functions and CRAN namespaces now.

Not urgent and I understand that time and resources are very limited but the bioconductor packages are heavily used and should (ideally) be leading the way in standards or at least working towards compliance.

Thanks very much.
Joe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions