{"id":13720656,"url":"https://github.com/vegawidget/altair","last_synced_at":"2026-02-21T00:02:40.544Z","repository":{"id":31288181,"uuid":"127300979","full_name":"vegawidget/altair","owner":"vegawidget","description":"R interface to 'Altair'","archived":false,"fork":false,"pushed_at":"2024-01-15T00:47:05.000Z","size":31702,"stargazers_count":92,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-02-01T17:34:24.601Z","etag":null,"topics":["altair","interactive","r","reticulate","vega-lite","visualization"],"latest_commit_sha":null,"homepage":"https://vegawidget.github.io/altair","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/vegawidget.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":"CONTRIBUTING.Rmd","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-03-29T14:10:49.000Z","updated_at":"2025-09-24T10:50:18.000Z","dependencies_parsed_at":"2024-01-06T01:03:18.520Z","dependency_job_id":"a0f42b83-4840-4a7a-a3dd-af750de2f1d9","html_url":"https://github.com/vegawidget/altair","commit_stats":{"total_commits":488,"total_committers":10,"mean_commits":48.8,"dds":"0.15778688524590168","last_synced_commit":"b68c29ec04f2216d7b46a72c44595e10df9695d5"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/vegawidget/altair","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegawidget%2Faltair","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegawidget%2Faltair/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegawidget%2Faltair/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegawidget%2Faltair/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vegawidget","download_url":"https://codeload.github.com/vegawidget/altair/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegawidget%2Faltair/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29668637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T23:24:07.480Z","status":"ssl_error","status_checked_at":"2026-02-20T23:24:06.202Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["altair","interactive","r","reticulate","vega-lite","visualization"],"created_at":"2024-08-03T01:01:06.436Z","updated_at":"2026-02-21T00:02:40.507Z","avatar_url":"https://github.com/vegawidget.png","language":"R","funding_links":[],"categories":["R","Wrappers","Visualization"],"sub_categories":["Papers","General-Purpose"],"readme":"---\noutput: github_document\neditor_options: \n  chunk_output_type: console\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  dev = \"svg\"\n)\n\nurl_local \u003c- function(x) {\n  file.path(\"https://vegawidget.github.io/altair\", x)\n}\n```\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/altair)](https://cran.r-project.org/package=altair)\n[![R-CMD-check](https://github.com/vegawidget/altair/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/vegawidget/altair/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\n# altair\n\nThe goal of altair is to help you build [**Vega-Lite**](https://vega.github.io/vega-lite/) visualizations. \nThis package uses [**reticulate**](https://rstudio.github.io/reticulate/) to provide an interface to the [**Altair**](https://altair-viz.github.io) Python package, and the [**vegawidget**](https://vegawidget.github.io/vegawidget/) package to render charts as htmlwidgets. \nTo avoid confusion, the capitalized word **Altair** shall refer to the Python package; the lower-case word **altair** shall refer to this R package.\n\nThis version of the R package supports Python Altair version `r altair::altair_version()$altair`.\n\n## Example\n\nThis example is discussed in detail in our [Getting Started article](https://vegawidget.github.io/altair/articles/altair.html):\n\n```{r example}\nlibrary(\"altair\")\n\nvega_data \u003c- import_vega_data()\n\nchart \u003c- \n  alt$Chart(vega_data$cars())$\n  mark_point()$\n  encode(\n    x = \"Horsepower:Q\",\n    y = \"Miles_per_Gallon:Q\",\n    color = \"Origin:N\"\n  )\n\nchart\n```\n\nSome things to keep in mind:\n\n  - Where you see a `.` in the Python examples, use a `$` instead.\n\n  - In your data, columns that contain dots can be wrapped in square brackets in Altair specifications, e.g. `[Sepal.Width]`, to keep Altair from throwing an error. \n    Alternatively, you can use a double-backslash, e.g. `Sepal\\\\.Width`.\n  \nThese and other \"gotchas\" are compiled along with workarounds in an article: [Field Guide to Python Issues](https://vegawidget.github.io/altair/articles/field-guide-python.html).   \n\n## Installation\n\nYou can install altair from CRAN with:\n\n```{r cran-installation, eval=FALSE}\ninstall.packages(\"altair\")\n```\n\nThe development version of is available from [GitHub](https://github.com/vegawidget/altair/):\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"vegawidget/altair\") \n```\n\nBecause of Python, there may be some additional installation steps, described in greater detail in the [Installation article](https://vegawidget.github.io/altair/articles/installation.html).\n\n1. Python must be installed on your system. \n   We have had success using [Conda](https://conda.io/docs): in particular, [Miniconda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html#anaconda-or-miniconda) works well and installs more-quickly than Anaconda.\n\n   If you work in a corporate or institutional environment, you may have to specify the location of your SSL certificate, or deal with a proxy. The installation article has a [section](https://vegawidget.github.io/altair/articles/installation.html#proxies) on this. \n   \n1. Create a Conda environment called `\"r-reticulate\"`. \nThe reticulate folks [recommend](https://rstudio.github.io/reticulate/articles/python_packages.html) standardizing on a common name for all packages that use reticulate. \nFor more information, there is a [section](https://vegawidget.github.io/altair/articles/installation.html#python-env) in the installation article. \n\n1. Install Altair into your `\"r-reticulate\"` environment using `altair::install_altair()`. \n\n1. **Important**: (Python) Altair 4.2.0 does note work with Pandas 2.0; use Pandas 1.5.3 (for example).\n   This is fixed for (Python) Altair 5, which will be made available in an upcoming release of (R) altair.\n\nYou may wish to add a line like this to the `.First()` function in your `.Rprofile`:\n\n```r\nreticulate::use_condaenv(\"r-reticulate\")\n```\n\nThe `use_condaenv()` function is called to provide a [hint to reticulate](https://rstudio.github.io/reticulate/articles/versions.html#order-of-discovery) on which Python environment to use.\n\n### Optional installations\n\nIf you have the **[V8](https://CRAN.R-project.org/package=V8)** installed, you can use [vegawidget's image-generating functions](https://vegawidget.github.io/vegawidget/reference/image.html) to convert Altair charts into SVG strings or write SVG files. \nWith the **[rsvg](https://CRAN.R-project.org/package=rsvg)** and **[png](https://CRAN.R-project.org/package=png)** packages installed, you can get a bitmap array, or write PNG files. \n\nWhen knitting to a non-HTML format, e.g. `github_document`, this package provides a `knit_print()` function that will intercept the normal renderer, using instead its own renderer, allowing you to specify `\"png\"` , `\"svg\"` or `\"pdf\"`. \nLike the image functions, this requires that the V8 package be installed, as well as  [rsvg](https://cran.r-project.org/package=rsvg) and [png](https://cran.r-project.org/package=png). \nMacOS users will require an X11 system, such as [XQuartz](https://www.xquartz.org), to be installed.\n\n## Articles\n\nThe documentation for this package includes some [articles](https://vegawidget.github.io/altair/articles/index.html):\n\n- [Getting Started](https://vegawidget.github.io/altair/articles/altair.html): a walkthrough to get a first chart to work\n\n- [Installation](https://vegawidget.github.io/altair/articles/installation.html): some more-detailed instructions\n\nGallery:\n\n- An adaptation to R of the [Altair Example Gallery](https://altair-viz.github.io/gallery/), to demonstrate (not least to ourselves) that we are not missing any of the expressiveness of the Python API. \nYou may be interested in the [Interactive Charts](https://vegawidget.github.io/altair/articles/example-gallery-08-interactive-charts.html) examples.  \n\nExamples:\n\n- [Tooltips](https://vegawidget.github.io/altair/articles/tooltips.html): shows how Vega-Lite implements tooltips as an encoding within a chart, with formatting options\n\n- [Vega Datasets](https://vegawidget.github.io/altair/articles/vega-datasets.html): work with [Vega datasets](https://github.com/altair-viz/vega_datasets) using `import_vega_data()`\n\n- [View Composition](https://vegawidget.github.io/altair/articles/view-composition.html): how to facet, add layers to, repeat, and concatenate charts\n\n- [Interactive Examples](https://vegawidget.github.io/altair/articles/interactive.html): a set of examples that work towards linked-brushing of two scatterplots\n\nField Guides:\n\n- [Field Guide to Python Issues](https://vegawidget.github.io/altair/articles/field-guide-python.html): \"gotchas\" and their workarounds\n\n- [Field Guide to Rendering Charts](https://vegawidget.github.io/altair/articles/field-guide-rendering.html): specify options to render charts as HTML\n\n## Acknowledgements\n\nThis package rests on these foundations:\n\n- [Altair](https://altair-viz.github.io): Python interface to Vega-Lite\n\n- [reticulate](https://rstudio.github.io/reticulate/): R framework to work with Python\n\n- [Vega-Lite](https://vega.github.io/vega-lite/): a grammar of interactive graphics\n\n- [vegawidget](https://vegawidget.github.io/vegawidget/): R package to render Vega(-Lite) visualizations\n\n- [htmlwidgets](https://www.htmlwidgets.org/): R framework to work with JavaScript visualizations\n\nAs well, a particular debt is owed to the folks behind the [vegalite](https://github.com/hrbrmstr/vegalite) package, as it provided a lot of the inspiration for these efforts.\n\nThis project is a collaborative effort. \nIn addition to the principal authors:\n\n- [Alicia Schep](https://github.com/AliciaSchep) has contributed the concatenation functions, as well as sorted out many of the Python, JavaScript, and package-API issues.\n\n- [Heike Hofmann](https://github.com/heike) has been an invaluable advisor, providing incisive feedback, and insight into the fundamentals of interactive graphics.\n\n## Contributing\n\nPlease note that this project is released with a [Contributor Code of Conduct](`r url_local(\"CODE_OF_CONDUCT.html\")`).\nBy participating in this project you agree to abide by its terms. \n\nThis project also has a [Contributing Guide](`r url_local(\"CONTRIBUTING.html\")`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvegawidget%2Faltair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvegawidget%2Faltair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvegawidget%2Faltair/lists"}