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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:41:56+00:00 2026-06-04T03:41:56+00:00

I wonder if someone can help. I have a simple dataframe: spp rep ac.temp

  • 0

I wonder if someone can help. I have a simple dataframe:

       spp rep ac.temp            sr ink.temp flux.type      flux             unit
1  Ecklonia   1      19 Ecklonia:1:19     10.1         R 0.1614302 mg O2 gDW-1 hr-1
2  Ecklonia   1      19 Ecklonia:1:19     19.0         R 0.6558070 mg O2 gDW-1 hr-1
3  Ecklonia   1      19 Ecklonia:1:19     24.7         R 0.8777117 mg O2 gDW-1 hr-1
4  Ecklonia   1      19 Ecklonia:1:19     28.9         R 2.3192236 mg O2 gDW-1 hr-1
5  Ecklonia   1      20 Ecklonia:1:20     10.3         R 0.5050336 mg O2 gDW-1 hr-1
6  Ecklonia   1      20 Ecklonia:1:20     20.8         R 1.2928442 mg O2 gDW-1 hr-1
7  Ecklonia   1      20 Ecklonia:1:20     24.8         R 1.8159838 mg O2 gDW-1 hr-1
8  Ecklonia   1      20 Ecklonia:1:20     29.8         R 2.8463946 mg O2 gDW-1 hr-1
9  Ecklonia   1      21 Ecklonia:1:21     10.3         R 0.5214549 mg O2 gDW-1 hr-1
10 Ecklonia   1      21 Ecklonia:1:21     19.5         R 0.9994689 mg O2 gDW-1 hr-1

I would like to remove rows where the unique combinations (there are many more than just those shown) of the column data$sr are of length less than 3 elements.

Anyone know of an automatic way of doing this?

Thanks in advance.

  • 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-04T03:41:57+00:00Added an answer on June 4, 2026 at 3:41 am

    You could use ?table to count the occurrence of elements.

    ## create example dataframe
    df <- data.frame(rep=rep(1, 16),
                    sr=c(rep("Ecklonia:1:19", 4),
                        rep("Ecklonia:1:20", 3),
                        rep("Ecklonia:1:21", 2),
                        rep("Ecklonia:1:22", 4),
                        rep("Ecklonia:1:23", 2),
                        "Ecklonia:1:24"),
                    stringsAsFactors=FALSE);
    
    ## count occurrence of elements in column "sr"
    x <- table(df$sr);
    
    ## keep only elements which occure at least 3 times
    keep <- df$sr %in% names(x)[x >= 3];
    
    df[keep, ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

wonder whether someone can help me with the following one... I have a struct
I wonder whether someone can help me please. I have the following xml file
I wonder whether someone can help me please. I have a mySQL database which
I wonder if someone can help a google analytics novice out? Basically I have
I wonder if someone can help me with this. I have a LINQ query
I wonder whether someone can help me please. I have the following three tables:
I wonder if someone can help me. I'm trying to add a reference to
I wonder if someone can help me. I'm trying to display a toast element
I wonder if someone can help: Long story short, I'm using MSSQL2005 to build
I wonder if someone can help shed some light on this: I drop a

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.