Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: document argument for NCOL format in read_graph() #1621

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 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 Expand Up @@ -224,7 +248,7 @@ read_graph <- function(file, format = c(
#' @export
#' @keywords graphs
#' @cdocs igraph_write_graph_dimacs_flow igraph_write_graph_dot igraph_write_graph_edgelist
#' @cdocs igraph_write_graph_gml igraph_write_graph_graphml igraph_write_graph_leda
#' @cdocs igraph_write_graph_gml igraph_write_graph_graphml igraph_write_graph_leda
#' @cdocs igraph_write_graph_lgl igraph_write_graph_ncol igraph_write_graph_pajek
#' @examples
#'
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.

Loading