diff --git a/README.Rmd b/README.Rmd index fc2a6ca..bf56e20 100644 --- a/README.Rmd +++ b/README.Rmd @@ -78,16 +78,15 @@ Geometrically, the Vietoris complex is constructed based on balls of fixed radiu library(ggtda) # visualize disks of fixed radii and the Vietoris complex for this proximity p_d <- ggplot(d, aes(x = x, y = y)) + - theme_bw() + coord_fixed() + - stat_disk(radius = prox/2, fill = "aquamarine3") + - geom_point() + geom_disk(radius = prox/2, fill = "aquamarine3") + + geom_point() + + theme_bw() p_sc <- ggplot(d, aes(x = x, y = y)) + - theme_bw() + coord_fixed() + - stat_vietoris2(diameter = prox, fill = "darkgoldenrod") + - stat_vietoris1(diameter = prox, alpha = .25) + - stat_vietoris0() + stat_simplicial_complex(diameter = prox, fill = "darkgoldenrod") + + theme_bw() + + theme(legend.position = "none") # combine the plots gridExtra::grid.arrange( p_d, p_sc, @@ -101,21 +100,21 @@ We can visualize the persistence data using a barcode (left) and a flat persiste # visualize the persistence data, indicating cutoffs at this proximity p_bc <- ggplot(ph, aes(start = birth, end = death, colour = dim)) + - theme_barcode() + - geom_barcode(size = 1) + + geom_barcode(linewidth = 1) + labs(x = "Diameter", y = "Homological features") + - geom_vline(xintercept = prox, color = "darkgoldenrod", linetype = "dashed") + geom_vline(xintercept = prox, color = "darkgoldenrod", linetype = "dashed") + + theme_barcode() max_prox <- max(ph$death) p_pd <- ggplot(ph) + - theme_persist() + coord_fixed() + stat_persistence(aes(start = birth, end = death, colour = dim, shape = dim)) + - geom_diagonal() + + geom_abline(slope = 1) + labs(x = "Birth", y = "Death") + lims(x = c(0, max_prox), y = c(0, max_prox)) + geom_fundamental_box(t = prox, color = "darkgoldenrod", fill = "darkgoldenrod", - linetype = "dashed") + linetype = "dashed") + + theme_persist() # combine the plots gridExtra::grid.arrange( p_bc, p_pd, diff --git a/README.md b/README.md index fea2d54..ad67c43 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ d <- data.frame( ) # compute the persistent homology ph <- as.data.frame(ripserr::vietoris_rips(as.matrix(d), dim = 1)) +#> Warning in vietoris_rips.matrix(as.matrix(d), dim = 1): `dim` parameter has +#> been deprecated; use `max_dim` instead. print(head(ph, n = 12)) #> dimension birth death #> 1 0 0 0.02903148 @@ -99,24 +101,25 @@ pair of which are within `prox` of each other. ``` r # attach *ggtda* library(ggtda) +#> Loading required package: rlang #> Loading required package: ggplot2 # visualize disks of fixed radii and the Vietoris complex for this proximity p_d <- ggplot(d, aes(x = x, y = y)) + - theme_bw() + coord_fixed() + - stat_disk(radius = prox/2, fill = "aquamarine3") + - geom_point() + geom_disk(radius = prox/2, fill = "aquamarine3") + + geom_point() + + theme_bw() p_sc <- ggplot(d, aes(x = x, y = y)) + - theme_bw() + coord_fixed() + - stat_vietoris2(diameter = prox, fill = "darkgoldenrod") + - stat_vietoris1(diameter = prox, alpha = .25) + - stat_vietoris0() + stat_simplicial_complex(diameter = prox, fill = "darkgoldenrod") + + theme_bw() + + theme(legend.position = "none") # combine the plots gridExtra::grid.arrange( p_d, p_sc, layout_matrix = matrix(c(1, 2), nrow = 1) ) +#> Warning: Using alpha for a discrete variable is not advised. ``` @@ -131,21 +134,21 @@ are detectable at this cutoff. # visualize the persistence data, indicating cutoffs at this proximity p_bc <- ggplot(ph, aes(start = birth, end = death, colour = dim)) + - theme_barcode() + - geom_barcode(size = 1) + + geom_barcode(linewidth = 1) + labs(x = "Diameter", y = "Homological features") + - geom_vline(xintercept = prox, color = "darkgoldenrod", linetype = "dashed") + geom_vline(xintercept = prox, color = "darkgoldenrod", linetype = "dashed") + + theme_barcode() max_prox <- max(ph$death) p_pd <- ggplot(ph) + - theme_persist() + coord_fixed() + stat_persistence(aes(start = birth, end = death, colour = dim, shape = dim)) + - geom_diagonal() + + geom_abline(slope = 1) + labs(x = "Birth", y = "Death") + lims(x = c(0, max_prox), y = c(0, max_prox)) + geom_fundamental_box(t = prox, color = "darkgoldenrod", fill = "darkgoldenrod", - linetype = "dashed") + linetype = "dashed") + + theme_persist() # combine the plots gridExtra::grid.arrange( p_bc, p_pd, diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index 86545af..7eb28d0 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -63,6 +63,7 @@

Contributor Covenant Code of Conduct

+

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

@@ -101,22 +102,22 @@

EnforcementEnforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

