Skip to content

[Bioc-devel] help

2 messages · Mohsen Nabian, Martin Morgan

#
" Avoid sapply(); use vapply()"

Hi, This is a Note I received from BiocCheck()

I tried to change my sapply functions to vapply; however, vapply requires
knowing the exact length of the vector(list), however, my vector length are
not static and variable. Therefore, vapply may not be of use for me in
those cases. Is there any solution for it? Or shall I ignore the Note?

Many thanks,
Mohsen
#
`sapply()` implies that you expect the result to be _s_implified, which implies that all your elements are the same length. Sounds like you want to use `lapply()` instead, to signal that it will *not* be simplified, even if by chance the elements are the same length.

Martin

?On 2/11/20, 3:51 PM, "Bioc-devel on behalf of Mohsen Nabian" <bioc-devel-bounces at r-project.org on behalf of mnabian at broadinstitute.org> wrote:

    " Avoid sapply(); use vapply()"
    
    Hi, This is a Note I received from BiocCheck()
    
    I tried to change my sapply functions to vapply; however, vapply requires
    knowing the exact length of the vector(list), however, my vector length are
    not static and variable. Therefore, vapply may not be of use for me in
    those cases. Is there any solution for it? Or shall I ignore the Note?
    
    Many thanks,
    Mohsen
    
    
    _______________________________________________
    Bioc-devel at r-project.org mailing list
    https://stat.ethz.ch/mailman/listinfo/bioc-devel