Description Usage Arguments Value See Also Examples
View source: R/visualizePatentData.R
Plot a flipped histogram with fill values.
Often times, you want to plot a histogram showing patent documents faceted by one value and filled by another.
1 2 | flippedHistogram(df, xVal, fillVal, colors = patentr::scoreColors,
recolor = FALSE)
|
df |
The original data frame of patent data |
xVal |
A character value of a name in |
fillVal |
A character value of a name in |
colors |
A character vector of colors, the same length as the number of
unique values in the column of |
recolor |
A logical allowing you to choose to recolor the plot if the
colors vector is not applicable to you. Default set to |
A plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | sumo <- cleanPatentData(patentData = patentr::acars, columnsExpected = sumobrainColumns,
cleanNames = sumobrainNames,
dateFields = sumobrainDateFields,
dateOrders = sumobrainDateOrder,
deduplicate = TRUE,
cakcDict = patentr::cakcDict,
docLengthTypesDict = patentr::docLengthTypesDict,
keepType = "grant",
firstAssigneeOnly = TRUE,
assigneeSep = ";",
stopWords = patentr::assigneeStopWords)
# note that in reality, you need a patent analyst to carefully score
# these patents, the score here is for demonstrational purposes
score <- round(rnorm(dim(sumo)[1],mean=1.4,sd=0.9))
score[score>3] <- 3
score[score<0] <- 0
sumo$score <- score
sumo$assigneeSmall <- strtrim(sumo$assigneeClean,12)
flippedHistogram(sumo, "assigneeSmall","score",colors=scoreColors)
flippedHistogram(subset(sumo, score > 0), "assigneeSmall","score",colors=scoreColors)
flippedHistogram(subset(sumo, score > 2) ,"score","assigneeSmall",colors=scoreColors,
recolor = TRUE)
flippedHistogram(subset(sumo, score > 2) ,"assigneeSmall","docType",colors=scoreColors,
recolor = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.