diff --git a/DESCRIPTION b/DESCRIPTION index d420bd1..35ee2ee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,8 +2,8 @@ Package: ggnetwork Type: Package Title: Geometries to Plot Networks with 'ggplot2' Description: Geometries to plot network objects with 'ggplot2'. -Version: 0.5.10 -Date: 2021-07-05 +Version: 0.5.12 +Date: 2023-03-06 Maintainer: François Briatte Authors@R: c( person("François", "Briatte", email = "f.briatte@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-6494-9774")), @@ -38,7 +38,7 @@ Collate: 'geom-edges.R' 'ggnetwork.R' VignetteBuilder: knitr -RoxygenNote: 7.1.1 +RoxygenNote: 7.2.1 Roxygen: list(markdown = TRUE) Encoding: UTF-8 NeedsCompilation: no diff --git a/NEWS.md b/NEWS.md index db26a08..eef2ac4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,16 @@ +ggnetwork 0.5.12 (2023-03-06) +============================= + +## Minor improvements and fixes + +* Fortifying graph objects now assumes that `getOption("stringsAsFactors")` is to be set to `FALSE` when it is missing (required by a recent change in R-devel). + ggnetwork 0.5.11 (2021-07-06) ============================= ## Repository changes * Replaced Travis CI with GitHub Actions (#66). -* Started using [`renv`](https://rstudio.github.io/renv/articles/renv.html) for [that purpose](https://rstudio.github.io/renv/articles/ci.html). ggnetwork 0.5.10 (2021-07-05) ============================= diff --git a/R/fortify-igraph.R b/R/fortify-igraph.R index cefe690..d731582 100644 --- a/R/fortify-igraph.R +++ b/R/fortify-igraph.R @@ -20,7 +20,7 @@ fortify.igraph <- function( arrow.gap = ifelse(igraph::is.directed(model), 0.025, 0), by = NULL, scale = TRUE, - stringsAsFactors = getOption("stringsAsFactors"), + stringsAsFactors = getOption("stringsAsFactors", FALSE), ... ) { # node placement diff --git a/R/fortify-network.R b/R/fortify-network.R index cb6138a..df1c1e3 100644 --- a/R/fortify-network.R +++ b/R/fortify-network.R @@ -103,7 +103,7 @@ fortify.network <- function( arrow.gap = ifelse(network::is.directed(model), 0.025, 0), by = NULL, scale = TRUE, - stringsAsFactors = getOption("stringsAsFactors"), + stringsAsFactors = getOption("stringsAsFactors", FALSE), ... ) { # node placement diff --git a/R/utilities.R b/R/utilities.R index e933b5c..095e9bc 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -110,8 +110,8 @@ NULL #' meaningful spatial coordinates, such as latitude and longitude. #' @param stringsAsFactors whether vertex and edge attributes should be #' converted to factors if they are of class \code{character}. Defaults to -#' the value of \code{getOption("stringsAsFactors")}, which is \code{TRUE} by -#' default: see \code{\link[base]{data.frame}}. +#' the value of \code{getOption("stringsAsFactors")}, which is \code{FALSE} +#' by default: see \code{\link[base]{data.frame}}. #' @param .list_vertex_attributes_fun a "list vertex attributes" function. #' @param .get_vertex_attributes_fun a "get vertex attributes" function. #' @param .list_edges_attributes_fun a "get edges attributes" function. @@ -129,7 +129,7 @@ format_fortify <- function( arrow.gap = ifelse(network::is.directed(model), 0.025, 0), by = NULL, scale = TRUE, - stringsAsFactors = getOption("stringsAsFactors"), + stringsAsFactors = getOption("stringsAsFactors", FALSE), .list_vertex_attributes_fun = NULL, .get_vertex_attributes_fun = NULL, .list_edges_attributes_fun = NULL, diff --git a/man/format_fortify.Rd b/man/format_fortify.Rd index 4b24aaa..215e807 100644 --- a/man/format_fortify.Rd +++ b/man/format_fortify.Rd @@ -11,7 +11,7 @@ format_fortify( arrow.gap = ifelse(network::is.directed(model), 0.025, 0), by = NULL, scale = TRUE, - stringsAsFactors = getOption("stringsAsFactors"), + stringsAsFactors = getOption("stringsAsFactors", FALSE), .list_vertex_attributes_fun = NULL, .get_vertex_attributes_fun = NULL, .list_edges_attributes_fun = NULL, @@ -48,8 +48,8 @@ meaningful spatial coordinates, such as latitude and longitude.} \item{stringsAsFactors}{whether vertex and edge attributes should be converted to factors if they are of class \code{character}. Defaults to -the value of \code{getOption("stringsAsFactors")}, which is \code{TRUE} by -default: see \code{\link[base]{data.frame}}.} +the value of \code{getOption("stringsAsFactors")}, which is \code{FALSE} +by default: see \code{\link[base]{data.frame}}.} \item{.list_vertex_attributes_fun}{a "list vertex attributes" function.} diff --git a/man/fortify.igraph.Rd b/man/fortify.igraph.Rd index 67b370f..e577203 100644 --- a/man/fortify.igraph.Rd +++ b/man/fortify.igraph.Rd @@ -11,7 +11,7 @@ arrow.gap = ifelse(igraph::is.directed(model), 0.025, 0), by = NULL, scale = TRUE, - stringsAsFactors = getOption("stringsAsFactors"), + stringsAsFactors = getOption("stringsAsFactors", FALSE), ... ) } @@ -44,8 +44,8 @@ meaningful spatial coordinates, such as latitude and longitude.} \item{stringsAsFactors}{whether vertex and edge attributes should be converted to factors if they are of class \code{character}. Defaults to -the value of \code{getOption("stringsAsFactors")}, which is \code{TRUE} by -default: see \code{\link[base]{data.frame}}.} +the value of \code{getOption("stringsAsFactors")}, which is \code{FALSE} +by default: see \code{\link[base]{data.frame}}.} \item{...}{additional parameters for the \code{\link[igraph]{layout_}} function} } diff --git a/man/fortify.network.Rd b/man/fortify.network.Rd index ce130fb..ffd23d0 100644 --- a/man/fortify.network.Rd +++ b/man/fortify.network.Rd @@ -12,7 +12,7 @@ arrow.gap = ifelse(network::is.directed(model), 0.025, 0), by = NULL, scale = TRUE, - stringsAsFactors = getOption("stringsAsFactors"), + stringsAsFactors = getOption("stringsAsFactors", FALSE), ... ) } @@ -49,8 +49,8 @@ meaningful spatial coordinates, such as latitude and longitude.} \item{stringsAsFactors}{whether vertex and edge attributes should be converted to factors if they are of class \code{character}. Defaults to -the value of \code{getOption("stringsAsFactors")}, which is \code{TRUE} by -default: see \code{\link[base]{data.frame}}.} +the value of \code{getOption("stringsAsFactors")}, which is \code{FALSE} +by default: see \code{\link[base]{data.frame}}.} \item{...}{additional parameters for the \code{layout} argument; see \code{\link[sna]{gplot.layout}} for available options.} diff --git a/man/geom_edges.Rd b/man/geom_edges.Rd index 49d970f..cc2beae 100644 --- a/man/geom_edges.Rd +++ b/man/geom_edges.Rd @@ -19,10 +19,10 @@ geom_edges( ) } \arguments{ -\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}} or -\code{\link[ggplot2:aes_]{aes_()}}. If specified and \code{inherit.aes = TRUE} (the -default), it is combined with the default mapping at the top level of the -plot. You must supply \code{mapping} if there is no plot mapping.} +\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}}. If specified and +\code{inherit.aes = TRUE} (the default), it is combined with the default mapping +at the top level of the plot. You must supply \code{mapping} if there is no plot +mapping.} \item{data}{The data to be displayed in this layer. There are three options: @@ -39,10 +39,12 @@ the plot data. The return value must be a \code{data.frame}, and will be used as the layer data. A \code{function} can be created from a \code{formula} (e.g. \code{~ head(.x, 10)}).} -\item{position}{Position adjustment, either as a string, or the result of -a call to a position adjustment function.} +\item{position}{Position adjustment, either as a string naming the adjustment +(e.g. \code{"jitter"} to use \code{position_jitter}), or the result of a call to a +position adjustment function. Use the latter if you need to change the +settings of the adjustment.} -\item{arrow}{specification for arrow heads, as created by arrow().} +\item{arrow}{specification for arrow heads, as created by \code{\link[grid:arrow]{grid::arrow()}}.} \item{curvature}{A numeric value giving the amount of curvature. Negative values produce left-hand curves, positive values diff --git a/man/geom_edgetext.Rd b/man/geom_edgetext.Rd index 5d0b979..417b4a6 100644 --- a/man/geom_edgetext.Rd +++ b/man/geom_edgetext.Rd @@ -38,10 +38,10 @@ geom_edgelabel( ) } \arguments{ -\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}} or -\code{\link[ggplot2:aes_]{aes_()}}. If specified and \code{inherit.aes = TRUE} (the -default), it is combined with the default mapping at the top level of the -plot. You must supply \code{mapping} if there is no plot mapping.} +\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}}. If specified and +\code{inherit.aes = TRUE} (the default), it is combined with the default mapping +at the top level of the plot. You must supply \code{mapping} if there is no plot +mapping.} \item{data}{The data to be displayed in this layer. There are three options: @@ -70,11 +70,7 @@ often aesthetics, used to set an aesthetic to a fixed value, like \code{colour = "red"} or \code{size = 3}. They may also be parameters to the paired geom/stat.} -\item{nudge_x}{Horizontal and vertical adjustment to nudge labels by. -Useful for offsetting text from points, particularly on discrete scales. -Cannot be jointly specified with \code{position}.} - -\item{nudge_y}{Horizontal and vertical adjustment to nudge labels by. +\item{nudge_x, nudge_y}{Horizontal and vertical adjustment to nudge labels by. Useful for offsetting text from points, particularly on discrete scales. Cannot be jointly specified with \code{position}.} diff --git a/man/geom_edgetext_repel.Rd b/man/geom_edgetext_repel.Rd index e8846a3..051b415 100644 --- a/man/geom_edgetext_repel.Rd +++ b/man/geom_edgetext_repel.Rd @@ -95,11 +95,7 @@ to 1.} \item{max.iter}{Maximum number of iterations to try to resolve overlaps. Defaults to 10000.} -\item{nudge_x}{Horizontal and vertical adjustments to nudge the -starting position of each text label. The units for \code{nudge_x} and -\code{nudge_y} are the same as for the data units on the x-axis and y-axis.} - -\item{nudge_y}{Horizontal and vertical adjustments to nudge the +\item{nudge_x, nudge_y}{Horizontal and vertical adjustments to nudge the starting position of each text label. The units for \code{nudge_x} and \code{nudge_y} are the same as for the data units on the x-axis and y-axis.} diff --git a/man/geom_nodes.Rd b/man/geom_nodes.Rd index ed3eac1..efa7339 100644 --- a/man/geom_nodes.Rd +++ b/man/geom_nodes.Rd @@ -15,10 +15,10 @@ geom_nodes( ) } \arguments{ -\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}} or -\code{\link[ggplot2:aes_]{aes_()}}. If specified and \code{inherit.aes = TRUE} (the -default), it is combined with the default mapping at the top level of the -plot. You must supply \code{mapping} if there is no plot mapping.} +\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}}. If specified and +\code{inherit.aes = TRUE} (the default), it is combined with the default mapping +at the top level of the plot. You must supply \code{mapping} if there is no plot +mapping.} \item{data}{The data to be displayed in this layer. There are three options: @@ -35,8 +35,10 @@ the plot data. The return value must be a \code{data.frame}, and will be used as the layer data. A \code{function} can be created from a \code{formula} (e.g. \code{~ head(.x, 10)}).} -\item{position}{Position adjustment, either as a string, or the result of -a call to a position adjustment function.} +\item{position}{Position adjustment, either as a string naming the adjustment +(e.g. \code{"jitter"} to use \code{position_jitter}), or the result of a call to a +position adjustment function. Use the latter if you need to change the +settings of the adjustment.} \item{na.rm}{If \code{FALSE}, the default, missing values are removed with a warning. If \code{TRUE}, missing values are silently removed.} diff --git a/man/geom_nodetext.Rd b/man/geom_nodetext.Rd index 1e40925..d9e2409 100644 --- a/man/geom_nodetext.Rd +++ b/man/geom_nodetext.Rd @@ -36,10 +36,10 @@ geom_nodelabel( ) } \arguments{ -\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}} or -\code{\link[ggplot2:aes_]{aes_()}}. If specified and \code{inherit.aes = TRUE} (the -default), it is combined with the default mapping at the top level of the -plot. You must supply \code{mapping} if there is no plot mapping.} +\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}}. If specified and +\code{inherit.aes = TRUE} (the default), it is combined with the default mapping +at the top level of the plot. You must supply \code{mapping} if there is no plot +mapping.} \item{data}{The data to be displayed in this layer. There are three options: @@ -68,11 +68,7 @@ to the paired geom/stat.} \item{parse}{If \code{TRUE}, the labels will be parsed into expressions and displayed as described in \code{?plotmath}.} -\item{nudge_x}{Horizontal and vertical adjustment to nudge labels by. -Useful for offsetting text from points, particularly on discrete scales. -Cannot be jointly specified with \code{position}.} - -\item{nudge_y}{Horizontal and vertical adjustment to nudge labels by. +\item{nudge_x, nudge_y}{Horizontal and vertical adjustment to nudge labels by. Useful for offsetting text from points, particularly on discrete scales. Cannot be jointly specified with \code{position}.} diff --git a/man/geom_nodetext_repel.Rd b/man/geom_nodetext_repel.Rd index c0cc7e6..f183b46 100644 --- a/man/geom_nodetext_repel.Rd +++ b/man/geom_nodetext_repel.Rd @@ -82,11 +82,7 @@ to 1.} \item{max.iter}{Maximum number of iterations to try to resolve overlaps. Defaults to 10000.} -\item{nudge_x}{Horizontal and vertical adjustments to nudge the -starting position of each text label. The units for \code{nudge_x} and -\code{nudge_y} are the same as for the data units on the x-axis and y-axis.} - -\item{nudge_y}{Horizontal and vertical adjustments to nudge the +\item{nudge_x, nudge_y}{Horizontal and vertical adjustments to nudge the starting position of each text label. The units for \code{nudge_x} and \code{nudge_y} are the same as for the data units on the x-axis and y-axis.} diff --git a/tests/testthat/testthat-problems.rds b/tests/testthat/testthat-problems.rds deleted file mode 100644 index a9b70e4..0000000 Binary files a/tests/testthat/testthat-problems.rds and /dev/null differ