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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:48:46+00:00 2026-06-13T10:48:46+00:00

What I am trying to select the rows that have the same gene_id ,

  • 0

What I am trying to select the rows that have the same gene_id, but have the minimum value of the start coordinates: href_pos$start. Why do I get this error, even though I have a memory limit of ~ 16Gb? Or what am I doing wrong? I have the following code:

head(href_pos, 5)

    chr      region    start      end strand nu   gene_id
1  chr1 start_codon 67000042 67000044      +  . NM_032291
2  chr1         CDS 67000042 67000051      +  0 NM_032291
3  chr1        exon 66999825 67000051      +  . NM_032291
4  chr1         CDS 67091530 67091593      +  2 NM_032291
5  chr1        exon 67091530 67091593      +  . NM_032291

d1 <- ddply(as.data.frame(href_pos), “gene_id”, function(href_pos) href_pos[which.min(href_pos$start), ])
Error: cannot allocate vector of size 283 Kb
In addition: Warning messages:
1: In lapply(dfs, function(df) levels(df[[var]])) :
Reached total allocation of 16383Mb: see help(memory.size)

  • 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-13T10:48:47+00:00Added an answer on June 13, 2026 at 10:48 am

    Proof that your syntax is fine:

    #Create a minimal, reproducible example
    gene_id <- gl(3, 3, 9, labels <- letters[1:3])
    start <- rep(1:3, 3)
    href_pos <- data.frame(gene_id=gene_id, start=start)
    
    d1 <- ddply(as.data.frame(href_pos), "gene_id", function(href_pos) href_pos[which.min(href_pos$start), ])
     gene_id  start
    1      a      1
    2      b      1
    3      c      1
    

    To do it with data.table as Chase suggests, this should work:

    require(data.table)
    HREF_POS <- data.table(href_pos)
    setkey(HREF_POS, gene_id)
    MINS <- HREF_POS[HREF_POS[,start] %in% HREF_POS[ ,min(start), by=gene_id]$V1,]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to select all rows that contain the same value in one column
I have two views that returns the same columns, but different rows. I am
In trying to select elements that have any attributes, the following throws a jQuery
I have a form with a few rows that I am trying to insert
I'm trying to query my SQLite DB for all rows that have a particular
am trying to query a table for rows that have dates between two dates.
I have many cursors that all return rows with the same fields: a numeric
I am trying to select a div that is inside the same tr as
I have 2 tables that Im trying to select 4 results from ordered by
I m trying to select rows/columns using vba. I want to pass row numbers

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.