Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 4 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.1%) to scientific vocabulary
Last synced: 11 months ago
·
JSON representation
Repository
Phase Portraits of Complex Valued Functions
Basic Info
- Host: GitHub
- Owner: PeterBiber
- License: gpl-3.0
- Language: R
- Default Branch: master
- Size: 93.2 MB
Statistics
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 3
Created over 6 years ago
· Last pushed over 1 year ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
bibliography: inst/REFERENCES.bib
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
# This option anti-aliases the plot made below under Windows
if(Sys.info()[["sysname"]] == "Windows")
knitr::opts_chunk$set(dev.args = list(type = "cairo"))
```
# viscomplexr
[](https://github.com/PeterBiber/viscomplexr/actions/workflows/check-standard.yaml)
[](https://cran.r-project.org/package=viscomplexr)
[](https://cran.r-project.org/package=viscomplexr)
[](https://app.codecov.io/gh/PeterBiber/viscomplexr?branch=master)
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
```{r banner, eval=FALSE, echo=FALSE, fig.width=9, fig.height=3.6, results='hide', fig.align='center', fig.show='hold', cache=TRUE}
# Make a phase portrait of the function
# f(z) = sin(z^3/(z - 1i + 2))
# in the domain [-6, 6] (real), and [-2.4, 2.4] (imaginary)
library(viscomplexr)
# reduce plot margin to 0, store previous graphics parameter settings in op
op <- par(mar = c(0, 0, 0, 0))
# call the function phasePortrait
phasePortrait("sin(z^3/(z - 1i + 2))", # define the function
xlim = c(-6, 6), ylim = c(-2.4, 2.4), # define the domain
axes = FALSE, # suppress axes
xaxs = "i", yaxs = "i") # no empty zone around plot
# set graphics parameters to previous values
par(op)
```
```{r, echo=FALSE}
banner_path <- "man/figures/README-banner-1.png"
knitr::include_graphics(banner_path)
```
With *viscomplexr* you can create phase portraits of functions on the complex number plane. While the main purpose of this package are scientific, educational and technical applications, the sheer beauty of phase portraits may be motivation enough to explore the fascinating realm of complex functions. The package is embedded in the framework of R base graphics and allows for print quality graphics files. To a great deal, *viscomplexr* follows the conventions published by @wegert_visualcpx_2012. Since version 1.1.0, the package also allows for plots based on polar chessboards.
For a detailed step-by-step introduction see the package's vignette. After installing *viscomplexr* on your machine, you can view the vignette by calling:
``` r
vignette("viscomplexr-vignette")
```
Besides making you acquainted with how to work with the package, the vignette also tells you more about some shenanigans going on behind the scenes; among them parallel processing and *viscomplexr*'s temporary file system. Due to CRAN size restrictions, the number of illustrations in the vignette is kept to a minimum. Visit the [package's website](https://peterbiber.github.io/viscomplexr/) for a [richly illustrated version of the vignette](https://peterbiber.github.io/viscomplexr/articles/viscomplexr-vignette_for_website.html).
## Installation
In order to work with viscomplexr you require an installation of R (version >= 4.2) on your system. The installation files for R itself are available [here](https://cran.r-project.org/). The released version of *viscomplexr* can be installed from [CRAN](https://CRAN.R-project.org/package=viscomplexr) with:
``` r
install.packages("viscomplexr")
```
And the development version from [GitHub](https://github.com/PeterBiber/viscomplexr) with:
``` r
# install.packages("devtools")
devtools::install_github("PeterBiber/viscomplexr")
```
## Example
Let's plot a phase portrait of the function `f(z)=sin(z^3/(z-1i+2))`. This function is portrayed in the banner above, and the code below produces exactly that banner. The workhorse function of *viscomplexr* is called `phasePortrait`, and besides its specific input variables, it also accepts all parameters that are accepted by R's `plot.default` function, like `axes`, `xaxs`, and `yaxs` in the example below. Other often useful ones are `main`, `xlab`, and `ylab`, especially for scientific, technical or educational applications.
```{r example, eval=FALSE}
# Make a phase portrait of the function
# f(z) = sin(z^3/(z - 1i + 2))
# in the domain [-6, 6] (real), and [-2.4, 2.4] (imaginary)
library(viscomplexr)
# You can open any R graphics device here (bmp, jpeg, png, tiff, pdf,
# windows, x11, ...), see R documentation if you are not familiar with these.
# This example, as it is, plots into the default graphics device.
# reduce plot margin to 0, store previous graphics parameter settings in op
op <- par(mar = c(0, 0, 0, 0))
# call the function phasePortrait
phasePortrait("sin(z^3/(z - 1i + 2))", # define the function
xlim = c(-6, 6), ylim = c(-2.4, 2.4), # define the domain
axes = FALSE, # suppress axes
xaxs = "i", yaxs = "i") # no empty zone around plot
# set graphics parameters to previous values
par(op)
# If you have initially opened a graphics device that plots into a file, you
# must close it here with
# dev.off()
```
While there are many options and a few useful supporting functions (see vignette and documentation), this example shows the core way of plotting phase portraits. It could even be reduced to just the function to be portrayed (here provided as a character string) and the parameters `xlim` and `ylim`. The other parameters in the example, and also the omission of the plot margins before calling *phasePortrait*, were only used in order to obtain a pretty banner for this README.
## Acknowledgments
While this package is a leisure project, it would have been a mission impossible without the background of my (P.B.) daily work with R as a Forest Scientist at the Technical University of Munich (TUM). Fortunately, I have a job that allows me to learn about Nature by asking her questions (or trying to simulate what she is doing) with ever-improving methods and tools. I would like to thank everyone at the Chair of Forest Growth and Yield Science at TUM who keep me involved in discussions like: *How can this be solved in R ...*
```{r, eval=FALSE}
switch(1 + trunc(runif(1, 0, 6)),
"... at all?",
"... in a quick-and-dirty way?",
"... in Hadley-Wickham-style?",
"... without a loop?",
"... without nested loops?",
"... in a way somebody can understand?")
```
**Veronika Biber** provided expert advice for improving the vignette. **Johannes Biber** turned out the most patient pre-release tester one can imagine, boosting things with his high-end gaming machine. Thanks, guys! Also thanks to **Gregor Seyer** for his helpful review of the CRAN submission.
Clearly, programming in R would not be what it is, weren't there some R titans who generously share their knowledge online. While I keep learning from all of them, I would like to thank especially **Hadley Wickham** and **Dirk Eddelbüttel**.
## References
Owner
- Name: Peter Biber
- Login: PeterBiber
- Kind: user
- Repositories: 2
- Profile: https://github.com/PeterBiber
Forest scientist at TU München, R enthusiast, modeling addict, flyfisher, author of crazy fiction, sometimes bassist
GitHub Events
Total
- Release event: 1
- Delete event: 1
- Push event: 12
- Create event: 2
Last Year
- Release event: 1
- Delete event: 1
- Push event: 12
- Create event: 2
Committers
Last synced: almost 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| PeterBiber | c****r@g****e | 226 |
| Peter Biber | 6****r | 5 |
| Verenike | v****e@g****e | 4 |
| Peter Biber | p****r@t****e | 2 |
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 33
- Total pull requests: 0
- Average time to close issues: 4 days
- Average time to close pull requests: N/A
- Total issue authors: 2
- Total pull request authors: 0
- Average comments per issue: 0.21
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- PeterBiber (32)
- Verenike (1)
Pull Request Authors
Top Labels
Issue Labels
documentation (11)
enhancement (7)
bug (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 202 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 4
- Total maintainers: 1
cran.r-project.org: viscomplexr
Phase Portraits of Functions in the Complex Number Plane
- Homepage: https://peterbiber.github.io/viscomplexr/
- Documentation: http://cran.r-project.org/web/packages/viscomplexr/viscomplexr.pdf
- License: GPL-3
-
Latest release: 1.1.2
published over 1 year ago
Rankings
Stargazers count: 26.2%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 41.4%
Downloads: 87.0%
Maintainers (1)
Last synced:
12 months ago
Dependencies
DESCRIPTION
cran
- R >= 4.0 depends
- Rcpp * imports
- Rdpack * imports
- doParallel >= 1.0.15 imports
- foreach * imports
- grDevices * imports
- parallel * imports
- plotrix * imports
- scales * imports
- Cairo * suggests
- covr * suggests
- knitr * suggests
- pracma * suggests
- rmarkdown * suggests
- testthat >= 2.1.0 suggests
.github/workflows/check-standard.yaml
actions
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml
actions
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite