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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:59:21+00:00 2026-05-26T03:59:21+00:00

My problem is as it follows. I’m dealing with big data graphs using R/igraph.

  • 0

My problem is as it follows. I’m dealing with big data graphs using R/igraph.

I need to convert the output of clusters()$membership (i.e a vector), to a list which groups the values.

Example: I have the vector (3,3,3,1,1,4,4) I need a list having the following estructure

l<-list()
l[["3"]]<-c(1,2,3)
l[["4"]]<-c(6,7)
l[["1"]]<-c(4,5)

this is, the structure the output of maximal.cliques() function has

I’ve tried using lapply on a list of levels, and then using which to find the indexes for a certain value. However this performs really poorly. I’m dealing with data vectors of 180K elements where there may be 60K diffenrent levels.

  • 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-05-26T03:59:21+00:00Added an answer on May 26, 2026 at 3:59 am

    look at split():

    > x <- c(3,3,3,1,1,4,4)
    > y <- 1:7
    > split(y, x)
    $`1`
    [1] 4 5
    
    $`3`
    [1] 1 2 3
    
    $`4`
    [1] 6 7
    
    
    > z <- data.frame(x,y)
    > split(z, z$x)
    $`1`
      x y
    4 1 4
    5 1 5
    
    $`3`
      x y
    1 3 1
    2 3 2
    3 3 3
    
    $`4`
      x y
    6 4 6
    7 4 7
    
    >
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem as follows: We're using a rich text editor (TinyMCE, but
A systematic breakdown of the problem follows. [Rewritten!] The client code using System; using
This problem follows on from a previous question . When I run the following
The main problem is as follows: I did my code in console application and
Problem 2b goes as follows: 2b. For each subject show the first year that
Our situation is as follows, but I'm curious about this problem in any situation.
I have a mysql problem, my query looks as follows but not complete SELECT
Scroll.js is used for #bird block, which follows the page scrolling. The main problem
When I write a C program, I encountered a problem that is as follows:
Greetings, I have a problem as follows: I have an SQL variable declared: DECLARE

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.