simplexity

Hopefully taking out the complexity of using the simplex: functions to generate, manipulate and plot data on the simplex

https://github.com/tystan/simplexity

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.3%) to scientific vocabulary

Keywords

compositional-data plotting r simplex
Last synced: 6 months ago · JSON representation ·

Repository

Hopefully taking out the complexity of using the simplex: functions to generate, manipulate and plot data on the simplex

Basic Info
  • Host: GitHub
  • Owner: tystan
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 544 KB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
compositional-data plotting r simplex
Created over 5 years ago · Last pushed about 1 year ago
Metadata Files
Readme Citation

README.md

simplexity package

DOI

Hopefully taking out the complexity of using the simplex.

The simplexity package contains functions to generate, manipulate and plot data on the simplex

Getting started

Installation

(platform independent) If you have devtools installed you can use: r library(devtools) # see https://www.r-project.org/nosvn/pandoc/devtools.html devtools::install_github('tystan/simplexity') # see DESCRIPTION file for required and suggested packages

If you don't have devtools installed but are using Windows, you can download and install the below zip file:

simplexity_0.2.0.zip

Loading and using simplexity

```r library(simplexity)

now package loaded, see help file to run example

?mksimplexgrid

or create an example 4-simplex plot

example("plotfourcomp", package = "simplexity") ```

Example usage

```r

create a grid of evenly spaced simplex values

number of cores = 1 faster for small computations

remove observations that are on the edge of the simplex (rm_edges = TRUE)

grid4simplex <- mksimplexgrid(4, 0.2, nc = 1, rmedges = TRUE) colnames(grid4simplex) <- paste0("comp", 1:ncol(grid4simplex)) grid_4simplex

comp1 comp2 comp3 comp4

[1,] 0.2 0.2 0.2 0.4

[2,] 0.2 0.2 0.4 0.2

[3,] 0.2 0.4 0.2 0.2

[4,] 0.4 0.2 0.2 0.2

simulate a fictitious response variable based on 4-simplex ilrs

y <- simplextoilr(grid_4simplex) %*% matrix(c(-1, 1, 0.5), ncol = 1) colnames(y) <- "outcome"

outcome

[1,] -0.3279463

[2,] 0.1621827

[3,] 0.7660467

[4,] -0.6002831

add the response variable to the simplex data for plotting

grid4simplex <- as.data.frame(cbind(y, grid4simplex))

this is an interactive/movable plotly 3D scatterplot

plotfourcomp(grid_4simplex, "comp1", "comp2", "comp3", "comp4", col = "outcome")

```

Owner

  • Name: Ty Stanford
  • Login: tystan
  • Kind: user
  • Location: Adelaide, Australia

(Bio)statistician

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: simplexity
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Ty
    family-names: Stanford
    email: tystan@gmail.com
    orcid: 'https://orcid.org/0000-0002-8570-5493'
identifiers:
  - type: doi
    value: 10.5281/zenodo.7943409
    description: v0.1.1
repository-code: 'https://github.com/tystan/simplexity'
abstract: >-
  Hopefully taking out the complexity of using the simplex -
  functions to generate, manipulate and plot data on the
  simplex 
keywords:
  - 'compositional-data'
  - simplex
  - plotting
  - R
license: GPL-2.0
commit: e6043c6
version: v0.1.1
date-released: '2023-05-17'

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Push event: 3
  • Create event: 1
Last Year
  • Release event: 1
  • Watch event: 1
  • Push event: 3
  • Create event: 1

Dependencies

DESCRIPTION cran
  • GGally * imports
  • ParallelLogger * imports
  • doParallel * imports
  • dplyr * imports
  • foreach * imports
  • gMOIP * imports
  • geometry * imports
  • ggplot2 * imports
  • parallel * imports
  • plotly * imports
  • purrr * imports
  • viridisLite * imports
  • deltacomp * suggests
  • testthat * suggests