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

  • Home
  • SEARCH
  • 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 4324238
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:06:19+00:00 2026-05-21T09:06:19+00:00

For some reason I’m getting more results than I expected since the upgrade to

  • 0

For some reason I’m getting more results than I expected since the upgrade to R-2.13.0 – and the upgrade to plyr_1.5.1.tar.gz… I tried this on an old version of plyr (version unsure unfortunately as I’ve just overwritten it…)

library(plyr)
dd <-data.frame(matrix(rnorm(216),72,3),c(rep("A",24),rep("B",24),
  rep("C",24)),c(rep("J",36),rep("K",36)))
colnames(dd) <- c("v1", "v2", "v3", "dim1", "dim2")

results1 <- ddply(dd, c("dim1","dim2"), function(df) c(m1=mean(df$v1)) )
results2 <- ddply(dd, c("dim1","dim2"), function(df) { c(m1=mean(df$v1),
    m2=mean(df$v2)) } )
results3 <- ddply(dd, c("dim1","dim2"), function(df) { c(m1=mean(df$v1),
    m2=mean(df$v2), m3=mean(df$v3)) } )

I don’t understand why results 2 has twice the number of rows in results1 and results3 has three times as many – where the original results1 is just replicated twice or three times.

I had a handy copy of R version 2.11.0 Patched (2010-05-01 r51907) using an old version of plyr the results I was expecting were…

> results1
  dim1 dim2          m1
1    A    J  0.07312783
2    B    J -0.22428746
3    B    K -0.44205832
4    C    K  0.21421456
> results2
  dim1 dim2          m1         m2
1    A    J  0.07312783 -0.1130148
2    B    J -0.22428746  0.4394832
3    B    K -0.44205832 -0.1934018
4    C    K  0.21421456 -0.0178809
> results3
  dim1 dim2          m1         m2          m3
1    A    J  0.07312783 -0.1130148 -0.03175873
2    B    J -0.22428746  0.4394832  0.21581696
3    B    K -0.44205832 -0.1934018 -0.28313530
4    C    K  0.21421456 -0.0178809 -0.21948430

The results I get from R version 2.13.0 (2011-04-13)

> results1
  dim1 dim2         m1
1    A    J -0.2270726
2    B    J  0.5860493
3    B    K -0.5986129
4    C    K  0.3135809
> results2
  dim1 dim2         m1          m2
1    A    J -0.2270726 -0.19037813
2    B    J  0.5860493 -0.05385395
3    B    K -0.5986129  0.29404095
4    C    K  0.3135809 -0.26744010
5    A    J -0.2270726 -0.19037813
6    B    J  0.5860493 -0.05385395
7    B    K -0.5986129  0.29404095
8    C    K  0.3135809 -0.26744010
> results3
   dim1 dim2         m1          m2          m3
1     A    J -0.2270726 -0.19037813 -0.20448734
2     B    J  0.5860493 -0.05385395 -0.11190857
3     B    K -0.5986129  0.29404095 -0.27072101
4     C    K  0.3135809 -0.26744010 -0.03184949
5     A    J -0.2270726 -0.19037813 -0.20448734
6     B    J  0.5860493 -0.05385395 -0.11190857
7     B    K -0.5986129  0.29404095 -0.27072101
8     C    K  0.3135809 -0.26744010 -0.03184949
9     A    J -0.2270726 -0.19037813 -0.20448734
10    B    J  0.5860493 -0.05385395 -0.11190857
11    B    K -0.5986129  0.29404095 -0.27072101
12    C    K  0.3135809 -0.26744010 -0.03184949

why has results2 got 8 rows instead of 4 and results3 got 12 rows instead of 4?

Thanks,
Sean

  • 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-21T09:06:20+00:00Added an answer on May 21, 2026 at 9:06 am

    This will be fixed shortly in plyr 1.5.2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

for some reason this image, which is a jpg isn't showing up in IE7
For some reason I never see this done. Is there a reason why not?
For some reason, after submitting a string like this Jack’s Spindle from a text
For some reason when I run the test method, I am getting a false
For some reason, I can not get this dialog to show up on the
for some reason, this isn't adding and removing a new class on elements with
For some reason I get this: 1>LINK : fatal error LNK1104: cannot open file
For some reason the button under the text fields seems to get wider than
For some reason the webapp I created, cannot find the template. I tried also
For some reason my app is using more and more memory as it runs,

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.