{"id":18497661,"url":"https://github.com/centreon/warp10r","last_synced_at":"2025-05-14T05:14:54.017Z","repository":{"id":40386458,"uuid":"212369860","full_name":"centreon/warp10r","owner":"centreon","description":"R client for interacting with a Warp 10™ instance","archived":false,"fork":false,"pushed_at":"2025-04-17T10:04:43.000Z","size":708,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-18T00:46:09.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"senx/warp10-r","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centreon.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-02T14:59:55.000Z","updated_at":"2025-04-10T09:05:31.000Z","dependencies_parsed_at":"2024-11-06T13:45:14.991Z","dependency_job_id":"e89702ba-8db2-4d19-9071-4bf6a0625ec0","html_url":"https://github.com/centreon/warp10r","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centreon%2Fwarp10r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centreon%2Fwarp10r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centreon%2Fwarp10r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centreon%2Fwarp10r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centreon","download_url":"https://codeload.github.com/centreon/warp10r/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076851,"owners_count":22010611,"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":[],"created_at":"2024-11-06T13:35:15.861Z","updated_at":"2025-05-14T05:14:53.955Z","avatar_url":"https://github.com/centreon.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# warp10r\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n\u003c!-- badges: end --\u003e\n\nR client for executing WarpScript on a Warp 10 instance.\n\n## Fork\n\nThe original package [https://github.com/senx/warp10-r] has been forked to make the package more concilient with current developments of R packages :\n\n- Package has been moved to the root of the git repository\n- Dependancies have been added to the DESCRIPTION\n- Construct a warp 10 script with helpers function and send them to Warp 10 database\n\n## Installation\n\n```r\nremotes::install_github(\"centreon/warp10-r\")\n```\n\n## First steps\n\n### Hello World\n\n```{r}\nlibrary(warp10r)\n\n# Create a connection\ncon \u003c- wrp_connect(endpoint = \"https://warp.senx.io/api/v0/exec\")\nprint(con)\n\n# set_script store a script in the connection object.\nset_script(con, \"'Hello World'\")\nset_script(con, \"NOW\")\nprint(con)\n\n# We can see the script\ncat(get_script(con))\n\n\n# Execute the script\nwrp_exec(con)\n```\n\n### Example with Geo Time Series\n\n```{r}\nlibrary(tibble)\n\ndf1 \u003c- tibble(ds = 1:10, y = rnorm(10))\ndf2 \u003c- tibble(ds = 2:11, y = rnorm(10))\n\ncon %\u003e% \n  clear_script() %\u003e% \n  wrp_new_gts() %\u003e% \n  wrp_rename(\"randGTS\") %\u003e% \n  wrp_add_value_df(df1, tick = ds, value = y) %\u003e% \n  wrp_new_gts() %\u003e% \n  wrp_add_value_df(df2, tick = ds, value = y) %\u003e% \n  wrp_rename(\"nogeoTS\") %\u003e% \n  wrp_exec()\n```\n\n## Outlier detection\n\nAnomaly detection is already implemented in Warpscript.\nLet's take twitter data as an example.\n\n### Set up and show data\n\n```{r}\nlibrary(AnomalyDetection)\nlibrary(dplyr)\nlibrary(ggplot2)\nlibrary(hrbrthemes)\nlibrary(lubridate)\nlibrary(purrr)\n\ndata(\"raw_data\")\n\nraw_data %\u003e% \n  ggplot(aes(timestamp, count)) + \n  geom_line() +\n  theme_ipsum(base_family = \"Verdana\")\n```\n\n### Create a subset of the data\n\nDefault settings do not authorize more than 1,000 operations for a warpscript.\nTherefore, let's take the previous data and concatenate them into 3 hours timespan.\n\n```{r}\ndf \u003c- raw_data %\u003e% \n  group_by(date_hour = ceiling_date(timestamp, \"3 hours\")) %\u003e% \n  summarise_at(\"count\", sum)\n\ndf %\u003e% \n  ggplot(aes(date_hour, count)) +\n  geom_line() +\n  theme_ipsum(base_family = \"Verdana\")\n```\n\n### Lets find some anomalies\n\n```{r}\nres \u003c- con %\u003e% \n  wrp_new_gts() %\u003e% \n  wrp_rename(\"twitter data\") %\u003e% \n  wrp_add_value_df(df, tick = \"date_hour\", value = \"count\") %\u003e% \n  wrp_bucketize(span = \"3 h\", bucketizer = \"sum\") %\u003e% \n  wrp_hybridtest(period = 8, piece = 4, k = 4) %\u003e% \n  wrp_exec()\n\nprint(res)\n\n# Results is a list of abnormal dates in microseconds\nres_dbl \u003c- map_dbl(res[[1]], ~ .x / 1e6)\n\ndf %\u003e% \n  ggplot(aes(date_hour, count)) +\n  geom_line() +\n  geom_vline(xintercept = res_dbl, linetype = 2, color = \"red\") +\n  theme_ipsum(base_family = \"Verdana\")\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentreon%2Fwarp10r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentreon%2Fwarp10r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentreon%2Fwarp10r/lists"}