{"id":21581430,"url":"https://github.com/dlr-eoc/ukis-migrationdetectr","last_synced_at":"2025-03-18T08:14:19.182Z","repository":{"id":206648490,"uuid":"716944228","full_name":"dlr-eoc/ukis-migrationdetectr","owner":"dlr-eoc","description":"Detection of migration events and segments of continuous residence      based on irregular time series of location data","archived":false,"fork":false,"pushed_at":"2023-11-11T13:29:17.000Z","size":579,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T14:44:35.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlr-eoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-10T07:54:57.000Z","updated_at":"2023-11-28T11:19:22.000Z","dependencies_parsed_at":"2023-11-11T10:40:16.058Z","dependency_job_id":null,"html_url":"https://github.com/dlr-eoc/ukis-migrationdetectr","commit_stats":null,"previous_names":["dlr-eoc/ukis-migrationdetectr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlr-eoc%2Fukis-migrationdetectr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlr-eoc%2Fukis-migrationdetectr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlr-eoc%2Fukis-migrationdetectr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlr-eoc%2Fukis-migrationdetectr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlr-eoc","download_url":"https://codeload.github.com/dlr-eoc/ukis-migrationdetectr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244181390,"owners_count":20411605,"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-24T14:12:30.282Z","updated_at":"2025-03-18T08:14:19.163Z","avatar_url":"https://github.com/dlr-eoc.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![UKIS](man/figures/ukis-logo.png)](https://www.dlr.de/eoc/en/desktopdefault.aspx/tabid-5413/10560_read-21914/) \r\nUKIS - MigrationDetectR \r\n==============\r\n\r\n \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"70\" /\u003e\r\n\u003c!-- badges: start --\u003e\r\n\u003c!--[![Lifecycle: stable](https://lifecycle.r-lib.org/articles/figures/lifecycle-stable.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) --\u003e\r\n\u003c!--[![CRAN status](https://www.r-pkg.org/badges/version/MigrationDetectR)](https://CRAN.R-project.org/package=MigrationDetectR)--\u003e\r\n\u003c!-- badges: end --\u003e\r\n\r\nImplementation of Migration detection algorithm, published by Chi et al. (2020) in [A general approach to detecting migration events in digital trace data](https://doi.org/10.1371/journal.pone.0239408)\r\n\r\n## Installation\r\n\r\nThe package can be installed as follows:\r\n\r\n``` r\r\ninstall.packages(\"MigrationDetectR\")\r\n```\r\n\r\n## Example\r\n\r\n\r\n### Input data\r\n\r\nFirst, make sure your data into the format required by the package: Two aligned vectors for each individual, one with locations and one with timestamps.\r\n\r\n\r\n``` r\r\nlibrary(MigrationDetectR)\r\n# Load an example trace\r\ntrace \u003c- example_trace\r\n\r\n# a vector of `POSIXct` timestamps\r\ntimestamps = example_trace$timestamp\r\ntail(timestamps)\r\n\r\n# a vector of `character` locations\r\nlocations = example_trace$location\r\ntail(locations)\r\n```\r\n\r\nThe basic usage consists of two steps:\r\n\r\n### Identifying segments of continuous residence\r\n\r\nFirst, use the `detect_segments` function to identify segments of continuous residence.\r\n\r\n``` r\r\n# Detect segments\r\nsegments \u003c-\r\n  detect_segments(\r\n      locs = locations,\r\n      times = timestamps,\r\n      param_min_days = 3,\r\n      param_prop_days = 0.06,\r\n      param_window_size_days = 7)\r\n nrow(segments) # check the number of detected segments\r\n\r\n```\r\n\r\n### Identifying segments of continuous residence\r\n\r\nSecond, use the `identify_migrations` function on the segments to detect migrations.\r\nTo optionally determine the best split time, pass the original locations and timestamps vectors. Note that this increases the computational load substantially.\r\n\r\n``` r\r\n migrations \u003c-\r\n identify_migrations(\r\n  segs = segments$segments,\r\n  locs = segments$locs,\r\n  min_res_length = 90,\r\n  occurrence_locs = trace$location,\r\n  occurrence_times = trace$timestamp\r\n  )\r\n  nrow(migrations) # check the number of identified migrations\r\n  head(migrations) # check the detected migrations\r\n```\r\n\r\n## Multiple users\r\n\r\nThe functions process one user at a time. Datasets with multiple users need to be split.\r\nFor very large datasets, we recommend to apply the function with some degree of [parallelization](https://bookdown.org/rdpeng/rprogdatascience/parallel-computation.html).\r\n\r\nAlternatively, consider the [Python implementation](https://github.com/g-chi/migration_detector).\r\n\r\n\r\n\r\n## Contributors\r\nThe UKIS team creates and adapts libraries which simplify the usage of satellite data:\r\n\r\n* Mast, Johannes\r\n\r\nGerman Aerospace Center (DLR)\r\n\r\n## Licenses\r\nThis software is licensed under the [Apache 2.0 License](https://github.com/dlr-eoc/ukis-migrationdetectr/blob/main/LICENSE.txt).\r\n\r\nCopyright (c) 2023 German Aerospace Center (DLR) * German Remote Sensing Data Center * Department: Geo-Risks and Civil Security\r\n\r\n## Changelog\r\nSee [NEWS](https://github.com/dlr-eoc/ukis-migrationdetectr/blob/main/NEWS.md).\r\n\r\n## Contributing\r\nThe UKIS team welcomes contributions from the community.\r\nFor more detailed information, see our guide on [contributing](https://github.com/dlr-eoc/ukis-pysat/blob/master/CONTRIBUTING.md) if you're interested in getting involved.\r\n\r\n## What is UKIS?\r\nThe DLR project Environmental and Crisis Information System (the German abbreviation is UKIS, standing for [Umwelt- und Kriseninformationssysteme](https://www.dlr.de/eoc/en/desktopdefault.aspx/tabid-5413/10560_read-21914/) aims at harmonizing the development of information systems at the German Remote Sensing Data Center (DFD) and setting up a framework of modularized and generalized software components.\r\n\r\nUKIS is intended to ease and standardize the process of setting up specific information systems and thus bridging the gap from EO product generation and information fusion to the delivery of products and information to end users.\r\n\r\nFurthermore, the intention is to save and broaden know-how that was and is invested and earned in the development of information systems and components in several ongoing and future DFD projects.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlr-eoc%2Fukis-migrationdetectr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlr-eoc%2Fukis-migrationdetectr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlr-eoc%2Fukis-migrationdetectr/lists"}