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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:36:52+00:00 2026-06-11T12:36:52+00:00

This tutorial and the package documentation describe how to do it for pajek files

  • 0

This tutorial and the package documentation describe how to do it for pajek files of the .net format, but I need to import .paj files. I don’t expect there is code that will import all .paj files, but perhaps someone has code that will work for some simpler ones that I could then modify for my purposes?

  • 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-11T12:36:53+00:00Added an answer on June 11, 2026 at 12:36 pm

    I would start with the following approach:

    1. Read the whole file using readLines().
    2. Drop the comment lines, lines that start with ‘%‘.
    3. Cut the lines into pieces, lines that start with a star (‘*‘) mark the start of a new piece.
    4. Inspect each piece in the order they appear and convert them into the appropriate R data structure.

    In Step 4 you may have several types of pieces:

    • *Network is the start of a network.
    • *Vertices defines vertices and belongs to the previous network.
    • *Edges defines undirected edges, it belongs to the previous network.
    • *Arcs defines directed edges, it belongs to the previous network.
    • *Partition is the start of a partition.
    • *Vector is the start of a vector.

    For converting a *Network piece into an igraph graph, glue it together with the *Vertices, *Edges and/or *Arcs pieces that come right after it, and then call read.graph(..., format="pajek") via a textConnection(). This way you don’t need to create temporary files.

    The *Partition and *Vector pieces are simple, just convert them to R vectors, using scan() and textConnection().

    I haven’t tried all this, but I think it is not too difficult and should work fine. Tell me if you have any difficulties.

    Also, Pajek file formats are poorly documented, so I might be wrong, there might be other piece types, etc.

    You may also consider adding a bug report at the igraph bug tracker to request this feature.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This tutorial suggests nesting tables in content controls but every time I'm trying to
Following this tutorial (http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/handling-concurrency-with-the-entity-framework-in-an-asp-net-mvc-application), I learned how to save data and do concurrency checks
I followed this tutorial . But whenever I try to log in with my
I have read this tutorial to write my hello world application with spring mvc.But
I was about to start learning x64 assembly using this tutorial (series) but setting
I've followed this tutorial but when I try to run the application I get
I have used this tutorial to make a website, but I would like that
I'm new to Eclipse (and don't know NetBeans too). I'm reading eclipse tutorial. But
I'm currently following this tutorial http://www.miek.nl/files/go/20120807-go.pdf and on chapter 7 it discusses channels/goroutines However
The documentation for @ParametersAreNonnullByDefault says, that: This annotation can be applied to a package,

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.