Skip to content

Commit

Permalink
docs: document argument for NCOL format in read_graph() (#1621)
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle authored Jan 7, 2025
1 parent 003264f commit a1f5c40
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 4 deletions.
28 changes: 26 additions & 2 deletions R/foreign.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ write.graph.fromraw <- function(buffer, file) {
#' insensitive.
#' @param \dots Additional arguments, see below.
#' @return A graph object.
#' @section Edge list format: This format is a simple text file with numeric
#' @section Edge list format:
#' This format is a simple text file with numeric
#' vertex IDs defining the edges. There is no need to have newline characters
#' between the edges, a simple space will also do. Vertex IDs contained in
#' the file are assumed to start at zero.
Expand All @@ -142,10 +143,33 @@ write.graph.fromraw <- function(buffer, file) {
#' then it is ignored; so it is safe to set it to zero (the default).}
#' \item{directed}{Logical scalar, whether to create a directed graph. The
#' default value is `TRUE`.} }
#' @section Pajek format: Currently igraph only supports Pajek network
#' @section Pajek format:
#' Currently igraph only supports Pajek network
#' files, with a `.net` extension, but not Pajek project files with
#' a `.paj` extension. Only network data is supported; permutations,
#' hierarchies, clusters and vectors are not.
#' @section NCOL format:
#' Additional arguments: \describe{
#' \item{predef}{Names of the vertices in the file.
#' If `character(0)` (the default) is given here
#' then vertex IDs will be assigned to vertex names in the order of
#' their appearance in the .ncol file.
#' If it is not `character(0)` and some unknown vertex names are found
#' in the .ncol file then new vertex ids will be assigned to them. }
#' \item{names}{Logical value, if `TRUE` (the default)
#' the symbolic names of the vertices will be added to the graph
#' as a vertex attribute called “name”. }
#' \item{weights}{Whether to add the weights of the edges to the graph
#' as an edge attribute called “weight”.
#' `"yes"` adds the weights (even if they are not present in the file,
#' in this case they are assumed to be zero).
#' `"no"` does not add any edge attribute.
#' `"auto"` (the default) adds the attribute if and only
#' if there is at least one explicit edge weight in the input file. }
#' \item{directed}{Whether to create a directed graph (default: `FALSE`).
#' As this format was originally used only for undirected graphs
#' there is no information in the file about the directedness of the graph.}
#' }
#' @author Gabor Csardi \email{csardi.gabor@@gmail.com}
#' @seealso [write_graph()]
#' @keywords graphs
Expand Down
31 changes: 29 additions & 2 deletions man/read_graph.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a1f5c40

Please sign in to comment.