{"id":13721324,"url":"https://github.com/rte-antares-rpackage/antaresRead","last_synced_at":"2025-05-07T13:32:20.592Z","repository":{"id":19447800,"uuid":"73826974","full_name":"rte-antares-rpackage/antaresRead","owner":"rte-antares-rpackage","description":"Import, manipulate and explore the results of an Antares simulation","archived":false,"fork":false,"pushed_at":"2025-05-02T15:39:32.000Z","size":72056,"stargazers_count":13,"open_issues_count":9,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-02T16:41:41.082Z","etag":null,"topics":["adequacy","bilan","electricity","energy","hdf5","linear-algebra","monte-carlo-simulation","optimisation","previsionnel","r","rhdf5","rte","simulation","tyndp"],"latest_commit_sha":null,"homepage":"https://rte-antares-rpackage.github.io/antaresRead/","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/rte-antares-rpackage.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2016-11-15T15:26:32.000Z","updated_at":"2025-04-28T15:24:58.000Z","dependencies_parsed_at":"2023-09-21T19:33:08.706Z","dependency_job_id":"6a90c967-df0e-40ea-8b1a-18293c6cac28","html_url":"https://github.com/rte-antares-rpackage/antaresRead","commit_stats":{"total_commits":901,"total_committers":27,"mean_commits":"33.370370370370374","dds":0.6448390677025527,"last_synced_commit":"b3d4bd6a0bac49e65628d644585b258351285642"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rte-antares-rpackage%2FantaresRead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rte-antares-rpackage%2FantaresRead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rte-antares-rpackage%2FantaresRead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rte-antares-rpackage%2FantaresRead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rte-antares-rpackage","download_url":"https://codeload.github.com/rte-antares-rpackage/antaresRead/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252231164,"owners_count":21715474,"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":["adequacy","bilan","electricity","energy","hdf5","linear-algebra","monte-carlo-simulation","optimisation","previsionnel","r","rhdf5","rte","simulation","tyndp"],"created_at":"2024-08-03T01:01:15.532Z","updated_at":"2025-05-07T13:32:20.580Z","avatar_url":"https://github.com/rte-antares-rpackage.png","language":"R","funding_links":[],"categories":["Energy Systems"],"sub_categories":["Energy System Modeling Frameworks"],"readme":"\u003cimg src=\"man/figures/antares_simulator.png\" align=\"right\" width=250 /\u003e\n\u003cbr/\u003e\n\n# antaresRead\n\n\u003e Read data from an Antares study with R package 'antaresRead'\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/antaresRead)](https://cran.r-project.org/package=antaresRead)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![R-CMD-check](https://github.com/rte-antares-rpackage/antaresRead/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rte-antares-rpackage/antaresRead/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/rte-antares-rpackage/antaresRead/graph/badge.svg)](https://app.codecov.io/gh/rte-antares-rpackage/antaresRead)\n\u003c!-- badges: end --\u003e\n\n\n## Installation\n\nYou can install the package from CRAN:\n```r\ninstall.packages(\"antaresRead\")\n```\n\nYou can also install the last development version from Github:\n```r\ndevtools::install_github(\"rte-antares-rpackage/antaresRead\")\n```\n\nTo display the help of the package and see all the functions it provides, type:\n```r \nhelp(package=\"antaresRead\")\n```\n\nTo see a practical example of use of the package, look at the vignette :\n```r\nvignette(\"antares\")\n```\n\nFinally, you can download a cheatsheet that summarize in a single page how to use the package: https://github.com/rte-antares-rpackage/antaresRead/raw/master/cheat_sheet/antares_cheat_sheet_en.pdf .\n\nSee website for more documentation: https://rte-antares-rpackage.github.io/antaresRead/\n\n\n\n## Initialisation\n\nLoad the package\n\n```r\nlibrary(antaresRead)\n```\n\nSelect an Antares simulation interactively.\n\n```r\nsetSimulationPath()\n```\n\nYou can also select it programmatically:\n\n```r\nsetsimulationPath(\"study_path\", simulation)\n```\n\nThe parameter `simulation` can be the name of a simulation, the name of the folder containing the simulation results, or the index of the simulation. `1` corresponds to the oldest simulation, `-1` to the newest one, 0 to the inputs.\n\n\n## Read data from a simulation\n\nMost data from a simulation can be imported in the R session with function `readAntares()`. It has many parameters that control what data is imported. Here are a few examples: \n\n```r\n# Read synthetic results of all areas of a study with hourly time step.\nareaData \u003c- readAntares(areas = \"all\")\n\n# Same but with a daily time step:\nareaData \u003c- readAntares(areas = \"all\", timeStep = \"daily\")\n\n# Read all Monte Carlo scenarios for a given area.\nmyArea \u003c- readAntares(areas = \"my_area\", mcYears = \"all\")\n\n# Same but add miscelaneous production time series to the result \nmyArea \u003c- readAntares(areas = \"my_area\", mcYears = \"all\", misc = TRUE)\n\n# Read only columns \"LOAD\" and \"MRG. PRICE\"\nareaData \u003c- readAntares(areas = \"all\", select = c(\"LOAD\", \"MRG. PRICE\"))\n```\n\nFunctions `getAreas` and `getLinks` are helpful to create a selection of areas or links of interest. Here are a few examples:\n\n```r\n# select areas containing \"fr\"\nmyareas \u003c- getAreas(\"fr\")\n\n# Same but remove areas containing \"hvdc\"\nmyareas \u003c- getAreas(\"fr\", exclude = \"hvdc\")\n\n# Get the links that connect two of the previous areas\nmylinks \u003c- getLinks(myareas, internalOnly = FALSE)\n\n# Get the results for these areas and links\nmydata \u003c- readAntares(areas = myareas, links = mylinks)\n```\n\n## Work with the imported data\n\nWhen only one type of elements is imported (only areas or only links, etc.) `readAntares()` read antares returns a `data.table` with some extra attributes. A `data.table` is a table with some enhanced capacities offered by package `data.table`. In particular it provides a special syntax to manipulate its content:\n\n```r\nname_of_the_table[filter_rows, select_columns, group_by]\n```\n\nHere are some examples:\n\n```r\n# Select lines based on some criteria\nmydata[area == \"fr\" \u0026 month == \"JUL\"]\n\n# Select columns, and compute new ones\nmydata[, .(area, month, load2 = LOAD^2)]\n\n# Aggregate data by some variables\nmydata[, .(total = sum(LOAD)), by = .(month)]\n\n# All three operations can be done with a single line of code\nmydata[area == \"fr\", .(total = sum(LOAD)), by = .(month)]\n\nhelp(package = \"data.table\")\n```\n\nIf you are not familiar with package `data.table`, you should have a look at the documentation and especially at the vignettes of the package:\n\n```r\nhelp(package=\"data.table\")\nvignette(\"datatable-intro\")\n```\n## Contributing:\n\nContributions to the library are welcome and can be submitted in the form of pull requests to this repository.\n\nThe folder test_case contains a test Antares study used to run automatic tests. If you modifies it, you need to run the following command to include the modifications in the tests:\n\n```r\nsaveWd\u003c-getwd()\nsetwd('inst/testdata/')\ntar(\n  tarfile = \"antares-test-study.tar.gz\", \n  files = \"test_case\", \n  compression = \"gzip\"\n)\n\nsetwd(saveWd)\n```\n\n## ANTARES :\n Antares is a powerful software developed by RTE to simulate and study electric power systems (more information about Antares here : \u003chttps://antares-simulator.org/\u003e).\n \nANTARES is now an open-source project (since 2018), you can download the sources [here](https://github.com/AntaresSimulatorTeam/Antares_Simulator) if you want to use this package. \n\n## License Information:\n\nCopyright 2015-2016 RTE (France)\n\n* RTE: https://www.rte-france.com\n\nThis Source Code is subject to the terms of the GNU General Public License, version 2 or any higher version. If a copy of the GPL-v2 was not distributed with this file, You can obtain one at https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frte-antares-rpackage%2FantaresRead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frte-antares-rpackage%2FantaresRead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frte-antares-rpackage%2FantaresRead/lists"}