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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:58:45+00:00 2026-06-18T00:58:45+00:00

I have a problem with lists. I have two lists: List1: [[1]] [1] 176

  • 0

I have a problem with lists. I have two lists:

List1:

[[1]]
 [1] 176 177 178 179 180

[[2]]
 [1] 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
 [21] 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256

[[3]]
 [1] 260 261 262 263 264 265

[[4]]
 [1] 293 294 295 296 297 298 299 300 301 302 303 304

[[5]]
 [1] 393 394 395 396 397 398

List 2:

[[1]]
 [1]  99 100 101 102 103

[[2]]
 [1] 260 261 262 263 264 265

[[3]]
 [1] 293 294 295 296 297 298 299 300

[[4]]
  [1] 390 391 392 393 394 395

Now I would like to create a new list with the combined overlapping lists of list 1 and list 2. It should look like this:

List 3:

[[1]]
 [1] 260 261 262 263 264 265

[[2]]
 [1] 293 294 295 296 297 298 299 300 301 302 303 304

[[3]]
 [1] 390 391 392 393 394 395 396 397 398

I would be happy for ideas!

  • 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-18T00:58:46+00:00Added an answer on June 18, 2026 at 12:58 am

    The following gives me the result you asked for:

    list1<-list(176:180, 222:256, 260:265, 293:304, 393:398)
    list2<-list(99:103, 260:265, 293:300, 390:395)
    
    result <- list()
    for (x1 in list1) {
      for (x2 in list2) {
        if (any(x1 %in% x2)) {
          result[[length(result)+1]] <- union(x1, x2) 
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a seemingly simple problem whereby I wish to reconcile two lists so
I'm working with a demo of two sortable jquery lists... but have a problem
I have two pairs of drag/drop/sortable lists using JqueryUI.http://jqueryui.com/demos/sortable/ My problem is that I
In this problem, I have three (identically-structured) lists. Two have all numbers and the
Could you plese give me some adivce on this problem: I have two lists
I have two lists of dictionaries list1 = [ {..}, {..}, ..] list2 =
I can seem to solve this problem. I have two lists of visitors/country that
I have two lists of entities. Imagine list1 is remote and list2 is local
I have two lists lets say: def list1 = [a,b,c,d,e...] def list2 = [1,2,3,4,5...
Hi I have really problem with merging two lists in such code like mergesort

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.