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 9205713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:00:58+00:00 2026-06-18T00:00:58+00:00

I have a list of data.frames . Each data.frame is not very big ~150,000

  • 0

I have a list of data.frames. Each data.frame is not very big ~150,000 rows. But my list has over 1000s of these data.frames.

a data.frame looks like:

comp <- read.table(text = " G T H S B
                             1 1 1 1 x1
                             1 1 1 2 x2
                             1 2 6 1 x3
                             1 2 6 2 x4
                             2 1 7 1 x1
                             2 2 8 2 x2
                             2 2 8 1 x1
                             2 3 9 2 x2",header=TRUE,stringsAsFactors=FALSE)

so a list is:

complist <- list(comp,comp,comp)

I want to know for every data.frame, (comp), the length of B for each S in each H in each T in each G.

so for my small practice I use:

library(plyr)
listresults <- lapply(complist, function(x) {
                                res <- ddply(x, .(G,T,H,S),
                                function(z) data.frame(resultcol = length(z$B)) )
                                            } )

But on my larger list this is bruuutally long, could someone help me find a quicker way? Aggregate is not the option here, and I have been failing with a sapply(split)) alternative to the ddply. Suggestions even if not actual code will be just as helpful to me.

  • 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-06-18T00:00:59+00:00Added an answer on June 18, 2026 at 12:00 am

    This is a situation where data.table might be a very good option. data.table has consistently shown to be blisteringly fast, much more so that plyr. There are many examples here on SO, see e.g.:

    • how to operate with a subset of an R dataframe in long format?
    • Using plyr, doMC, and summarise() with very big dataset?
    • or a blogpost of mine.

    This is just a very small portion of the information available, you can check out the documentation of data.table, or look at the [r][data.table] tags on SO.

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

Sidebar

Related Questions

I have a list of data that is a schedule. Each item has a
I have a list of core data objects each has a longitude and latitude
I have a list of 27 data frames with different numbers of rows in
I have a very big data frame consisting of data like this: PENR ANFDAT
I have a list object that contains nested lists, each includes a data frame.
Possible Duplicate: write.csv() a list of unequally sized data.frames I have a data frame
I have big data frame with various numbers of columns and rows. I would
I have a list L of data frames with two columns each...a key, and
I have a list within a data frame (in this example, df$candpct ), and
I'm a java programmer switching over to C++. I have a list of data

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.