Description Usage Arguments Value Examples
View source: R/visualizePatentData.R
Tile plot an x and y variable by facet z.
Tile plots are a a great way to show a dense amount of information in one plot sequence. Plotting document count by category, and plotting by assignee, is one example.
1 2 |
df |
A data frame of the cleaned data you want to plot. |
xVal |
A character string of the x value you want for your plot, must be a
name of the header in |
fillVal |
A character string of the fill value you want for your plot, must be a
name of the header in |
facetVal |
A character string of the facet you want for your plot, must be a
name of the header 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 ggplot2 plot object.
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 26 27 28 29 30 31 32 | ## Not run:
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)
category <- c("system","control algorithm","product","control system", "communication")
c <- round(rnorm(dim(sumo)[1],mean=2.5,sd=1.5))
c[c>5] <- 5; c[c<1] <- 1
sumo$category <- category[c]
xVal = "category"
fillVal = "score"
facetVal = "assigneeSmall"
facetPlot(subset(sumo, score > 0), xVal, fillVal, facetVal, colors = patentr::scoreColors,
recolor = FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.