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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:42:23+00:00 2026-06-18T17:42:23+00:00

I would like to split my data frame using a couple of columns and

  • 0

I would like to split my data frame using a couple of columns and call let’s say fivenum on each group.

aggregate(Petal.Width ~ Species, iris, function(x) summary(fivenum(x)))

The returned value is a data.frame with only 2 columns and the second being a matrix. How can I turn it into normal columns of a data.frame?

Update

I want something like the following with less code using fivenum

ddply(iris, .(Species), summarise,
      Min = min(Petal.Width),
      Q1 = quantile(Petal.Width, .25),
      Med = median(Petal.Width),
      Q3 = quantile(Petal.Width, .75),
      Max = max(Petal.Width)
      )
  • 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-18T17:42:24+00:00Added an answer on June 18, 2026 at 5:42 pm

    You can use do.call to call data.frame on each of the matrix elements recursively to get a data.frame with vector elements:

    dim(do.call("data.frame",dfr))
    [1] 3 7
    
    str(do.call("data.frame",dfr))
    'data.frame':   3 obs. of  7 variables:
     $ Species            : Factor w/ 3 levels "setosa","versicolor",..: 1 2 3
     $ Petal.Width.Min.   : num  0.1 1 1.4
     $ Petal.Width.1st.Qu.: num  0.2 1.2 1.8
     $ Petal.Width.Median : num  0.2 1.3 2
     $ Petal.Width.Mean   : num  0.28 1.36 2
     $ Petal.Width.3rd.Qu.: num  0.3 1.5 2.3
     $ Petal.Width.Max.   : num  0.6 1.8 2.5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to split one column into two within at data frame based
I have some data represented in a 1300x1341 matrix. I would like to split
I have a file with data in it that I would like to split
I have the following data (from a text file), I would like to split
I would like to split this string by a word data:: not by single
Let's say that I have a hashref whose Data::Dumper output looks like this: $VAR1
i would like to C++-read a file line by line, and split each line
I have a dataframe with one column that I would like to split into
I would like to split the following string generated from a database resultset row.
I would like to split some content from an a html tag. I was

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.