Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3667970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:03:59+00:00 2026-05-19T02:03:59+00:00

Trying to learn plyr, I have gotten stuck trying to reproduce code from the

  • 0

Trying to learn plyr, I have gotten stuck trying to reproduce code from the introductory guide.

The guide says that the code is in a file plyr.r, but not where I can find this file.

But reproducing one of the first examples seemed easy enough, so I decided to give it a try:

alt text

dat <- data.frame(c(10,100,50), mean=c(5,5,10), sd=c(1,2,1))
maply(dat, rnorm)

and I get this error:

Error in function (..., na.last = TRUE, decreasing = FALSE)  : 
unimplemented type 'list' in 'orderVector1'

trying

dat <- cbind(c(10,100,50), mean=c(5,5,10), sd=c(1,2,1))
maply(dat, rnorm)

gives

Error: Results must have the same dimensions.

questions:

  1. what am I doing wrong?
  2. where can I find plyr.r? (it is not here)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:03:59+00:00Added an answer on May 19, 2026 at 2:03 am

    The data frame you made has a header (col.names) which is not compatible with the rnorm function. See:

    > dat <- data.frame(c(10,100,50), mean=c(5,5,10), sd=c(1,2,1))
    > dat
      c.10..100..50. mean sd
    1             10    5  1
    2            100    5  2
    3             50   10  1
    

    And the m*pply function do not know what to do with the ‘c.10..100..50…’ column.

    As you can see in the docs (?mdply), the following example works like a charm:

    > mdply(data.frame(mean = 1:5, sd = 1:5), rnorm, n = 2)
      mean sd         V1         V2
    1    1  1 0.09919179  0.6083586
    2    2  2 0.92787891 -0.1139743
    3    3  3 2.21236781  0.8029677
    4    4  4 4.16506428  9.2477373
    5    5  5 1.26558507 12.0633377
    

    If you really want different number of observations with the different parameters, you should not use mdply, because the matrix/data.frame must have the same number of columns. Insted use mlply, e.g.:

    > mlply(data.frame(n=1:5, mean = 1:5, sd = 1:5), rnorm)
    $`1`
    [1] 1.053083
    
    $`2`
    [1] -1.650090  2.239547
    
    $`3`
    [1] -0.94697908 -1.11479730 -0.03467497
    
    $`4`
    [1]  6.427796  1.482655  1.436822 -5.993420
    
    $`5`
    [1]  4.557689  6.217015  2.105255 -1.309664 -2.969184
    
    attr(,"split_type")
    [1] "array"
    attr(,"split_labels")
      n mean sd
    1 1    1  1
    2 2    2  2
    3 3    3  3
    4 4    4  4
    5 5    5  5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to learn Regex in Python to find words that have consecutive vowel-consonant or
trying to learn and practice arrays but I have a problem with this small
Trying to learn PL/SQL with multimedia data. Can anyone please point out that from
Trying to learn JavaScript, makin decent progress I guess, but I'm stuck at validating
I am somewhat new to jQuery but have been having fun trying learn about
Trying to learn a bit of XUL but am a bit stuck. Building a
Trying to learn about php's arrays today. I have a set of arrays like
im trying to learn delegates and events in c#, i understand that an event
I´m trying to learn C#, coming from a Python/PHP background, and I´m trying to
Im trying to learn a bit about c++ and have run in to some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.