{"id":15653315,"url":"https://github.com/ironholds/reconstructr","last_synced_at":"2025-04-30T17:21:44.828Z","repository":{"id":24235096,"uuid":"27627791","full_name":"Ironholds/reconstructr","owner":"Ironholds","description":"Tidy tools for session reconstruction and analysis","archived":false,"fork":false,"pushed_at":"2022-02-12T21:08:11.000Z","size":2387,"stargazers_count":28,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-19T07:47:05.315Z","etag":null,"topics":["log-analysis","r","session-reconstruction"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ironholds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-06T08:29:02.000Z","updated_at":"2025-03-22T11:14:30.000Z","dependencies_parsed_at":"2022-08-21T00:40:29.111Z","dependency_job_id":null,"html_url":"https://github.com/Ironholds/reconstructr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ironholds%2Freconstructr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ironholds%2Freconstructr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ironholds%2Freconstructr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ironholds%2Freconstructr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ironholds","download_url":"https://codeload.github.com/Ironholds/reconstructr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251749116,"owners_count":21637457,"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":["log-analysis","r","session-reconstruction"],"created_at":"2024-10-03T12:45:19.981Z","updated_at":"2025-04-30T17:21:44.800Z","avatar_url":"https://github.com/Ironholds.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Session reconstruction and analysis in R\n\n__Author:__ Os Keyes\u003cbr/\u003e\n__License:__ [MIT](http://opensource.org/licenses/MIT)\u003cbr/\u003e\n__Status:__ Stable\n\n[![Travis-CI Build Status](https://travis-ci.org/Ironholds/reconstructr.svg?branch=master)](https://travis-ci.org/Ironholds/reconstructr) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/reconstructr)](https://cran.r-project.org/package=reconstructr) ![downloads](http://cranlogs.r-pkg.org/badges/grand-total/reconstructr)\n\n### Description\n\nA well-studied part of web analytics and human-computer interaction is\nthe concept of a \"session\": a series of linked user actions. This is used\nfor anything from evaluating the impact of design or engineering changes\non users, to providing common, high-level metrics such as time-on-page\nor bounce rate.\n\n\u003ccode\u003ereconstructr\u003c/code\u003e is a library designed to efficiently reconstruct\nsessions from a series of user events, and then generate common metrics\nfrom that session-based data, including bounce rate, session length and time-on-page.\nIt features heavy internal use of C++ to make it lightning-fast over datasets\ncontaining millions or tens of millions of events, along with a wide range of options\nwith each function, allowing you to heavily customise what data is produced and\nwhat data is evaluated. For more information, see the\n[introductory vignette](https://github.com/Ironholds/reconstructr/blob/master/vignettes/Introduction.Rmd).\n\nThe package  is under active development: if you find bugs or have suggestions\nfor new features, please feel free to [report them](https://github.com/Ironholds/reconstructr/issues).\n\n### Usage\n\nSo you've got a session dataset, which we'll call, well, `session_dataset`. It looks like this:\n\n```\nlibrary(reconstructr)\ndata(\"session_dataset\")\nstr(session_dataset)\n\n# 'data.frame':\t63524 obs. of  3 variables:\n#  $ uuid     : chr  \"47dc43895814861e21a2edf93348c826\" \"a736822df1890011694e7049cb3abef3\" \"674d2d00e096a3319874a4347caa1f4a\" \"f62d315398e6d04a3f2fa02e8ae42d49\" ...\n#  $ timestamp: POSIXlt, format: \"2014-01-07 00:00:15\" \"2014-01-07 00:01:11\" \"2014-01-07 00:01:54\" ...\n#  $ url      : chr  \"https://www.nasa.gov/history/mercury/mercury.html\" \"https://www.nasa.gov/images/ksclogosmall.gif\" \"https://www.nasa.gov/elv/hot.gif\" \"https://www.nasa.gov/facts/faq04.html\" ...\n```\n\nYou have timestamps, you have UUIDs for each user, and you have the URL (or any other metadata you might need!). What you really want to do is divide the data up into 'sessions' - distinguishable blocks of browsing activity by a single user. For this we use `sessionise`, passing it the dataset, the column names for timestamps and user IDs, and a threshold - the number of seconds after which to decide a user has entered a new session. By default this is 3600 (1 hour):\n\n```\nsessionised_data \u003c- sessionise(session_dataset, \"timestamp\", \"uuid\")\n\nstr(sessionised_data)\n# 'data.frame':\t63524 obs. of  5 variables:\n#  $ uuid      : chr  \"0005839b3e8483d50870f61f50307fa7\" \"000b047bad36484451f12c114ab5eb28\" \"000b047bad36484451f12c114ab5eb28\" \"000b047bad36484451f12c114ab5eb28\" ...\n#  $ timestamp : POSIXlt, format: \"2014-01-14 12:47:59\" \"2014-01-07 14:25:11\" \"2014-01-09 12:47:17\" ...\n#  $ url       : chr  \"https://www.nasa.gov/history/apollo/images/footprint-logo.gif\" \"https://www.nasa.gov/ksc.html\" \"https://www.nasa.gov/biomed/threat/gif/beachmousefinsmall.gif\" \"https://www.nasa.gov/shuttle/resources/orbiters/atlantis.html\" ...\n#  $ session_id: chr  \"9c77ea18bbef377253be1b22957071c1\" \"eda2ec544d96f0f1e3271902cbb693b7\" \"ee6d08bdaf1fb3c28edd0ac3290b82f5\" \"ee6d08bdaf1fb3c28edd0ac3290b82f5\" ...\n#  $ time_delta: int  NA NA NA 45 4 75 274 47 NA 28 ...\n```\n\nThis adds two new columns - a unique ID for each session, and (for each event) the time elapsed between that event and the next one in a session.\n\nFrom this we can calculate a lot of commmon session-related metrics:\n\n```\n# Number of sessions per user\nsess_count \u003c- session_count(sessionised_data, \"uuid\")\nstr(sess_count)\n\n# 'data.frame':\t10000 obs. of  2 variables:\n#  $ user_id      : chr  \"0005839b3e8483d50870f61f50307fa7\" \"000b047bad36484451f12c114ab5eb28\" \"000b2bc1a5438d8d54d4fbec139a2fd5\" \"001b6e80a14ba8d809c4ff18cdbade40\" ...\n#  $ session_count: int  1 2 1 1 1 6 1 1 1 1 ...\n\n# Length of each session\nsess_length \u003c- session_length(sessionised_data)\nstr(sess_length)\n\n# 'data.frame':\t20820 obs. of  2 variables:\n#  $ session_id    : chr  \"0000664732878ba3409c138d4870a42d\" \"00029b1cd83040b8e14d7d65e057029e\" \"0002e5a2e75610bfb6c0598ea228a9d1\" \"00097364d131b6d6580d3c69a3e0a868\" ...\n#  $ session_length: int  0 62 101 0 83 7 3113 0 4071 0 ...\n\n# The 'bounce rate' (overall or per user!)\n\nsess_bounce \u003c- bounce_rate(sessionised_data)\nstr(sess_bounce)\n# num 18.9\n\nsess_bounce \u003c- bounce_rate(sessionised_data, \"uuid\")\nstr(sess_bounce)\n# 'data.frame':\t10000 obs. of  2 variables:\n#  $ user_id    : chr  \"0005839b3e8483d50870f61f50307fa7\" \"000b047bad36484451f12c114ab5eb28\" \"000b2bc1a5438d8d54d4fbec139a2fd5\" \"001b6e80a14ba8d809c4ff18cdbade40\" ...\n#  $ bounce_rate: num  100 14.3 0 100 100 ...\n\n# And many others\n```\n\n### Installation\n\nFor the current release version:\n\n    install.packages(\"reconstructr\")\n    \nFor the development version:\n\n    library(devtools)\n    install_github(\"ironholds/reconstructr\")\n    \n### Dependencies\n* R. Doy.\n* [Rcpp](https://cran.r-project.org/package=Rcpp)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironholds%2Freconstructr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fironholds%2Freconstructr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironholds%2Freconstructr/lists"}