{"id":32206607,"url":"https://github.com/pepijn-devries/ggfields","last_synced_at":"2026-02-21T12:01:55.514Z","repository":{"id":219719329,"uuid":"745890695","full_name":"pepijn-devries/ggfields","owner":"pepijn-devries","description":"Add vector fields layers to ggplots","archived":false,"fork":false,"pushed_at":"2025-09-05T17:07:44.000Z","size":9545,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-11T15:41:09.135Z","etag":null,"topics":["ggplot2","spatial","visualisation"],"latest_commit_sha":null,"homepage":"https://pepijn-devries.github.io/ggfields/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pepijn-devries.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-20T13:12:11.000Z","updated_at":"2025-09-05T17:02:30.000Z","dependencies_parsed_at":"2025-09-05T19:14:57.338Z","dependency_job_id":null,"html_url":"https://github.com/pepijn-devries/ggfields","commit_stats":null,"previous_names":["pepijn-devries/ggfields"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pepijn-devries/ggfields","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepijn-devries%2Fggfields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepijn-devries%2Fggfields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepijn-devries%2Fggfields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepijn-devries%2Fggfields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepijn-devries","download_url":"https://codeload.github.com/pepijn-devries/ggfields/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepijn-devries%2Fggfields/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29680147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T11:29:27.227Z","status":"ssl_error","status_checked_at":"2026-02-21T11:29:20.292Z","response_time":107,"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":["ggplot2","spatial","visualisation"],"created_at":"2025-10-22T05:32:35.637Z","updated_at":"2026-02-21T12:01:55.508Z","avatar_url":"https://github.com/pepijn-devries.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"70%\",\n  fig.ext = \"svg\",\n  dev = \"ggsave\"\n)\n```\n\n# ggfields\n\n## Overview\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/pepijn-devries/ggfields/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pepijn-devries/ggfields/actions/workflows/R-CMD-check.yaml)\n![cranlogs](https://cranlogs.r-pkg.org/badges/ggfields)\n[![version](https://www.r-pkg.org/badges/version/ggfields)](https://CRAN.R-project.org/package=ggfields)\n[![cran checks](https://badges.cranchecks.info/worst/ggfields.svg)](https://cran.r-project.org/web/checks/check_results_ggfields.html)\n[![ggfields status badge](https://pepijn-devries.r-universe.dev/badges/ggfields)](https://pepijn-devries.r-universe.dev/ggfields)\n[![codecov](https://codecov.io/gh/pepijn-devries/ggfields/graph/badge.svg?token=M8DRDR80RL)](https://app.codecov.io/gh/pepijn-devries/ggfields)\n\u003c!-- badges: end --\u003e\n\n\u003cimg src=\"man/figures/logo.png\" align=\"right\" alt = \"logo\" class = \"pkgdown-hide\" /\u003e\n\nAdd vector field layers to your `ggplot2::ggplot()`. Although it has similarities\nwith `ggplot2::geom_spoke()`, `ggfields` offers some distinct features:\n\n * The `radius` aesthetic is mapped to a scale and therefore can be added\n   to the guides (see `vignette(\"radius_aes\")`).\n * Not only `data.frame`s are supported, but also geometric data\n   (`sf::st_sf()` and `stars::st_as_stars()`).\n * Corrects angles for displayed aspect ratio or coordinate system\n   (see `vignette(\"angle_correction\")`).\n\n## Installation\n\n\u003e Get CRAN version\n```{r eval=FALSE}\ninstall.packages(\"ggfields\")\n```\n\n\u003e Get development version from r-universe\n```{r eval=FALSE}\ninstall.packages(\"ggfields\", repos = c(\"https://pepijn-devries.r-universe.dev\", \"https://cloud.r-project.org\"))\n```\n\n## Adding vector fields to a map\n\nThe example below shows how seawater current data can be added to a map:\n\n```{r init, results = 'hide', message = FALSE}\nlibrary(ggplot2)\nlibrary(ggfields)\nlibrary(ggspatial) ## For annotating with Open Street Map\n```\n\n```{r theme, echo = FALSE}\ntheme_set(theme_light())\nset.seed(0)\n```\n\n```{r map, results = 'hide', message = FALSE, fig.width = 5, fig.height = 7, out.width = \"50%\"}\ndata(seawatervelocity)\n\nggplot() +\n  ggspatial::annotation_map_tile(\n    alpha      = 0.25,\n    cachedir   = tempdir()) +\n  geom_fields(\n    data       = seawatervelocity,\n    aes(radius = as.numeric(v),\n        angle  = as.numeric(angle),\n        colour = as.numeric(v)),\n    max_radius = grid::unit(0.7, \"cm\")) +\n  labs(colour  = \"v[m/s]\",\n       radius  = \"v[m/s]\") +\n  scale_radius_binned() +\n  scale_colour_viridis_b(guide = guide_bins())\n\n```\n\n## Simple data.frames\n\nVector arrows can also be added to simple plots with `x` and `y` data:\n\n```{r dataframe, results = 'hide', message = FALSE}\n## First generate some arbitrary data to plot:\nn  \u003c- 10\ndf \u003c- data.frame(x = seq(0, 100, length.out = n), y = rnorm(n),\n                 ang = seq(0, 2*pi, length.out = n))\ndf$len \u003c- 2 + df$y + rnorm(n)/4\n\nggplot(df, aes(x = x, y = y)) +\n  geom_line() +\n  geom_fields(aes(angle = ang, radius = len), .angle_correction = NULL)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepijn-devries%2Fggfields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepijn-devries%2Fggfields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepijn-devries%2Fggfields/lists"}