{"id":24590898,"url":"https://github.com/blmoore/mandelbrot","last_synced_at":"2025-06-27T04:33:27.308Z","repository":{"id":152044610,"uuid":"94821490","full_name":"blmoore/mandelbrot","owner":"blmoore","description":"Mandelbrot set R package","archived":false,"fork":false,"pushed_at":"2017-07-22T09:37:15.000Z","size":11327,"stargazers_count":9,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T08:11:21.847Z","etag":null,"topics":["fractal","mandelbrot","r","rstats"],"latest_commit_sha":null,"homepage":"http://blm.io/mandelbrot/","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/blmoore.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-19T21:14:22.000Z","updated_at":"2020-10-11T11:34:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"24abf13f-2716-45ea-bfee-2887bf2338a2","html_url":"https://github.com/blmoore/mandelbrot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/blmoore/mandelbrot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blmoore%2Fmandelbrot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blmoore%2Fmandelbrot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blmoore%2Fmandelbrot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blmoore%2Fmandelbrot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blmoore","download_url":"https://codeload.github.com/blmoore/mandelbrot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blmoore%2Fmandelbrot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262188396,"owners_count":23272341,"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","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":["fractal","mandelbrot","r","rstats"],"created_at":"2025-01-24T09:26:43.821Z","updated_at":"2025-06-27T04:33:27.278Z","avatar_url":"https://github.com/blmoore.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"figs/README-\"\n)\n```\n\n```{r icon, echo=FALSE, fig.align='right', fig.width=2, fig.height=1.5, fig.path=\"figs/\", fig.show='hide'}\n# draw small readme icon\nlibrary(mandelbrot)\nmb \u003c- mandelbrot(xlim = c(-3, 1), c(-1.8, 1.8))\nold_par \u003c- par()\npar(bg = NA, mar=rep(0, 4))\nimage(mb, col = c(rgb(0, 0, 0, 0), \"grey80\"), axes = F)\npar \u003c- old_par\n```\n\u003cimg align=\"right\" src=\"figs/icon-1.png\" style=\"max-width: 300px\"\u003e\n\n# mandelbrot\n\n[![travis_status](https://travis-ci.org/blmoore/mandelbrot.svg?branch=master)](https://travis-ci.org/blmoore/mandelbrot)\n[![codecov](https://codecov.io/gh/blmoore/mandelbrot/branch/master/graph/badge.svg)](https://codecov.io/gh/blmoore/mandelbrot)\n[![CRAN_badge](http://www.r-pkg.org/badges/version/mandelbrot)](https://cran.r-project.org/package=mandelbrot)\n\nCurious whether your favourite complex number is a member\nof the Mandelbrot set? \n\n—No? Then probably you just want to draw pretty pictures.\n\n## Install\n\nInstall from CRAN:\n\n```{r cran_install, eval=FALSE}\ninstall.packages(\"mandelbrot\")\n```\n\nOr get the development version:\n\n```{r github_install, eval=FALSE}\ndevtools::install_github(\"blmoore/mandelbrot\")\n```\n\n## Examples\n\n```{r b_n_w}\nlibrary(mandelbrot)\n\nmb \u003c- mandelbrot()\nplot(mb)\n```\n\nPretty colours:\n```{r trip}\nmb \u003c- mandelbrot(xlim = c(-0.8438146, -0.8226294),\n                 ylim = c(0.1963144, 0.2174996), \n                 iterations = 500, resolution = 800)\n\ncols \u003c- mandelbrot_palette(RColorBrewer::brewer.pal(11, \"Spectral\"), fold = FALSE)\nplot(mb, col = cols)\n```\n\nExperiment with transforms:\n\n```{r trans, fig.height=3.5, fig.width=7}\npar(mfrow = c(1, 2), pty = \"s\", mar = rep(0, 4))\nplot(mb, col = cols, transform = \"inverse\")\nplot(mb, col = cols, transform = \"log\")\n```\n\n```{r reset_par, echo=FALSE}\npar \u003c- old_par\n```\n\nDon't like `image`? Convert to a `data.frame` and use with ggplot2:\n\n```{r ggplot}\nlibrary(ggplot2)\n\nmb \u003c- mandelbrot(xlim = c(-0.8335, -0.8325),\n                 ylim = c(0.205, 0.206), \n                 resolution = 1200L,\n                 iterations = 1000)\n\n# weird uneven palette made for a heatmap viz:\n# https://benjaminlmoore.wordpress.com/2015/04/09/recreating-the-vaccination-heatmaps-in-r/\ncols \u003c- c(\n  colorRampPalette(c(\"#e7f0fa\", \"#c9e2f6\", \"#95cbee\",\n                     \"#0099dc\", \"#4ab04a\", \"#ffd73e\"))(10),\n  colorRampPalette(c(\"#eec73a\", \"#e29421\", \"#e29421\", \n                     \"#f05336\",\"#ce472e\"), bias=2)(90), \n  \"black\")\n\ndf \u003c- as.data.frame(mb)\nggplot(df, aes(x = x, y = y, fill = value)) +\n  geom_raster(interpolate = TRUE) + theme_void() +\n  scale_fill_gradientn(colours = cols, guide = \"none\") \n\n```\n\n`mandelbrot0` is a faster interface for `as.data.frame(mandelbrot(...))`.\n\n## See also\n\n* [shinybrot](https://github.com/blmoore/shinybrot) is a Shiny web app \nthat enables interactive exploration of the Mandelbrot set as generated\nby this package. Hosted on shinyapps: https://blmr.shinyapps.io/shinybrot\n* [This blog post](https://benjaminlmoore.wordpress.com/2017/06/27/the-mandelbrot-set-in-r/)\non the R package and Shiny app.\n\n\n## Credits\n\n* Wraps original R / C code by [mariodosreis](https://github.com/mariodosreis) (see R package [fractal](https://github.com/mariodosreis/fractal)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblmoore%2Fmandelbrot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblmoore%2Fmandelbrot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblmoore%2Fmandelbrot/lists"}