Skip to content

Feature: improvements and refactors to p2p functions#41

Merged
m-m-powers merged 11 commits into
mainfrom
feature/p2p-refactor
Jan 15, 2021
Merged

Feature: improvements and refactors to p2p functions#41
m-m-powers merged 11 commits into
mainfrom
feature/p2p-refactor

Conversation

@martinctc

@martinctc martinctc commented Jan 11, 2021

Copy link
Copy Markdown
Member

Summary

This branch introduces some improvements to existing p2p-related functions, including refactoring the existing network_p2p().

Changes

The changes made in this PR are:

  1. Added p2p_data_sim() as a function for simulating person-to-person query data.
  2. Added the ability of network_p2p() to perform community detection (Refactor: simplify API so that network_p2p() can handle community detection #38). This now supersedes network_leiden() and network_louvain().
  3. Changed the return of network_describe() - now percentages reflect the % of the Community is represented by line description. Also summaryTable now reflects the top rows of all attribute combinations. (Enhancement: improve output of the "describe" function  #45)

New API for network_p2p

  1. Implement community detection from a single function:
    The display argument allows three valid values: hrvar, leiden, or louvain. The last two methods will implement community detection, whereas hrvar simply return outputs that are very similar to the original network_p2p() function.

  2. Handling corner cases:
    There are two return options where hrvar will not be able to return anything: return = "sankey" and return = "describe". The function currently returns a message informing the user that they should choose a community detection method using the display argument.

  3. Plotting from console instead of saving as PDF:
    Users can now choose to plot in console by setting the path argument to NULL.

  4. Two options for plotting methods:
    It is now possible to coerce the function use the faster plotting method (with igraph) or the higher quality but less scalable plotting method (with ggraph), using the size_threshold argument. Users can set as size_threshold to 0 to coerce to a fast plotting method every time, and Inf to always use the default plotting method.

  5. Smart path return:
    At the moment, there is a path return for the three functions, with different defaults. There should be a smart path return capability where the default file name returned provides the most useful information, e.g. community detection method, time stamp, size, etc.

Check

  • All R CMD checks pass

(OPTIONAL) Note

This fixes #38, #43, and #45.

New method for simulating p2p data
@martinctc martinctc added enhancement New feature or request refactor Code that neither fixes a bug nor changes feature labels Jan 11, 2021
@martinctc martinctc self-assigned this Jan 11, 2021
Major breaking changes to `network_p2p()` so that it is also capable of performing community detection. This will supersede `network_leiden()` and `network_louvain()`.
@martinctc martinctc marked this pull request as ready for review January 13, 2021 00:26
@martinctc martinctc mentioned this pull request Jan 13, 2021
For this to be more informative on what is actually being run
Undocumented arguments
All rows are released, instead of just keeping the first row per permutation.
The updated summary table shows the top values of each combination of attribute, with three rows shown per community.
@m-m-powers m-m-powers merged commit e78ce46 into main Jan 15, 2021
@m-m-powers m-m-powers deleted the feature/p2p-refactor branch January 15, 2021 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor Code that neither fixes a bug nor changes feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: "plot-hrvar" returns a pdf instead of a graph for network_louvain() Refactor: simplify API so that network_p2p() can handle community detection

2 participants