Skip to content

Commit

Permalink
updating doc with markdown syntax in place of LaTeX, source of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiquet committed Jan 30, 2024
1 parent 9b60e2a commit 9579bd8
Show file tree
Hide file tree
Showing 17 changed files with 143 additions and 177 deletions.
75 changes: 31 additions & 44 deletions R/estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
#' @param estimOptions a list of parameters controlling the inference algorithm and model selection. See details.
#'
#' @details The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters
#' \itemize{
#' \item{"nbCores"}{integer for number of cores used. Default is 2}
#' \item{"verbosity"}{integer for verbosity (0, 1). Default is 1}
#' \item{"plot"}{boolean, should the ICL by dynamically plotted or not. Default is TRUE}
#' \item{"exploreFactor"}{control the exploration of the number of groups}
#' \item{"exploreMin"}{explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details.}
#' \item{"exploreMax"}{Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details.}
#' \item{"nbBlocksRange"}{minimal and maximal number or blocks explored}
#' \item{"fast"}{logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}}
#' }
#' * "nbCores integer for number of cores used. Default is 2
#' * "verbosity" integer for verbosity (0, 1). Default is 1
#' * "plot" boolean, should the ICL by dynamically plotted or not. Default is TRUE
#' * "exploreFactor" control the exploration of the number of groups
#' * "exploreMin" explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details.
#' * "exploreMax" Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details.
#' * "nbBlocksRange" minimal and maximal number or blocks explored
#' * "fast" logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}
#'
#' @return a list with the estimated parameters. See details...
#'
#' @examples
Expand Down Expand Up @@ -131,16 +130,8 @@ estimateSimpleSBM <- function(netMat,
#' @param covariates a list of matrices with same dimension as mat describing covariates at the edge level. No covariate per Default.
#' @param estimOptions a list of parameters controlling the inference algorithm and model selection. See details.
#'
#' @details The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters
#' \itemize{
#' \item{"nbCores"}{integer for number of cores used. Default is 2}
#' \item{"verbosity"}{integer for verbosity (0, 1). Default is 1}
#' \item{"plot"}{boolean, should the ICL by dynamically plotted or not. Default is TRUE}
#' \item{"exploreFactor"}{control the exploration of the number of groups}
#' \item{"exploreMin"}{explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details.}
#' \item{"exploreMax"}{Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details.}
#' \item{"fast"}{logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}}
#' }
#' @inheritSection estimateSimpleSBM details
#'
#' @return a list with the estimated parameters. See details...
#'
#' @examples
Expand Down Expand Up @@ -231,14 +222,13 @@ estimateBipartiteSBM <- function(netMat,
#' @param listSBM list of networks that were defined by the \code{defineSBM} function
#' @param estimOptions options for the inference procedure
#' @details The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters
#' \itemize{
#' \item{"nbCores"}{integer for number of cores used. Default is 2}
#' \item{"verbosity"}{integer for verbosity (0, 1). Default is 1}
#' \item{"nbBlocksRange"}{List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10)}
#' \item{"initBM"}{Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE}
#' \item{"maxiterVEM"}{Number of max. number of iterations in the VEM. Default value = 100}
#' \item{"maxiterVE"}{Number of max. number of iterations in the VE. Default value = 100}
#'}
#' * "nbCores" integer for number of cores used. Default is 2
#' * "verbosity" integer for verbosity (0, 1). Default is 1
#' * "nbBlocksRange" List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10)
#' * "initBM" Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE
#' * "maxiterVEM" Number of max. number of iterations in the VEM. Default value = 100
#' * "maxiterVE" Number of max. number of iterations in the VE. Default value = 100
#'
#' @return a MultipartiteSBM_fit object with the estimated parameters and the blocks in each Functional Group
#' @export
#'
Expand Down Expand Up @@ -304,22 +294,19 @@ estimateMultipartiteSBM <- function(listSBM,
#' @param dependent logical parameter indicating whether the networks in the multiplex structure are dependent beyond the latent variables,
#' @param estimOptions options for the inference procedure
#' @details The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters
#' \itemize{
#' \item{"nbCores"}{integer for number of cores used. Default is 2}
#' \item{"verbosity"}{integer for verbosity (0, 1). Default is 1}
#' \item{"nbBlocksRange"}{List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10)}
#' \item{"initBM"}{Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE}
#' \item{"maxiterVEM"}{Number of max. number of iterations in the VEM. Default value = 100}
#' \item{"maxiterVE"}{Number of max. number of iterations in the VE. Default value = 100}
#' \item{"plot"}{boolean, should the ICL by dynamically plotted or not. Default is TRUE. For dependent networks}
#' \item{"exploreFactor"}{control the exploration of the number of groups. For dependent networks}
#' \item{"exploreMin"}{explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details. For dependent networks}
#' \item{"exploreMax"}{Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details. For dependent networks}
#' \item{"nbBlocksRange"}{minimal and maximal number or blocks explored. For dependent networks}
#' \item{"fast"}{logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}. For dependent networks}


#'}
#' * "nbCores" integer for number of cores used. Default is 2
#' * "verbosity" integer for verbosity (0, 1). Default is 1
#' * "nbBlocksRange" List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10)
#' * "initBM" Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE
#' * "maxiterVEM" Number of max. number of iterations in the VEM. Default value = 100
#' * "maxiterVE" Number of max. number of iterations in the VE. Default value = 100
#' * "plot" boolean, should the ICL by dynamically plotted or not. Default is TRUE. For dependent networks
#' * "exploreFactor" control the exploration of the number of groups. For dependent networks
#' * "exploreMin" explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details. For dependent networks
#' * "exploreMax" Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details. For dependent networks
#' * "nbBlocksRange" minimal and maximal number or blocks explored. For dependent networks
#' * "fast" logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}. For dependent networks
#'
#' @return a MultiplexSBM_fit object with the estimated parameters and the blocks
#' @export
#'
Expand Down
13 changes: 6 additions & 7 deletions R/fungusTreeNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
#' This data set provides information about $154$ fungi sampled on $51$ tree species.
#'
#' @format A list with the following entries:
#' \describe{
#' \item{fungi_list}{list of the fungus species names}
#' \item{tree_list}{list of the tree species names}
#' \item{fungus_tree}{binary fungus-tree interactions}
#' \item{tree_tree}{weighted tree-tree interactions (number of common fungal species two tree species host) }
#' \item{covar_tree}{covariates associated to pairs of trees (namely genetic, taxonomic and geographic distances)}
#' }
#' * fungi_list list of the fungus species names
#' * tree_list list of the tree species names
#' * fungus_tree binary fungus-tree interactions
#' * tree_tree weighted tree-tree interactions (number of common fungal species two tree species host)
#' * covar_tree covariates associated to pairs of trees (namely genetic, taxonomic and geographic distances)
#'
#' @source Vacher, Corinne, Dominique Piou, and Marie-Laure Desprez-Loustau. "Architecture of an antagonistic tree/fungus network: the asymmetric influence of past evolutionary history." PloS one 3.3 (2008): e1740.
"fungusTreeNetwork"
12 changes: 5 additions & 7 deletions R/multipartiteEcologicalNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
#' Multipartite network of mutualistic interactions between plants and pollinators, plants and birds and plants and ants.
#'
#' @format A list a 3 binary incidence matrices
#' \describe{
#' \item{Inc_plant_ant}{Interactions between plants (rows) and ants (cols). Matrix with 141 rows and 30 columns}
#' \item{Inc_plant_bird}{Interactions between plants (rows) and birds (cols). Matrix with141 rows and 46 columns}
#' \item{Inc_plant_flovis}{Interactions between plants (rows) and pollinators (cols). Matrix with 141 rows and 173 columns}
#' ...
#' }
#' @source Dataset compiled and conducted at Centro de Investigaciones Costeras La Mancha (CICOLMA), located on the central coast of the Gulf of Mexico, Veracruz, Mexico. \url{https://royalsocietypublishing.org/doi/full/10.1098/rspb.2016.1564} \url{https://github.com/lucaspdmedeiros/multi-network_core_removal/tree/master/data}
#' * Inc_plant_ant Interactions between plants (rows) and ants (cols). Matrix with 141 rows and 30 columns
#' * Inc_plant_bird Interactions between plants (rows) and birds (cols). Matrix with141 rows and 46 columns
#' * Inc_plant_flovis Interactions between plants (rows) and pollinators (cols). Matrix with 141 rows and 173 columns
#'
#' @source Dataset compiled and conducted at Centro de Investigaciones Costeras La Mancha (CICOLMA), located on the central coast of the Gulf of Mexico, Veracruz, Mexico. \url{https://royalsocietypublishing.org/doi/full/10.1098/rspb.2016.1564} \url{https://github.com/lucaspdmedeiros/multi-network_core_removal/tree/master/data}
"multipartiteEcologicalNetwork"
12 changes: 5 additions & 7 deletions R/plotAlluvial.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
#' @param plotOptions : a list containing the options for Alluvial plots

#' @details The list of parameters \code{plotOptions} provides the following options
#' \itemize{
#' \item{"curvy"}{numeric, controls the curvature of the alluvial. Default value = 0.3}
#' \item{"alpha}{numeric, vector of transparency of the stripes. Default value = 0.8}
#' \item{"gap.width"}{numeric, relative width of inter-category gaps. Default value = 0.1}
#' \item{"col"}{vector of colors of the stripes. Default value = "darkolivegreen3"}
#' \item{"border"}{vector of border colors for the stripes. Default is white}
#' }
#' * "curvy" numeric, controls the curvature of the alluvial. Default value = 0.3
#' * "alpha numeric, vector of transparency of the stripes. Default value = 0.8
#' * "gap.width" numeric, relative width of inter-category gaps. Default value = 0.1
#' * "col" vector of colors of the stripes. Default value = "darkolivegreen3"
#' * "border" vector of border colors for the stripes. Default is white
#'
#' @return display the alluvial plot, returns the plotOptions as a list
#' @export
Expand Down
19 changes: 9 additions & 10 deletions R/plotMyMatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
#' @param clustering : a list of length 2 specifying a clustering on row and col
#' @param plotOptions : a list providing options. See details below.
#' @details The list of parameters \code{plotOptions} for the matrix plot is
#' \itemize{
#' \item{"legend": }{Boolean. Set TRUE if you want to see the legend. Default value is FALSE}
#' \item{"legend.title": }{Boolean. Set TRUE if you want to print the title of the legend. Default value is FALSE}
#' \item{"legend.position": }{Position of the legend. Possible values are 'bottom', 'top','left,'right'. Default value is 'bottom'}
#' \item{"rowNames": }{Set true if the rownames must be plotted. Default value is FALSE}
#' \item{"colNames": }{Set true if the colNames must be plotted. Default value is FALSE}
#' \item{"line.color": }{Chain of character. The color of the lines to separate groups if a clustering is provided. Default value is red}
#' \item{"line.width": }{Numeric. Width of the lines to separate groups. Default value is NULL, automatically chosen}
#' \item{"title": }{Chain of character. Title of the plot. Default value is NULL}
#' }
#' * "legend": Boolean. Set TRUE if you want to see the legend. Default value is FALSE
#' * "legend.title": Boolean. Set TRUE if you want to print the title of the legend. Default value is FALSE
#' * "legend.position": Position of the legend. Possible values are 'bottom', 'top','left,'right'. Default value is 'bottom'
#' * "rowNames": Set true if the rownames must be plotted. Default value is FALSE
#' * "colNames": Set true if the colNames must be plotted. Default value is FALSE
#' * "line.color": Chain of character. The color of the lines to separate groups if a clustering is provided. Default value is red
#' * "line.width": Numeric. Width of the lines to separate groups. Default value is NULL, automatically chosen
#' * "title": Chain of character. Title of the plot. Default value is NULL
#'
#' @return a ggplot object corresponding to the plot
#' @export
#'
Expand Down
21 changes: 10 additions & 11 deletions R/plotMyMultipartiteMatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
#' @param memberships : a list of length equal to the number of Functional Groups providing the clusterings inside each group.
#' @param plotOptions : a list containing the options. See details.
#' @details plotOptions is a list containing the following items
#' \itemize{
#' \item{"normalized":}{Boolean. TRUE if the various matrices are presented in the same scale (between O and 1). FALSE otherwise. Default value FALSE}
#' \item{"compact":}{Boolean. Default value is TRUE if you ask for the matrices to be transposed to have a more compact view}
#' \item{"legend": }{Boolean. Set TRUE if you want to see the legend. Default value is FALSE}
#' \item{"legend.title": }{Boolean. Set TRUE if you want to print the title of the legend. Default value is FALSE}
#' \item{"legend.position": }{Position of the legend. Possible values are 'bottom', 'top','left,'right'. Default value is 'bottom'}
#' \item{"nodeNames": }{Set true if the node Names must be plotted. Default value is FALSE}
#' \item{"line.color":}{The color of the lines to separate groups. Default value is red}
#' \item{"line.width":}{Width of the lines to separate groups. Default value is NULL, automatically chosen}
#' \item{"title": }{Title of the plot. Default value is NULL}
#' }
#' * "normalized": Boolean. TRUE if the various matrices are presented in the same scale (between O and 1). FALSE otherwise. Default value FALSE
#' * "compact": Boolean. Default value is TRUE if you ask for the matrices to be transposed to have a more compact view
#' * "legend": Boolean. Set TRUE if you want to see the legend. Default value is FALSE
#' * "legend.title": Boolean. Set TRUE if you want to print the title of the legend. Default value is FALSE
#' * "legend.position": Position of the legend. Possible values are 'bottom', 'top','left,'right'. Default value is 'bottom'
#' * "nodeNames": Set true if the node Names must be plotted. Default value is FALSE
#' * "line.color": The color of the lines to separate groups. Default value is red
#' * "line.width": Width of the lines to separate groups. Default value is NULL, automatically chosen
#' * "title": Title of the plot. Default value is NULL
#'
#' @return a ggplot object corresponding to the plot
#' @export
#'
Expand Down
21 changes: 10 additions & 11 deletions R/plotMyMultiplexMatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
#' @param memberships : a list of length equal to the number of Functional Groups providing the clusterings inside each group.
#' @param plotOptions : a list containing the options. See details.
#' @details plotOptions is a list containing the following items
#' \itemize{
#' \item{"normalized":}{Boolean. TRUE if the various matrices are presented in the same scale (between O and 1). FALSE otherwise. Default value FALSE}
#' \item{"compact":}{Boolean. Default value is TRUE if you ask for the matrices to be transposed to have a more compact view}
#' \item{"legend": }{Boolean. Set TRUE if you want to see the legend. Default value is FALSE}
#' \item{"legend.title": }{Boolean. Set TRUE if you want to print the title of the legend. Default value is FALSE}
#' \item{"legend.position": }{Position of the legend. Possible values are 'bottom', 'top','left,'right'. Default value is 'bottom'}
#' \item{"nodeNames": }{Set true if the node Names must be plotted. Default value is FALSE}
#' \item{"line.color":}{The color of the lines to separate groups. Default value is red}
#' \item{"line.width":}{Width of the lines to separate groups. Default value is NULL, automatically chosen}
#' \item{"title": }{Title of the plot. Default value is NULL}
#' }
#' * "normalized": Boolean. TRUE if the various matrices are presented in the same scale (between O and 1). FALSE otherwise. Default value FALSE
#' * "compact": Boolean. Default value is TRUE if you ask for the matrices to be transposed to have a more compact view
#' * "legend": Boolean. Set TRUE if you want to see the legend. Default value is FALSE
#' * "legend.title": Boolean. Set TRUE if you want to print the title of the legend. Default value is FALSE
#' * "legend.position": Position of the legend. Possible values are 'bottom', 'top','left,'right'. Default value is 'bottom'
#' * "nodeNames": Set true if the node Names must be plotted. Default value is FALSE
#' * "line.color": The color of the lines to separate groups. Default value is red
#' * "line.width": Width of the lines to separate groups. Default value is NULL, automatically chosen
#' * "title": Title of the plot. Default value is NULL
#'
#' @return a ggplot object corresponding to the plot
#' @export
#'
Expand Down
Loading

0 comments on commit 9579bd8

Please sign in to comment.