FAQ
Dear guys,

I want to convert S4 object into list.

When I perform the following on RStudio, the expected result can be obtained.

x <- as.list(hgu133aENTREZID)
#hgu133aENTREZID is a S4 object, after the above command, x can be converted into list.

When I try to build above command into an R package and check it, there is an error during the checking phase.

Error in as.list.default((hgu133aENTREZID)) :
   no method for coercing this S4 class to a vector
Calls: -> as.list -> as.list.default
Execution halted

Why I can not convert S4 into list during the checking package.


Any help would be appreciated.






turinglife

Search Discussions

  • Michael Lawrence at Jan 12, 2014 at 12:12 pm
    This is because your package NAMESPACE does not import the S4 generic for
    as.list. Since you're relying on S4 methods for as.list from AnnotationDbi,
    add importMethodsFrom(AnnotationDbi, as.list).

    On Sat, Jan 11, 2014 at 11:50 PM, turinglife wrote:


    Dear guys,

    I want to convert S4 object into list.

    When I perform the following on RStudio, the expected result can be
    obtained.

    x <- as.list(hgu133aENTREZID)
    #hgu133aENTREZID is a S4 object, after the above command, x can be
    converted into list.

    When I try to build above command into an R package and check it, there is
    an error during the checking phase.

    Error in as.list.default((hgu133aENTREZID)) :
    no method for coercing this S4 class to a vector
    Calls: -> as.list -> as.list.default
    Execution halted

    Why I can not convert S4 into list during the checking package.


    Any help would be appreciated.






    turinglife
    [[alternative HTML version deleted]]

    _______________________________________________
    bioc-devel@r-project.org mailing list
    https://stat.ethz.ch/mailman/listinfo/bioc-devel
  • Turinglife at Jan 13, 2014 at 12:31 am
    Hi Michael,

    Many thanks for helping.


    As your suggestion, i added "importMethodsFrom(AnnotationDbi, as.list)" in NAMESPACE and added "Depends: AnnotationDbi" in DESCRIPTION.
    Finally, it worked correctly.





    turinglife

    From: Michael Lawrence
    Date: 2014-01-12 22:12
    To: turinglife
    CC: bioc-devel
    Subject: Re: [Bioc-devel] no method for coercing this S4 class to a vector
    This is because your package NAMESPACE does not import the S4 generic for as.list. Since you're relying on S4 methods for as.list from AnnotationDbi, add importMethodsFrom(AnnotationDbi, as.list).




    On Sat, Jan 11, 2014 at 11:50 PM, turinglife wrote:


    Dear guys,

    I want to convert S4 object into list.

    When I perform the following on RStudio, the expected result can be obtained.

    x <- as.list(hgu133aENTREZID)
    #hgu133aENTREZID is a S4 object, after the above command, x can be converted into list.

    When I try to build above command into an R package and check it, there is an error during the checking phase.

    Error in as.list.default((hgu133aENTREZID)) :
       no method for coercing this S4 class to a vector
    Calls: -> as.list -> as.list.default
    Execution halted

    Why I can not convert S4 into list during the checking package.


    Any help would be appreciated.






    turinglife
             [[alternative HTML version deleted]]

    _______________________________________________
    bioc-devel@r-project.org mailing list
    https://stat.ethz.ch/mailman/listinfo/bioc-devel

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbioc-devel @
categoriesr
postedJan 12, '14 at 7:50a
activeJan 13, '14 at 12:31a
posts3
users2
websitebioconductor.org
irc#r

2 users in discussion

Turinglife: 2 posts Michael Lawrence: 1 post

People

Translate

site design / logo © 2022 Grokbase