extractCountryCode: Extract the country code from a vector string of document...

Description Usage Arguments Value Examples

View source: R/cleanPatentData.R

Description

Extract the country code from a patent document number, which is the first two to four letters in a patent document number.

For example, if a patent number is US8880270, the country code is US. In rare cases, we have more than two letters. Typical country codes are US (United States), EP (Europe), JP (Japan), and WO (World, meaning a PCT application).

Usage

1

Arguments

docNum

The character vector of document numbers.

Value

A character vector of the same length inputted, with 2-4 characters representing the country code of the ptaent document.

Examples

1
2
3
# create a new column called countryCode in the acars data set
acars$countryCode <- extractCountryCode(acars$docNum)
head(acars[,c("docNum","countryCode")])

kamilien1/patentr documentation built on May 20, 2019, 7:19 a.m.