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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:10:05+00:00 2026-06-13T15:10:05+00:00

I have a long dataframe like this: Row Conc group 1 2.5 A 2

  • 0

I have a long dataframe like this:

  Row  Conc   group
  1     2.5    A
  2     3.0    A
  3     4.6    B
  4     5.0    B
  5     3.2    C
  6     4.2    C
  7     5.3    D
  8     3.4    D

…

The actual data have hundreds of row. I would like to split A to C, and D. I looked up the web and found several solutions but not applicable to my case.

How to split a data frame?

For example:
Case 1:

x = data.frame(num = 1:26, let = letters, LET = LETTERS)
set.seed(10)
split(x, sample(rep(1:2, 13)))

I don’t want to split by arbitrary number

Case 2: Split by level/factor

data2 <- data[data$sum_points == 2500, ]

I don’t want to split by a single factor either. Sometimes I want to combine many levels together.

Case 3: select by row number

newdf <- mydf[1:3,]

The actual data have hundreds of rows. I don’t know the row number. I just know the level I would like to split at.

  • 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-13T15:10:07+00:00Added an answer on June 13, 2026 at 3:10 pm

    It sounds like you want two data frames, where one has (A,B,C) in it and one has just D. In that case you could do

    Data1 <- subset(Data, group %in% c("A","B","C"))
    Data2 <- subset(Data, group=="D")
    

    Correct me if you were asking something different

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

Sidebar

Related Questions

I have a ROC.Value data frame that looks like this: Years 1 2 3
Say I have a data frame like this: Df <- data.frame( V1 = c(1,2,3,NA,5),
Let's have a dataframe with long strings in one column: df<-data.frame(short=rnorm(10,0,1),long=replicate(10,paste(rep(sample(letters),runif(1,5,8)),collapse=))) How could I
I have got a data frame (which is called data.set.y). And I would like
I have a data frame like this: df = data.frame(a=1:3, b=2:4, c=3:5) I am
I have two dataframes; one is 48 rows long and looks like this: name
I have a list of data.frames, and would like to operate on their columns,
I have a data.frame df in format long. df <- data.frame(site = rep(c(A,B,C), 1,
Perhaps any of you can help me with this anoying problem. I have long
I have a very long data frame with different plots, dates of sampling and

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.