# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' compute observed excess transitivity
#'
#' assumes that link observations are ordered canonically a
#'
#' @param df data frame with link data (ordered canonically)
#' @param y_variable string that contains name of column that stores link indicator
#' @param p_variable string that contains name of column that stores link probability
#'
#' @return number of expected transitive triangles
excess_trans <- function(df, y_variable, p_variable) {
.Call('_netprobitFE_excess_trans', PACKAGE = 'netprobitFE', df, y_variable, p_variable)
}
#' use C++ class LinkVariable to establish link to R data frame
#'
#' this function is mainly for testing to see if the link is
#' established correctly
#'
#' @param df data frame with link data (ordered canonically)
#' @param i Sender index
#' @param j Receiver index
#' @param var_name name of variabe in data frame
#'
#' @return var_name at i, j
#' @export
read_link_data <- function(df, i, j, var_name) {
.Call('_netprobitFE_read_link_data', PACKAGE = 'netprobitFE', df, i, j, var_name)
}
#' Detect number of transitive relationships closed by this link
#'
#' assumes that link observations are ordered canonically a
#'
#' @param df data frame with link data (ordered canonically)
#' @param y_variable string that contains name of column that stores link indicator
#' @export
#' @return number of supporting transitive triangles for this link
num_trans_closures <- function(df, y_variable) {
.Call('_netprobitFE_num_trans_closures', PACKAGE = 'netprobitFE', df, y_variable)
}
#' Detect number of triangles that this link is a part of
#'
#' assumes that link observations are ordered canonically a
#'
#' @param df data frame with link data (ordered canonically)
#' @param y_variable string that contains name of column that stores link indicator
#' @export
#' @return number of supporting transitive triangles for this link
num_in_triangles <- function(df, y_variable) {
.Call('_netprobitFE_num_in_triangles', PACKAGE = 'netprobitFE', df, y_variable)
}
#' add new link variables that are required for bias correction
#'
#' assumes that link observations are ordered canonically and
#' that data frame contains the variables "p", "H", "partial_p"
#'
#' @param df data frame with link data (ordered canonically)
#'
#' @return data frame with new variables
triangles_biascorr_new_vars <- function(df) {
.Call('_netprobitFE_triangles_biascorr_new_vars', PACKAGE = 'netprobitFE', df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.