{"id":22088018,"url":"https://github.com/coatless-rpkg/paintr","last_synced_at":"2025-07-24T18:33:31.568Z","repository":{"id":216431807,"uuid":"741315098","full_name":"coatless-rpkg/paintr","owner":"coatless-rpkg","description":"Draw different R data structures on graphs","archived":false,"fork":false,"pushed_at":"2024-09-13T06:14:13.000Z","size":9101,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-13T17:13:41.937Z","etag":null,"topics":["data-structures","draw","paint","r-package","rstats"],"latest_commit_sha":null,"homepage":"http://r-pkg.thecoatlessprofessor.com/paintr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coatless-rpkg.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"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},"funding":{"github":["coatless"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2024-01-10T06:18:46.000Z","updated_at":"2024-09-13T06:12:36.000Z","dependencies_parsed_at":"2024-09-13T17:13:49.328Z","dependency_job_id":"18596265-7bc5-4366-9f77-44b477266fd3","html_url":"https://github.com/coatless-rpkg/paintr","commit_stats":null,"previous_names":["coatless-rpkg/drawr","coatless-rpkg/paintr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fpaintr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fpaintr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fpaintr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fpaintr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coatless-rpkg","download_url":"https://codeload.github.com/coatless-rpkg/paintr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227470127,"owners_count":17778930,"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":["data-structures","draw","paint","r-package","rstats"],"created_at":"2024-12-01T02:07:21.386Z","updated_at":"2024-12-01T02:07:22.267Z","avatar_url":"https://github.com/coatless-rpkg.png","language":"R","funding_links":["https://github.com/sponsors/coatless"],"categories":[],"sub_categories":[],"readme":"---\noutput:\n  github_document\n    #fig_width: 7\n    #fig_height: 5 # default is 5\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# paintr\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/coatless-rpkg/paintr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/coatless-rpkg/paintr/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nThe goal of `paintr` is to draw different _R_ data structures on graphs.\n\n\u003e [!NOTE]\n\u003e\n\u003e A previous version of the package was called `drawr`; however, another package\n\u003e with the same name was published on CRAN. As a result, the package was renamed\n\u003e to `paintr`.\n\n## Installation\n\nYou can install the development version of drawr from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"coatless-rpkg/paintr\")\n```\n\n## Design\n\nThe package is designed to take advantage of base R graphics alongside `ggplot2`.\nWe're providing two different implementations for each system under the\nnaming scheme of:\n\n- `paint_*()`: base R graphics\n- `gpaint_*()`: `ggplot2`\n\n## Example\n\nTake for instance we have a matrix that looks like so: \n\n```{r}\nmat_3x5 = matrix(\n  c(\n   1, NA,    3,   4,  NaN, \n  NA,  7,    8,  -9,  10, \n -11, 12, -Inf, -14,  NA\n ),\n ncol = 5, byrow = TRUE)\n\nmat_3x5\n```\n\nWhat if we wanted to see the contents laid out with their indices or specific cells\nhighlighted?\n\n```{r}\n#| label: base-example\n#| results: 'markup'\n# Load the library\nlibrary(paintr)\n\n# Graphic of matrix data structure using base R graphics\npaint_matrix(mat_3x5)\n# Show the cell indices\npaint_matrix(mat_3x5, show_indices = \"cell\")\n# Show all indices\npaint_matrix(mat_3x5, show_indices = \"all\")\n# Highlight cells over a specific value\npaint_matrix(mat_3x5, highlight_area = mat_3x5 \u003e 4)\n```\n\nWe can achieve similar results with the `ggplot2` function. \n\n```{r}\n#| label: ggplot2-example\n#| results: 'markup'\n# Graphic of matrix data structure using base R graphics\ngpaint_matrix(mat_3x5)\n# Highlight cells in specific columns\ngpaint_matrix(mat_3x5, \n             show_indices = c(\"row\", \"column\"),\n             highlight_area = highlight_columns(mat_3x5, columns = 2:4))\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatless-rpkg%2Fpaintr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoatless-rpkg%2Fpaintr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatless-rpkg%2Fpaintr/lists"}