{"id":16578434,"url":"https://github.com/schochastics/levelnet","last_synced_at":"2025-07-23T09:34:25.187Z","repository":{"id":123114966,"uuid":"179497697","full_name":"schochastics/levelnet","owner":"schochastics","description":"R package to analyze two-mode networks","archived":false,"fork":false,"pushed_at":"2023-01-25T07:52:32.000Z","size":1809,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-15T07:31:49.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schochastics.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-04-04T12:57:47.000Z","updated_at":"2023-01-25T07:53:53.000Z","dependencies_parsed_at":"2024-01-03T05:05:23.284Z","dependency_job_id":"e52071a3-5a0d-4126-a0f3-594988f1b0cb","html_url":"https://github.com/schochastics/levelnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/schochastics/levelnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schochastics%2Flevelnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schochastics%2Flevelnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schochastics%2Flevelnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schochastics%2Flevelnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schochastics","download_url":"https://codeload.github.com/schochastics/levelnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schochastics%2Flevelnet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266655357,"owners_count":23963553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T22:14:25.318Z","updated_at":"2025-07-23T09:34:24.858Z","avatar_url":"https://github.com/schochastics.png","language":"R","funding_links":[],"categories":["Software"],"sub_categories":["R"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# levelnet\n [![R-CMD-check](https://github.com/schochastics/levelnet/workflows/R-CMD-check/badge.svg)](https://github.com/schochastics/levelnet/actions)\n[![CRAN status](https://www.r-pkg.org/badges/version/levelnet)](https://CRAN.R-project.org/package=levelnet)\n\n~~levelnet is, so far, an early-stage R package that can be used to analyse two-mode networks and\nspecifically their one-mode projection. The main purpose is to make several methods available that\nextract the *binary backbone* of a one-mode projection.~~ The package is, at the moment superseded by the\n[backbone](https://cran.r-project.org/web/packages/backbone/index.html) package. The only feature not implemented in {{backbone}} is the use of the scobit model in the *stochastic degree sequence model* (SDSM) by Z. Neal ([link](https://www.sciencedirect.com/science/article/pii/S0378873314000343)). More features will be added once the \nresearch is done `r emo::ji(\"poo\")`. \n\n## Installation\n\nYou can install the developers version of levelnet with:\n\n```{r install, eval=FALSE}\n# install.packages(\"remotes\")\nremotes::install_github(\"schochastics/levelnet\")\n```\n\n## Example of `sdsm`\n\nThe package includes bill-cosponsorship data of the 115th Senate. Similar data was used in the\nPaper by Neal an in [follow up work](http://www.sciencedirect.com/science/article/pii/S0378873317303039). The function `bipartite_from_data_frame` can be used to turn the data frame into \na two-mode network (bipartite graph).\n\n```{r example,warning=FALSE,message=FALSE}\nlibrary(igraph)\nlibrary(levelnet)\ndata(\"cosponsor_senate_15\")\nhead(cosponsor_senate_15)\n\ng \u003c- bipartite_from_data_frame(cosponsor_senate_15,\"name\",\"bill\")\n```\n\nThe function `sdsm_diagnostic` checks the performance of several link functions.\n\n```{r diagnostics,warning=FALSE,eval=TRUE}\nparams \u003c- list(b0 = 1e-5,b1 = 1e-5,b2 = 1e-5,b3 = 1e-5,a = 0.8)\nsdsm_diagnostic(g,verbose = FALSE,params = params)\n```\n\nThe gradient function of the scobit model is very complicated and needs to be evaluated many times during the\noptimization process. This and the scobit function evaluation are the main bottleneck. \n\nAs was noted in the paper, the scobit model produces the best fit of the data.\n\n```{r fit,eval=FALSE}\nparams \u003c- list(b0 = 1e-5,b1 = 1e-5,b2 = 1e-5,b3 = 1e-5,a = 0.8)\nl \u003c- sdsm(g,proj = \"true\",model = \"scobit\",params = params)\n```\n\n\u003cimg src=\"man/figures/README-graph.png\" width=\"80%\" style=\"display: block; margin: auto;\"/\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschochastics%2Flevelnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschochastics%2Flevelnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschochastics%2Flevelnet/lists"}