email_to_orgs: Match emails to social organizations

Description Usage Arguments Examples

View source: R/email_to_orgs.R

Description

This function matches users to organizations based on their email domains and/or sub-domains. For example, users with domains ending in "virginia.edu" will be matched to the "university of virginia". This function has been integrated as an optional parameter alongside the email_to_sectors() function in the detect_orgs() function.

Usage

1
2
3
4
5
6
7
email_to_orgs(
  data,
  id,
  input,
  output,
  sector = c("academic", "business", "government", "nonprofit")
)

Arguments

data

A data frame or data frame extension (e.g. a tibble).

id

A numeric or character vector unique to each entry.

input

Character vector of emails or email domains that will be matched to organizations from one (or all) of five economic sectors (see sector parameter).

output

Output column to be created as string or symbol.

sector

Sector to match by organizations. Currently, the only option is "academic" with "business", "government", "household", and "nonprofit" in development.

Examples

1
2
3
4
5
6
library(tidyverse)
library(tidyorgs)
data(github_users)

classified_by_email <- github_users %>%
  email_to_orgs(login, email, organization, academic)

brandonleekramer/tidyorgs documentation built on Dec. 19, 2021, 11:42 a.m.