{"id":22332923,"url":"https://github.com/jonocarroll/vec","last_synced_at":"2025-10-04T03:49:25.781Z","repository":{"id":264949828,"uuid":"863948607","full_name":"jonocarroll/vec","owner":"jonocarroll","description":"A New Vector Class With Added Functionality","archived":false,"fork":false,"pushed_at":"2024-09-27T23:25:05.000Z","size":1043,"stargazers_count":10,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T17:50:17.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://jonocarroll.github.io/vec/","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/jonocarroll.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"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}},"created_at":"2024-09-27T08:00:32.000Z","updated_at":"2024-11-27T00:09:41.000Z","dependencies_parsed_at":"2024-11-27T00:15:46.229Z","dependency_job_id":null,"html_url":"https://github.com/jonocarroll/vec","commit_stats":null,"previous_names":["jonocarroll/vec"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonocarroll/vec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fvec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fvec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fvec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fvec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonocarroll","download_url":"https://codeload.github.com/jonocarroll/vec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fvec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278262441,"owners_count":25957937,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-04T04:20:45.259Z","updated_at":"2025-10-04T03:49:25.745Z","avatar_url":"https://github.com/jonocarroll.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, 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# vec\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n\u003c!-- badges: end --\u003e\n\nThe goal of vec is to reinvent the \"vector\" class with new and improved\nfunctionality.\n\n## Installation\n\nYou can install the development version of {vec} like so:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"jonocarroll/vec\")\n```\n\n## Examples\n\n{vec} provides a new class extending R's atomic vectors which enables some new\nfunctionality.\n\n```{r example}\nlibrary(vec)\n```\n\n### Subsetting via Functions\n\nAlong with some built-in vector operations such as `is_even()`, {vec} enables \nsubsetting with a function or formula, and in-place replacements with the same\n\n```{r}\nx \u003c- as_vec(1:10)\nx\n\nx[~is_even(.)]\n\nx[is_even]\n\nx[is_even] \u003c- 0\nx\n```\n\nSee the [vignette](https://jonocarroll.github.io/vec/articles/functions.html)\nfor more details.\n\n### Rotating\n\nWhile not specific to {vec}, this package provides a ring-buffer-like function\nwhich rotates a vector through `n` positions\n\n```{r}\nx \u003c- as_vec(1:5)\nx\n\nrotate(x, n = 1)\nrotate(x, n = 2)\nrotate(x, n = -1)\n```\n\n## Other Use Cases\n\nI'm interested in what else a new vector class could bring to R. Add an \n[Issue](https://github.com/jonocarroll/vec) if you can think of one!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonocarroll%2Fvec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonocarroll%2Fvec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonocarroll%2Fvec/lists"}