Skip to content

Commit

Permalink
Initial deployment of the code
Browse files Browse the repository at this point in the history
Still only a few distributions are implemented, more to come ...
  • Loading branch information
idinov authored Jul 20, 2020
1 parent d3cf947 commit 56f3bd1
Show file tree
Hide file tree
Showing 4 changed files with 696 additions and 0 deletions.
44 changes: 44 additions & 0 deletions code/SOCR_footer_tracker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<p>
<center>
<a href="https://www.socr.umich.edu/">SOCR Resource</a>
Visitor number
<!-- img src="http://counter.digits.net/?counter=SOCR"
align="middle" border="0" height="20" hspace="4" vspace="2" width="60" -->

<img class="statcounter" src="https://c.statcounter.com/5714596/0/038e9ac4/0/" alt="Web Analytics" align="middle" border="0">

<script type="text/javascript">
var d = new Date();
document.write(" | " + d.getFullYear() + " | ");
</script>
<a href="http://www.socr.umich.edu/img/SOCR_Email.png"><img alt="SOCR Email"
title="SOCR Email" src="http://www.socr.umich.edu/img/SOCR_Email.png"
style="border: 0px solid ;"></a>
</center>


<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project = 5714596;
var sc_invisible = 1;
var sc_partition = 71;
var sc_click_stat = 1;
var sc_security = "038e9ac4";
</script>

<script type="text/javascript"
src="https://www.statcounter.com/counter/counter.js"></script>
<!-- End of StatCounter Code -->

<!-- GoogleAnalytics -->
<script src="https://www.google-analytics.com/urchin.js"
type="text/javascript">
</script>

<script type="text/javascript">
_uacct = "UA-676559-1";
urchinTracker();
</script>
<!-- End of GoogleAnalytics Code -->

</p>
118 changes: 118 additions & 0 deletions code/global.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#SOCR Probability Distribution Calculator
#Version 0.4
#Updated July 19th 2020 by Jared (Tianyi) Chai at the University of Michigan -SOCR

# This is a SOCR Interactive Graphical Probability Distribution Calculator
# You can run the application by clicking
# the 'Run App' button above.

# ----------------------- Global.R ----------------------- #
#For Retrieving and Storing Global Variables
library(xml2)
library(shiny)
library(plotly)
library(stringr)
library("Rlab")
library("shinyWidgets")

# ----------------------- Parse and Store XML Databse of Metadata from Distributome Project ----------------------- #
XML_data <- read_xml("http://www.distributome.org/js/Distributome.xml",encoding = "UTF-8",as_html=FALSE,options = c("RECOVER", "NOERROR", "NOBLANKS"))
XML_rootnode <- xml_root(XML_data)
XML_distributions <- xml_children(xml_child(XML_rootnode))
XML_len <- length(XML_distributions)
XML_wid = 0
XML_tags <- c()
for (i in 1:XML_len){
XML_i <-xml_contents(XML_distributions[[i]])
width <- length(XML_i)
if(width > XML_wid){
XML_wid = width
XML_tags = xml_name(XML_i)
}
}
distributions_meta <- matrix("",XML_wid,XML_len*2)
for (i in 1:XML_len){
XML_i <-xml_contents(XML_distributions[[i]])
width <- length(XML_i)
for (j in 1:width){
distributions_meta[[j,i*2-1]]<-xml_name(XML_i[j])
distributions_meta[[j,i*2]]<-xml_text(XML_i[j])
}
}

# ----------------------- Complete List of All Probability Distributions ----------------------- #
distributions <- c("Anderson-Darling Distribution",
"ArcSine Distribution",
"Benford Distribution",
"Bernoulli Distribution",
"Beta Distribution",
"Beta (Generalized) Distribution",
"Beta-Binomial Distribution",
"Binomial Distribution",
"Birthday Distribution",
"(3D) Bivariate Normal Distribution",
"Cauchy Distribution",
"Chi Distribution",
"Chi-Square Distribution",
"(Non-Central) Chi-Squre Distribution",
"Circle Distribution",
"Continous Uniform Distribution",
"Coupon Distribution",
"Die Distribution",
"Discrete ArcSine Distribution",
"Discrete Uniform Distribution",
"Erlang Distribution",
"Error Distribution",
"Exponential Distribution",
"Finite Distribution",
"Fisher's F Distribution",
"Fisher-Tippett Distribution",
"Gamma Distribution",
"General Cauchy Distribution",
"Generalized Extreme Value (GEV) Distribution",
"Geometric Distribution",
"Gilbrats Distribution",
"Gompertz Distribution",
"Gumbel Distribution",
"Half-Normal Distribution",
"Hyper Geometric Distribution",
"Hyperbolic-Secant Distribution",
"Inverse-Gamma Distribution",
"Inverse Gaussian (Wald) Distribution",
"Johnson SB (Bounded) Distribution",
"Johnson SU (Unbounded) Distribution",
"Kolmogorov Distribution",
"Laplace Distribution",
"Logarithmic-Series Distribution",
"Logistic Distribution",
"Logistic-Exponential Distribution",
"Log-Normal Distribution",
"Lomax Distribution",
"Matching Distribution",
"Maxwell Distribution",
"Minimax Distribution",
"Mixture Distribution",
"Multinomial Distribution",
"Muth Distribution",
"Negative-Binomial Distribution",
"Negative-HyperGeometric Distribution",
"Negative-Multinomial Distribution",
"Normal Distribution",
"Normal Truncated Distribution",
"Pareto Distribution",
"Point-Mass Distribution",
"Poisson Distribution",
"Poker-Dice Distribution",
"Power-Function Distribution",
"Rayleigh Distribution",
"Rice (Rician) Distribution",
"Student's T Distribution",
"Student's T Non-Central Distribution",
"Triangle Distribution",
"Two-Sided Power Distribution",
"U-Quadratic Distribution",
"Von Mises Distribution",
"WalkMax Distribution",
"WalkPosition Distribution",
"Weibull Distribution",
"Zipf-Manelbrot Distribution")
Loading

0 comments on commit 56f3bd1

Please sign in to comment.