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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:51:51+00:00 2026-05-24T15:51:51+00:00

I have a dataframe made up of 400’000 rows and about 50 columns. As

  • 0

I have a dataframe made up of 400’000 rows and about 50 columns. As this dataframe is so large, it is too computationally taxing to work with.
I would like to split this dataframe up into smaller ones, after which I will run the functions I would like to run, and then reassemble the dataframe at the end.

There is no grouping variable that I would like to use to split up this dataframe. I would just like to split it up by number of rows. For example, I would like to split this 400’000-row table into 400 1’000-row dataframes.
How might I do this?

  • 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-24T15:51:52+00:00Added an answer on May 24, 2026 at 3:51 pm

    Make your own grouping variable.

    d <- split(my_data_frame,rep(1:400,each=1000))
    

    You should also consider the ddply function from the plyr package, or the group_by() function from dplyr.

    edited for brevity, after Hadley’s comments.

    If you don’t know how many rows are in the data frame, or if the data frame might be an unequal length of your desired chunk size, you can do

    chunk <- 1000
    n <- nrow(my_data_frame)
    r  <- rep(1:ceiling(n/chunk),each=chunk)[1:n]
    d <- split(my_data_frame,r)
    

    You could also use

    r <- ggplot2::cut_width(1:n,chunk,boundary=0)
    

    For future readers, methods based on the dplyr and data.table packages will probably be (much) faster for doing group-wise operations on data frames, e.g. something like

    (my_data_frame 
       %>% mutate(index=rep(1:ngrps,each=full_number)[seq(.data)])
       %>% group_by(index)
       %>% [mutate, summarise, do()] ...
    )
    

    There are also many answers here

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

Sidebar

Related Questions

I have a dataframe (14.5K rows by 15 columns) containing billing data from 2001
I have a dataframe made up of 6 columns. Columns 1 to 5 each
I have got a dataframe made up by three columns (see example in the
I have a dataframe with distances df<-data.frame(site.x=c(A,A,A,B,B,C), site.y=c(B,C,D,C,D,D),Distance=c(67,57,64,60,67,60)) I need to convert this to
I have a dataframe x with this values: x1 x2 x3 1 NA 4
I have a dataframe with some numeric columns. Some row has a 0 value
I have a dataframe with over 200 columns. The issue is as they were
I have a dataframe with numeric entries like this one test <- data.frame(x =
Suppose I have a DataFrame with 100k rows and a column name . I
Say I have a dataframe df with two or more columns, is there an

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.