Trademarks from the Oregon Secretary of State
Oregon’s Open Data Portal
The Oregon Open Data Portal has a bunch of easily accessible public use data. One of the first listings today was trademarks issued by the Oregon Secretary of State. Let’s grab that data.
OTM <- read.socrata('https://data.oregon.gov/resource/ny3n-dx3v.json')
head(OTM)
## registration_number registration_date
## 1 102 1968-03-15
## 2 103 1968-03-15
## 3 272 1970-10-26
## 4 3606 1935-02-01
## 5 3957 1936-04-21
## 6 4020 1936-08-29
## trademark_description
## 1 "SR" MONOGRAM
## 2 "SUNRIVER"
## 3 G.I. TYPE CHARACTER OF A MAN WITH A JARHEAD - TAKE OFF OF A MARINE
## 4 "PYREX"
## 5 "CORNING"
## 6 "MOLY-KROME"
## correspondent_name address1 city
## 1 SUNRIVER RESORT LIMITED PARTNERSHIP 11777 SAN VICENTE STE 900 LOS ANGELES
## 2 SUNRIVER RESORT LIMITED PARTNERSHIP 11777 SAN VICENTE STE 900 LOS ANGELES
## 3 ROBERT C WICKMAN 720 MENLO DRIVE N SALEM
## 4 MICHELE N KEEFER-MEHLENBACHER CORNING INCORPORATED CORNING
## 5 MICHELE N KEEFER-MEHLENBACHER CORNING INCORPORATED CORNING
## 6 PACIFIC MACHINERY & TOOL STEEL CO 3445 NW LUZON ST PORTLAND
## state zip
## 1 CA 90049
## 2 CA 90049
## 3 OR 97303
## 4 NY 14831
## 5 NY 14831
## 6 OR 97210
## url
## 1 http://records.sos.state.or.us/ORSOSWebDrawer/Record?q=recTitle%3A102+And+recContainer%3ACRF/2&sortBy=recCreatedOn-
## 2 http://records.sos.state.or.us/ORSOSWebDrawer/Record?q=recTitle%3A103+And+recContainer%3ACRF/2&sortBy=recCreatedOn-
## 3 http://records.sos.state.or.us/ORSOSWebDrawer/Record?q=recTitle%3A272+And+recContainer%3ACRF/2&sortBy=recCreatedOn-
## 4 http://records.sos.state.or.us/ORSOSWebDrawer/Record?q=recTitle%3A3606+And+recContainer%3ACRF/2&sortBy=recCreatedOn-
## 5 http://records.sos.state.or.us/ORSOSWebDrawer/Record?q=recTitle%3A3957+And+recContainer%3ACRF/2&sortBy=recCreatedOn-
## 6 http://records.sos.state.or.us/ORSOSWebDrawer/Record?q=recTitle%3A4020+And+recContainer%3ACRF/2&sortBy=recCreatedOn-
## address2
## 1 <NA>
## 2 <NA>
## 3 <NA>
## 4 SP-TI-3-1
## 5 SP-TI-3-1
## 6 <NA>
I want to plot the copyrights by state of holder. Let’s look at that variable.
library(janitor) # for tabyl
##
## Attaching package: 'janitor'
## The following objects are masked from 'package:stats':
##
## chisq.test, fisher.test
OTM %>% tabyl(state)
## state n percent valid_percent
## 0R 1 0.0002203128 0.0002208968
## AK 1 0.0002203128 0.0002208968
## AL 2 0.0004406257 0.0004417937
## AZ 3 0.0006609385 0.0006626905
## CA 166 0.0365719321 0.0366688756
## CO 30 0.0066093853 0.0066269052
## CT 2 0.0004406257 0.0004417937
## DC 21 0.0046265697 0.0046388337
## FL 20 0.0044062569 0.0044179368
## GA 9 0.0019828156 0.0019880716
## HI 3 0.0006609385 0.0006626905
## IA 4 0.0008812514 0.0008835874
## ID 24 0.0052875083 0.0053015242
## IL 24 0.0052875083 0.0053015242
## KS 2 0.0004406257 0.0004417937
## LA 4 0.0008812514 0.0008835874
## MA 8 0.0017625028 0.0017671747
## MI 12 0.0026437541 0.0026507621
## MN 11 0.0024234413 0.0024298653
## MO 6 0.0013218771 0.0013253810
## MT 5 0.0011015642 0.0011044842
## NC 7 0.0015421899 0.0015462779
## ND 1 0.0002203128 0.0002208968
## NE 2 0.0004406257 0.0004417937
## NF 1 0.0002203128 0.0002208968
## NH 1 0.0002203128 0.0002208968
## NJ 14 0.0030843798 0.0030925558
## NM 5 0.0011015642 0.0011044842
## NV 3 0.0006609385 0.0006626905
## NY 29 0.0063890725 0.0064060084
## O 1 0.0002203128 0.0002208968
## OH 15 0.0033046927 0.0033134526
## OR 3801 0.8374091210 0.8396288933
## OR 97205 1 0.0002203128 0.0002208968
## OR 97530 1 0.0002203128 0.0002208968
## OROR 1 0.0002203128 0.0002208968
## ORQ 1 0.0002203128 0.0002208968
## PA 11 0.0024234413 0.0024298653
## TX 21 0.0046265697 0.0046388337
## UT 11 0.0024234413 0.0024298653
## VA 8 0.0017625028 0.0017671747
## WA 232 0.0511125799 0.0512480672
## WI 2 0.0004406257 0.0004417937
## <NA> 12 0.0026437541 NA
There are a few to clean up. I will use recode to do that for many of them and split out the junk text from those that have some.
( OTM %>%
mutate(state = recode(state,
`0R` = "OR",
`O` = "OR",
`OROR` = "OR",
`ORQ` = "OR")) %>%
mutate(state2 = str_split(state, " ", simplify=TRUE)) %>%
filter(state2!="NA") %>%
janitor::tabyl(state2) -> ORTM.Data )
## state2 n percent
## AK 1 0.0002208968
## AL 2 0.0004417937
## AZ 3 0.0006626905
## CA 166 0.0366688756
## CO 30 0.0066269052
## CT 2 0.0004417937
## DC 21 0.0046388337
## FL 20 0.0044179368
## GA 9 0.0019880716
## HI 3 0.0006626905
## IA 4 0.0008835874
## ID 24 0.0053015242
## IL 24 0.0053015242
## KS 2 0.0004417937
## LA 4 0.0008835874
## MA 8 0.0017671747
## MI 12 0.0026507621
## MN 11 0.0024298653
## MO 6 0.0013253810
## MT 5 0.0011044842
## NC 7 0.0015462779
## ND 1 0.0002208968
## NE 2 0.0004417937
## NF 1 0.0002208968
## NH 1 0.0002208968
## NJ 14 0.0030925558
## NM 5 0.0011044842
## NV 3 0.0006626905
## NY 29 0.0064060084
## OH 15 0.0033134526
## OR 3807 0.8409542744
## PA 11 0.0024298653
## TX 21 0.0046388337
## UT 11 0.0024298653
## VA 8 0.0017671747
## WA 232 0.0512480672
## WI 2 0.0004417937
That should get me what I need. Now to plot it, sorted from most to least.
ORTM.Data %>% ggplot() +
aes(x=fct_reorder(state2, n), y=n, fill=state2) +
geom_col() +
guides(fill="none") +
coord_flip() +
labs(title="Trademarks Issued by OR SOS", x="State", y='Trademarks', caption="https://data.oregon.gov/resource/ny3n-dx3v.json")