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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:53:08+00:00 2026-06-12T01:53:08+00:00

I made a list out of my dataframe, based on the factor levels in

  • 0

I made a list out of my dataframe, based on the factor levels in column A. In the list I would like to remove that column. My head is saying lapply, but not anything else 😛

$A
ID Test
A   1
A   1

$B
 ID Test
 B   1
 B   3
 B   5

Into this

$A
Test
 1
 1

$B
Test
 1
 3
 5
  • 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-12T01:53:09+00:00Added an answer on June 12, 2026 at 1:53 am

    Assuming your list is called myList, something like this should work:

    lapply(myList, function(x) { x["ID"] <- NULL; x })
    

    Update

    For a more general solution, you can also use something like this:

    # Sample data
    myList <- list(A = data.frame(ID = c("A", "A"), 
                                  Test = c(1, 1), 
                                  Value = 1:2), 
                   B = data.frame(ID = c("B", "B", "B"), 
                                  Test = c(1, 3, 5), 
                                  Value = 1:3))
    # Keep just the "ID" and "Value" columns
    lapply(myList, function(x) x[(names(x) %in% c("ID", "Value"))])
    # Drop the "ID" and "Value" columns
    lapply(myList, function(x) x[!(names(x) %in% c("ID", "Value"))])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to re-render a list made using Marionette.ItemView when the corresponding model
so my code looks like this: def parse(info): 'info' is a list made out
I made a list from a CSV file. It looks like this: ['18', '29',
I just run into another problem with my To-do-like sortable list made with Knockout
By a question that I made, I figured out that tho copy elements from
I made recursive function, just like require : L (List[Int]) L pattern matching Nil
I have made a list based navigation bar for my newest project and I
I have made a list that uses a list of dates as an index,
I have a table that contains a list of machines that are loaned out
I have an org-mode task list that I keep in version control. I would

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.