{"id":16572892,"url":"https://github.com/coatless/bigquery-reddit-ask-your-advisor","last_synced_at":"2026-04-20T07:32:21.161Z","repository":{"id":89518580,"uuid":"157561645","full_name":"coatless/bigquery-reddit-ask-your-advisor","owner":"coatless","description":"Analysis code that counts instances of a phrase on Reddit (e.g. \"ask your advisor\")","archived":false,"fork":false,"pushed_at":"2018-11-14T16:57:46.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-13T09:54:45.901Z","etag":null,"topics":["ask-your-advisor","bigquery","r","reddit"],"latest_commit_sha":null,"homepage":"","language":null,"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/coatless.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"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":"2018-11-14T14:33:32.000Z","updated_at":"2024-09-30T21:37:39.000Z","dependencies_parsed_at":"2024-06-16T01:15:59.373Z","dependency_job_id":null,"html_url":"https://github.com/coatless/bigquery-reddit-ask-your-advisor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coatless/bigquery-reddit-ask-your-advisor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless%2Fbigquery-reddit-ask-your-advisor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless%2Fbigquery-reddit-ask-your-advisor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless%2Fbigquery-reddit-ask-your-advisor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless%2Fbigquery-reddit-ask-your-advisor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coatless","download_url":"https://codeload.github.com/coatless/bigquery-reddit-ask-your-advisor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless%2Fbigquery-reddit-ask-your-advisor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32037860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ask-your-advisor","bigquery","r","reddit"],"created_at":"2024-10-11T21:28:50.091Z","updated_at":"2026-04-20T07:32:21.147Z","avatar_url":"https://github.com/coatless.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: 'Overview of Reddit Users Using Phrase'\nauthor: \"JJB\"\ndate: \"11/14/2018\"\noutput: md_document\n---\n\n# Obtain Data\n\nRun on [Google BigQuery](https://console.cloud.google.com/bigquery).\n\n```sql\nSELECT author, body\nFROM `fh-bigquery.reddit_comments.20*`\nWHERE subreddit = 'UIUC'\nAND REGEXP_CONTAINS(body, r'(?i)ask your advisor')\n```\n\nSave data as a CSV. The data used for this analysis can be found in the [`data/`](data/) folder.\n\n# Post processing\n\nOnce we have the data, let's bring it into _R_.\n\n```{r}\n# Load in the Data\ncomments = read.csv(\"data/results-20181114-075107.csv\")\n```\n\n## User Overview\n\nLet's quickly take a peak at the different contributors using this phrase.\n\n```{r}\n# Figure out user counts\ncount_users = table(comments$author)\n\n# Number of Unique Users\nn_users_unique = length(count_users)\n\n# Obtain a leaderboard of comments.\ntop_users = sort(count_users, decreasing = TRUE)\n\n# Get name\ntop_username = names(top_users)[1]\ntop_user_posts =  top_users[1]\n\n```\n\n```{r echo = FALSE}\nformat_reddit_username = function(user) {\n  paste0(\"[/u/\", user,\"](https://reddit.com/u/\", user, \")\")\n}\n```\n\n\nThere were **`r n_users_unique`** of users who used a variation of the phrase\n\"Ask your advisor\". The user with the highest amount of comments was \n**`r format_reddit_username(top_username)`** who had **`r top_user_posts`**.\n\nAll users with at least 4 posts containing the phrase are listed next in a\ndescending order.\n\n```{r, echo = FALSE}\ncream_of_crop = as.data.frame(top_users[top_users \u003e= 4])\nnames(cream_of_crop) = c(\"Username\", \"Frequency\")\n# Generate knitr table\nknitr::kable(cream_of_crop)\n```\n\n## Amount of Words Used Per Post\n\n```{r message=FALSE}\n# Figure out user counts\nlibrary(\"dplyr\")\n\ncomments %\u003e%\n  group_by(author) %\u003e%\n  summarise(mean_nwords = mean(stringr::str_count(body, \"\\\\S+\")),\n            n_entries = n()) %\u003e%\n  arrange(desc(n_entries), desc(mean_nwords)) %\u003e%\n  filter(n_entries \u003e= 4) %\u003e%\n  knitr::kable()\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatless%2Fbigquery-reddit-ask-your-advisor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoatless%2Fbigquery-reddit-ask-your-advisor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatless%2Fbigquery-reddit-ask-your-advisor/lists"}