-

1. Correction

+

1. Correction

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

-

2. Warning

+

2. Warning

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

-

3. Temporary Ban

+

3. Temporary Ban

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

-

4. Permanent Ban

+

4. Permanent Ban

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index ca75572..7d4e537 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -63,6 +63,7 @@

Contributing to ggtda development

+

The goal of this guide is to help contributors to ggtda plan their contributions and navigate the process. The sections below cover different types of contributions, usually with increasing degrees of proposed change.

Note that ggtda is released with a Contributor Code of Conduct. By contributing, you agree to its terms.

This guide is adapted from the contributing guides for ggalluvial, which is loosely adapted from ggplot2 and rOpenSci. If you have questions about or suggestions for this guide, please feel free to contact a package maintainer.

diff --git a/docs/index.html b/docs/index.html index 05e4855..dbffb5b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -127,6 +127,8 @@

Example) # compute the persistent homology ph <- as.data.frame(ripserr::vietoris_rips(as.matrix(d), dim = 1)) +#> Warning in vietoris_rips.matrix(as.matrix(d), dim = 1): `dim` parameter has +#> been deprecated; use `max_dim` instead. print(head(ph, n = 12)) #> dimension birth death #> 1 0 0 0.02903148 @@ -150,45 +152,46 @@

Example
 # attach *ggtda*
 library(ggtda)
+#> Loading required package: rlang
 #> Loading required package: ggplot2
 # visualize disks of fixed radii and the Vietoris complex for this proximity
 p_d <- ggplot(d, aes(x = x, y = y)) +
-  theme_bw() +
   coord_fixed() +
-  stat_disk(radius = prox/2, fill = "aquamarine3") +
-  geom_point()
+  geom_disk(radius = prox/2, fill = "aquamarine3") +
+  geom_point() +
+  theme_bw()
 p_sc <- ggplot(d, aes(x = x, y = y)) +
-  theme_bw() +
   coord_fixed() +
-  stat_vietoris2(diameter = prox, fill = "darkgoldenrod") +
-  stat_vietoris1(diameter = prox, alpha = .25) +
-  stat_vietoris0()
+  stat_simplicial_complex(diameter = prox, fill = "darkgoldenrod") +
+  theme_bw() +
+  theme(legend.position = "none")
 # combine the plots
 gridExtra::grid.arrange(
   p_d, p_sc,
   layout_matrix = matrix(c(1, 2), nrow = 1)
-)

+) +#> Warning: Using alpha for a discrete variable is not advised.

We can visualize the persistence data using a barcode (left) and a flat persistence diagram (right). In the barcode plot, the dashed line indicates the cutoff at the proximity prox (= 0.6666667); in the persistence diagram plot, the fundamental box contains the features that are detectable at this cutoff.

 # visualize the persistence data, indicating cutoffs at this proximity
 p_bc <- ggplot(ph,
                aes(start = birth, end = death, colour = dim)) +
-  theme_barcode() +
-  geom_barcode(size = 1) +
+  geom_barcode(linewidth = 1) +
   labs(x = "Diameter", y = "Homological features") +
-  geom_vline(xintercept = prox, color = "darkgoldenrod", linetype = "dashed")
+  geom_vline(xintercept = prox, color = "darkgoldenrod", linetype = "dashed") +
+  theme_barcode()
 max_prox <- max(ph$death)
 p_pd <- ggplot(ph) +
-  theme_persist() +
   coord_fixed() +
   stat_persistence(aes(start = birth, end = death, colour = dim, shape = dim)) +
-  geom_diagonal() +
+  geom_abline(slope = 1) +
   labs(x = "Birth", y = "Death") +
   lims(x = c(0, max_prox), y = c(0, max_prox)) +
   geom_fundamental_box(t = prox,
                        color = "darkgoldenrod", fill = "darkgoldenrod",
-                       linetype = "dashed")
+                       linetype = "dashed") +
+  theme_persist()
 # combine the plots
 gridExtra::grid.arrange(
   p_bc, p_pd,
diff --git a/docs/reference/figures/README-unnamed-chunk-3-1.png b/docs/reference/figures/README-unnamed-chunk-3-1.png
index 720ce34..377bd1d 100644
Binary files a/docs/reference/figures/README-unnamed-chunk-3-1.png and b/docs/reference/figures/README-unnamed-chunk-3-1.png differ
diff --git a/docs/reference/figures/README-unnamed-chunk-4-1.png b/docs/reference/figures/README-unnamed-chunk-4-1.png
index 58ad731..90a137e 100644
Binary files a/docs/reference/figures/README-unnamed-chunk-4-1.png and b/docs/reference/figures/README-unnamed-chunk-4-1.png differ
diff --git a/man/figures/README-unnamed-chunk-3-1.png b/man/figures/README-unnamed-chunk-3-1.png
index 720ce34..377bd1d 100644
Binary files a/man/figures/README-unnamed-chunk-3-1.png and b/man/figures/README-unnamed-chunk-3-1.png differ
diff --git a/man/figures/README-unnamed-chunk-4-1.png b/man/figures/README-unnamed-chunk-4-1.png
index 58ad731..90a137e 100644
Binary files a/man/figures/README-unnamed-chunk-4-1.png and b/man/figures/README-unnamed-chunk-4-1.png differ