laply is part of what package in R?

后端 未结 4 1461
感动是毒
感动是毒 2021-01-17 08:24

laply for R is part of what package?

I get:

 \"Error: could not find function \"laply\"\".

Thanks.

相关标签:
4条回答
  • 2021-01-17 08:46

    Try typing:

    ?lapply
    

    And you'll see at the top of the documentation:

    package:base
    

    The message "Could not find function laply" is not surprising if, as here, you mis-spelled it with one "p", instead of two.

    EDIT: as others pointed out, the plyr package provides laply; you need to clarify your question.

    0 讨论(0)
  • 2021-01-17 08:53

    A useful way to find functions that are somewhere in some contributed package on CRAN is

    install.packages("sos")
    library("sos")
    findFn("laply")
    

    (of course, the first command is only necessary once per R installation ...)

    In this case, you get

    > findFn("laply")
    found 5 matches
    

    and a web page opens in your web browser that shows you (as stated above) that there is an laply function in the plyr package.

    Of course, findFn() is much more broadly useful -- for example, you could try findFn("compositional data analysis") (if that was what you were interested in).

    0 讨论(0)
  • 2021-01-17 08:57

    you are missing the package plyr. install:

    install.packages("plyr")
    
    0 讨论(0)
  • 2021-01-17 09:04

    laply is a function in Hadley's "plyr" package. The convention is that the first letter refers to the input class and the second letter refers to the output class so laply takes a list and returns an array.

    install.packages("plyr")
    require(plyr)
    ?laply
    

    Edit: Now that the question has changed the answer is now the base package. (But if the error message was as posted it did imply a misspelling.)

    0 讨论(0)
提交回复
热议问题