{"id":13666011,"url":"https://github.com/trinker/lexr","last_synced_at":"2026-02-13T23:36:29.575Z","repository":{"id":146663746,"uuid":"42079700","full_name":"trinker/lexr","owner":"trinker","description":null,"archived":false,"fork":false,"pushed_at":"2017-04-11T02:49:46.000Z","size":904,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-03T20:59:21.749Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinker.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS","contributing":null,"funding":null,"license":null,"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":"2015-09-07T23:50:02.000Z","updated_at":"2017-04-11T02:43:45.000Z","dependencies_parsed_at":"2023-04-14T16:17:55.313Z","dependency_job_id":null,"html_url":"https://github.com/trinker/lexr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trinker/lexr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinker%2Flexr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinker%2Flexr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinker%2Flexr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinker%2Flexr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinker","download_url":"https://codeload.github.com/trinker/lexr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinker%2Flexr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29423536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"ssl_error","status_checked_at":"2026-02-13T22:20:49.838Z","response_time":78,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-08-02T06:00:55.545Z","updated_at":"2026-02-13T23:36:29.556Z","avatar_url":"https://github.com/trinker.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\ntitle: \"lexr\"\ndate: \"`r format(Sys.time(), '%d %B, %Y')`\"\noutput:\n  md_document:\n    toc: true      \n---\n\n```{r, echo=FALSE}\ndesc \u003c- suppressWarnings(readLines(\"DESCRIPTION\"))\nregex \u003c- \"(^Version:\\\\s+)(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\"\nloc \u003c- grep(regex, desc)\nver \u003c- gsub(regex, \"\\\\2\", desc[loc])\nverbadge \u003c- sprintf('\u003ca href=\"https://img.shields.io/badge/Version-%s-orange.svg\"\u003e\u003cimg src=\"https://img.shields.io/badge/Version-%s-orange.svg\" alt=\"Version\"/\u003e\u003c/a\u003e\u003c/p\u003e', ver, ver)\n````\n\n[![Build Status](https://travis-ci.org/trinker/lexr.svg?branch=master)](https://travis-ci.org/trinker/lexr)\n[![Coverage Status](https://coveralls.io/repos/trinker/lexr/badge.svg?branch=master)](https://coveralls.io/r/trinker/lexr?branch=master)\n`r verbadge`\n\n![](tools/lexr_logo/r_lexr.png)\n\n```{r, echo=FALSE}\nlibrary(knitr)\nknit_hooks$set(htmlcap = function(before, options, envir) {\n  if(!before) {\n    paste('\u003cp class=\"caption\"\u003e\u003cb\u003e\u003cem\u003e',options$htmlcap,\"\u003c/em\u003e\u003c/b\u003e\u003c/p\u003e\",sep=\"\")\n    }\n    })\nknitr::opts_knit$set(self.contained = TRUE, cache = FALSE)\nknitr::opts_chunk$set(fig.path = \"tools/figure/\")\n```\n\n**lexr** is an R package designed to quickly make lexical dispersion plots.  The user will typically be interested in the `lexical_dispersion_plot` function.\n\n# Installation\n\nTo download the development version of **lexr**:\n\nDownload the [zip ball](https://github.com/trinker/lexr/zipball/master) or [tar ball](https://github.com/trinker/lexr/tarball/master), decompress and run `R CMD INSTALL` on it, or use the **pacman** package to install the development version:\n\n```r\nif (!require(\"pacman\")) install.packages(\"pacman\")\npacman::p_load_gh(\"trinker/lexr\")\n```\n\n# Contact\n\nYou are welcome to:\n* submit suggestions and bug-reports at: \u003chttps://github.com/trinker/lexr/issues\u003e\n* send a pull request on: \u003chttps://github.com/trinker/lexr/\u003e\n* compose a friendly e-mail to: \u003ctyler.rinker@gmail.com\u003e\n\n# Examples\n\nA collection of different lexical dispersion plots made with **lexr** + **qdap** packages.\n\n```{r}\nif (!require(\"pacman\")) install.packages(\"pacman\"); library(pacman)\np_load(qdap, lexr)\n\nterm_match(raj$dialogue, c(\" love \", \"love\", \" night \", \"night\"))\nlexical_dispersion_plot(raj$dialogue, c(\" love \", \"love\", \" night \", \"night\"))\nlexical_dispersion_plot(raj$dialogue, c(\"love\", \"night\"), rm.var =raj$act)\nwith(rajSPLIT , lexical_dispersion_plot(dialogue, c(\"love\", \"night\"),\n    grouping.var = list(fam.aff, sex), rm.var =act))\n\n## With grouping variables\nwith(rajSPLIT , lexical_dispersion_plot(dialogue, c(\"love\", \"night\"),\n     grouping.var = sex, rm.var =act))\n\n## Drop total with `total.color = NULL`\nwith(rajSPLIT , lexical_dispersion_plot(dialogue, c(\"love\", \"night\"),\n     grouping.var = sex, rm.var =act, total.color = NULL))\n\n## Change color scheme\nwith(rajSPLIT, lexical_dispersion_plot(dialogue, c(\"love\", \"night\"),\n    bg.color = \"black\", grouping.var = list(fam.aff, sex),\n    color = \"yellow\", total.color = \"white\", horiz.color=\"grey20\"))\n\n## Use `word_list`\n## Presidential debates by all\nwrds \u003c- word_list(pres_debates2012$dialogue, stopwords = Top200Words)\nwrds2 \u003c- spaste(wrds[[\"rfswl\"]][[\"all\"]][, \"WORD\"])\nwrds2 \u003c- c(\" governor romney \", wrds2[-c(3, 12)])\nwith(pres_debates2012 , lexical_dispersion_plot(dialogue, wrds2, , time))\n\n## Presidential debates by person\ndat \u003c- pres_debates2012\ndat \u003c- dat[dat$person %in% qcv(ROMNEY, OBAMA), ]\n\nwordlist \u003c- c(\" tax\", \" health\", \" rich \", \"america\", \" truth\",\n    \" money\", \"cost\", \" governnor\", \" president\", \" we \",\n    \" job\", \" i \", \" you \", \" because \", \" our \", \" years \")\n```\n\n\n```{r, fig.height=12}\nwith(dat, lexical_dispersion_plot(dialogue, wordlist, total.color = NULL,\n    grouping.var = person, time, bg.color = \"white\",\n    color = \"black\", horiz.color=\"grey80\"))\n\nwordlist2 \u003c- c(\" i'd \", \" i'll \", \" i'm \", \" i've \", \" i \",\n    \" we'd \", \" we'll \", \" we're \", \" we've \", \" we \",\n    \" you'd \",  \" you'll \", \" you're \", \" you've \", \" you \", \" your \",\n    \" he'd \", \" he'll \", \" he's \", \" he \")\n\nwith(dat, lexical_dispersion_plot(dialogue, wordlist2,\n    grouping.var = person, time, bg.color = \"black\",\n    color = \"yellow\", total.color = NULL, horiz.color=\"grey20\"))\n\nwith(dat, lexical_dispersion_plot(dialogue, wordlist2, \n    grouping.var = person, time, bg.color = \"black\",\n    color = \"red\", total.color = \"white\", horiz.color=\"grey20\"))\n\n## `match.terms` as a named list\nwordlist3 \u003c- list(\n    I = c(\" i'd \", \" i'll \", \" i'm \", \" i've \", \" i \"),\n    we = c(\" we'd \", \" we'll \", \" we're \", \" we've \", \" we \"),\n    you = c(\" you'd \",  \" you'll \", \" you're \", \" you've \", \" you \", \" your \"),\n    he = c(\" he'd \", \" he'll \", \" he's \", \" he \")\n)\n\n```\n\n```{r, fig.height = 5.8}\nwith(dat, lexical_dispersion_plot(dialogue, wordlist3,\n    grouping.var = person, time, bg.color = \"grey60\",\n    color = \"blue\", total.color = \"grey40\", horiz.color=\"grey20\"))\n```\n\n\n## Discourse Markers\n\nSchiffrin, D. (2001). Discourse markers: Language, meaning, and context.     \n  In D. Schiffrin, D. Tannen, \u0026 H. E. Hamilton (Eds.), The handbook of     \n  discourse analysis (pp. 54-75). Malden, MA: Blackwell Publishing.     \n\n```{r}\ndiscoure_markers \u003c- list(\n    response_cries = c(\" oh \", \" ah \", \" aha \", \" ouch \", \" yuk \"),\n    back_channels = c(\" uh-huh \", \" uhuh \", \" yeah \"),\n    summons = \" hey \",\n    justification = \" because \"\n)\n\n(markers \u003c- with(pres_debates2012,\n    termco(dialogue, list(person, time), discoure_markers)\n))\nplot(markers, high=\"red\")\n\n\nwith(pres_debates2012,\n    lexical_dispersion_plot(dialogue, discoure_markers, person, time)\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinker%2Flexr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinker%2Flexr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinker%2Flexr/lists"}