#Load scotustext package
remotes::install_github("JakeTruscott/scotustext")
library(scotustext)

decision_processor

decision_processerserves as an automated tool for cleaning and parsing information from opinions at the United States Supreme Court. Implementation of the decision_processor() tool only requires a single parameter, dir_path, which provides a file path to the folder on your local machine containing opinions saved as PDFs.

NOTE: decision_processor() should work for any non-scanned decision PDF and is not restricted by term-specific conditions (e.g., the presence of particular justices, decisions, etc.).

However, this tool does not employ the use of Optical Character Recognition (OCR) software. As such, the tool can only process non-scanned PDF opinions.

Further, this tool is not capable of parsing US Reports Volumes. Functionality for these volumes will become available in future iterations of the package, though it should be capable of parsing opinions so long as any non-Opinion materials are removed from the Report volumes (e.g., preface, docket order, etc…)

decision_processor Variables

## [1] "argument"       "docket_id"      "published"      "text"
## [5] "footnotes"      "opinion_writer" "opinion_type"

NOTE: argument, docket_id, and published are retrived using metadata stored within the individual PDFs. PDFs without accompanying metadata will return NA for these terms.

decision_processor Examples

Below is an example of three decisions from the Court’s 2021 and 2022 terms:

The processor will provide a completion report that includes summary statistics for the processed decisions:

#Replace <FOLDER DIRECTORY> with Relevant File Path
decisions_sample <- decision_processor(dir_path = <FOLDER DIRECTORY>)
##
## Decisions to Process:  3
## Success!
##  - - - - - - - Summary - - - - - - -
## Completion Time:  1.08 Seconds
## Number of Unique Opinions:  3
## Number of Majority Opinions:  3
## Number of Dissents:  2
## Number of Concurrences:  5
## Number of Per Curiam:  0

Sample Text from Justice Kavanaugh’s Concurrence in Dobbs v. Jackson Women’s Health Clinic

## I write separately to explain my additional views about why Roe was wrongly decided, why Roe should be overruled at this time, and the future implications of today's decision. I Abortion is a profoundly difficult and contentious issue because it presents an irreconcilable conflict between the interests of a pregnant woman who seeks an abortion and the interests in protecting fetal life. The interests on both sides of the abortion issue are extraordinarily weighty. On the one side, many pro-choice advocates forcefully argue that the ability to obtain an abortion is critically important for women's personal and professional lives, and for women's health. They contend that the widespread availability of abortion has been essential for women to advance in society and to achieve greater equality over the last 50 years. And they maintain that women must have the freedom to choose for themselves whether to have an abortion. On the other side, many pro-life advocates forcefully argue that a fetus is a human life. They contend that all human life should be protected as a matter of human dignity and fundamental morality. And they stress that a significant percentage of Americans with pro-life views are women. When it comes to...

Footnotes from Justice Sotomayor’s Majority Opinion in Andy Warhol Foundation for Visual Arts, Inc. v. Goldsmith

## [1] A silkscreen is a fine mesh fabric used in screen printing. Warhol's  practice was to deliver a photograph to a professional silkscreen printer with instructions for alterations, such as cropping and high contrasting. 1 App. 160, 163. The latter alteration would "flatten" the image. Once Warhol approved, the printer would "reproduc[e]" the altered image "like a photographic negative onto the screen." Id., at 164. For canvas prints, Warhol "would then place the screen face down on the canvas, pour ink onto the back of the mesh, and use a squeegee to pull the ink through the weave and onto the canvas." Ibid. The resulting "high-contrast half-tone   impressions" served as an " 'under-drawing,' " over which Warhol painted colors by hand. Id., at 165.
##
## [2] AWF sold 12 of the works to collectors and galleries, and it transferred custody of the remaining four works to the Andy Warhol Museum in Pittsburgh.
##
## [3] The Court of Appeals considered not only the possibility of market  harm caused by the actions of AWF but also "whether 'unrestricted and widespread conduct of the sort engaged in by [AWF] would result in a substantially adverse impact on the potential market' " for the photograph, including the market for derivative works. 11 F. 4th 26, 49-50 (CA2 2021) (quoting Campbell v. Acuff-Rose Music, Inc., 510 U. S. 569, 590 (1994)); see also Harper & Row, Publishers, Inc. v. Nation Enterprises, 471 U. S. 539, 568 (1985).
##
## [4] Take a critical book review, for example. Not only does the review, as  a whole, serve a different purpose than the book; each quoted passage within the review likely serves a different purpose (as an object of criticism) than it does in the book. That may not always be so, however, and a court must consider each use within the whole to determine whether the copying is fair. W. Patry, Fair Use ?3:1, pp. 129-130 (2022).
##
## [5] In theory, the question of transformative use or transformative purpose can be separated from the question whether there has been transformation of a work. In practice, however, the two may overlap. Compare, e.g., Nunez v. Caribbean Int'l News Corp., 235 F. 3d 18, 21-23 (CA1   [2000]) (newspaper's reproduction, without alteration, of photograph of beauty pageant winner to explain controversy over whether her title should be withdrawn had transformative purpose because " 'the pictures were the story' "), with Leibovitz v. Paramount Pictures Corp., 137 F. 3d 109, 114-115 (CA2 1998) (film advertisement's alteration of well-known photograph by superimposing actor's face on actress' body had transformative purpose of parody).
##
## [6] The authors of the Copyright Act of 1976 included the language,  " 'whether such use is of a commercial nature or is for non-profit educational purposes,' " in the first fair use factor "to state explicitly" that, "as under the present law, the commercial or non-profit character of an activity, while not conclusive with respect to fair use, can and should be weighed along with other factors." H. R. Rep. No. 94-1476, p. 66 (1976).
##
## [7] Return to the example of a book review. The review's use of quoted  material may be justified in both the broad and the narrower senses. First, the use is likely to serve a different purpose than the material itself. See n. 4, supra. Second, there may be compelling reason to borrow from the original to achieve that purpose because the review targets the material for comment or criticism. But again, the question of justification will depend on the individual use or uses. See Patry, Fair Use ?3:1, at 129-130. Even book reviews are not entitled to a presumption of fairness. Campbell, 510 U. S., at 581.
##
## [8] Consider, for example, this Court's analysis of the first factor in  Google LLC v. Oracle America, Inc., 593 U. S. ___ (2021). Google stressed that "[t]he fact that computer programs are primarily functional makes it difficult to apply traditional copyright concepts in that technological world." Id., at ___ (slip op., at 35). Still, in evaluating the purpose and character of Google's use of Sun Microsystems' code, the Court looked, first, to whether the purpose of the use was significantly different from that of the original; and, second, to the strength of other justifications for the use. Although Google's use was commercial in nature, it copied Sun's code, which was "created for use in desktop and laptop computers," "only insofar as needed to include tasks that would be useful in smartphone[s]." Id., at ___ (slip op., at 26). That is, Google put Sun's code to use in the "distinct and different computing environment" of its own Android platform, a new system created for new products. Ibid. Moreover, the use was justified in that context because "shared interfaces are necessary for different programs to speak to each other" and because "reimplementation of interfaces is necessary if programmers are to be able to use their acquired skills." Ibid.; see also id., at ___ (slip op., at 8).
##
## [9] AWF sought a declaratory judgment that would cover the original  Prince Series works, but Goldsmith has abandoned all claims to relief other than her claim as to the 2016 Conde Nast license and her request for prospective relief as to similar commercial licensing. Brief for Respondents 3, 17-18; Tr. of Oral Arg. 80-82.
##
## [10] The dissent, however, focuses on a case that is not before the Court.  No, not whether Francis Bacon would have made fair use of Velasquez's painting, had American copyright law applied in Europe with a term of 300 years post mortem auctoris. But cf. post, at 32-34 (opinion of KAGAN, J.). Rather, Congress has directed courts to examine the purpose and character of the challenged "use." 17 U. S. C. ?107(1). Yet the dissent assumes that any and all uses of an original work entail the same firstfactor analysis based solely on the content of a secondary work. This assumption contradicts the fair use statute and this Court's precedents. See supra, at 20-21. Had AWF's use been solely for teaching purposes, that clearly would affect the analysis, and the statute permits no other conclusion. Preferring not to focus on the specific use alleged to infringe Goldsmith's copyright, the dissent begins with a sleight of hand, see post, at 1, n. 1, and continues with a false equivalence between AWF's commercial licensing and Warhol's original creation. The result is a series of misstatements and exaggerations, from the dissent's very first sen tence, post, at 1 ("Today, the Court declares that Andy Warhol's eye-popping silkscreen of Prince . . . is (in copyright lingo) not 'transformative' "), to its very last, post, at 36 ("[The majority opinion] will make our world poorer").
##
## [11] The Court of Appeals observed that the "purpose and function of the  two works at issue here is identical, not merely in the broad sense that they are created as works of visual art, but also in the narrow but essential sense that they are portraits of the same person." 11 F. 4th, at 42 (footnote omitted). This Court goes somewhat "further and examine[s] the copying's more specifically described 'purpose[s]' " in the context of the particular use at issue (here, in a magazine about Prince). Google, 593 U. S., at ___ (slip op., at 25). The Court does not define the purpose as simply "commercial" or "commercial licensing." Post, at 18, 20, n. 7, 25, n. 8 (KAGAN, J., dissenting). Nor does the Court view Goldsmith's photograph and Warhol's illustration as "fungible products in the magazine market." Post, at 18; see post, at 10. Rather, the Court finds significant the degree of similarity between the specific purposes of the original work and the secondary use at issue.     According to the dissent, the fact that a magazine editor might prefer one image to the other must mean the secondary use is transformative, either because it has a different aesthetic or conveys a different message. Post, at 10. The Court, because it fails to understand the difference, does not have "much of a future in magazine publishing," the dissent chides. Ibid. While the dissent is probably correct about the Court's business prospects, the editors of People, Rolling Stone, and Time chose a variety of different photos of Prince for their memorial issues. See fig. 5, supra. Portrait photos, in fact. Some black and white; some depicting Prince's " 'corporeality' "; some "realistic" or "humanistic." Post, at 9, 16 (KAGAN, J., dissenting). These variations in aesthetics did not stop the photos from serving the same essential purpose of depicting Prince in a magazine commemorating his life and career.     Fortunately, the dissent's "magazine editor" test does not have much of a future in fair use doctrine. The flaw in the dissent's logic is simple: If all that mattered under the first factor were whether a buyer was "drawn aesthetically" to a secondary work (instead of the pre-existing work it adapted) or whether the buyer preferred "to convey the message of " the secondary work, post, at 10, then every derivative work would qualify. The New Yorker might prefer an unauthorized sequel to a short story, rather than the original, but that does not mean the purpose and character of the use would weigh in its favor. Similarly, a rap label might prefer 2 Live Crew's song, rather than Orbison's original, based on the new sound and lyrics (i.e., new aesthetic and message), but that was not enough in Campbell, and it is not enough here.
##
## [12] In this way, the first factor relates to the fourth, market effect. See  Campbell, 510 U. S., at 591; cf. also Harper & Row, 471 U. S., at 568 ("The excerpts were employed as featured episodes in a story about the Nixon pardon-precisely the use petitioners had licensed to Time"). While the first factor considers whether and to what extent an original work and secondary use have substitutable purposes, the fourth factor focuses on actual or potential market substitution. Under both factors, the analysis here might be different if Orange Prince appeared in an art magazine alongside an article about Warhol. Brief for United States as Amicus Curiae 33.    While keenly grasping the relationship between The Two Lolitas, the dissent fumbles the relationship between the first and fourth fair use factors. Under today's decision, as before, the first factor does not ask whether a secondary use causes a copyright owner economic harm. Cf. post, at 21 (opinion of KAGAN, J.). There is, however, a positive association between the two factors: A secondary use that is more different in purpose and character is less likely to usurp demand for the original work or its derivatives, as the Court has explained, see Campbell, 519 U. S., at 591. This relationship should be fairly obvious. But see post, at 22 (KAGAN, J., dissenting) (suggesting that the first factor can favor only the user and the fourth factor only the copyright owner). Still, the relationship is not absolute. For example, copies for classroom use might fulfill demand for an original work. The first factor may still favor the copyist, even if the fourth factor is shown not to. At the same time, other forms of straight copying may be fair if a strong showing on the fourth factor outweighs a weak showing on the first.
##
## [13] The dissent misconstrues the role of commercialism in this analysis.  The Court does not hold that "[a]ll that matters is that [AWF] and the publisher entered into a licensing transaction"; or that the first-factor   inquiry "should disregard Warhol's creative contributions because he licensed his work"; or that an artist may not "market even a transformative follow-on work." Post, at 3, 19, 34 (opinion of KAGAN, J.). Instead, consistent with the statute, "whether [a] use is of a commercial nature or is for nonprofit educational purposes" is one element of the first factor, ?107(1); it does not dispose of that factor, much less the fair use inquiry. As this opinion makes clear, the commercial character of a secondary use should be weighed against the extent to which the use is transformative or otherwise justified. Supra, at 18 (citing Campbell, 510 U. S., at 579580, 585); see also supra, at 12, 19-20, and n. 8, 25; infra, at 34-35.
##
## [14] The dissent contends that the Court gives "little role" to "the key  term 'character.' " Post, at 19 (opinion of KAGAN, J.). This is somewhat puzzling, as the Court has previously employed "character" to encompass exactly what the dissent downplays: " 'the commercial or nonprofit character of an activity.' " Sony Corp. of America v. Universal City Studios, Inc., 464 U. S. 417, 448-449 (1984) (quoting H. R. Rep. No. 94-1476, at 66); see also Campbell, 510 U. S., at 572, 584-585 (repeatedly referring to "commercial character"). Rather than looking to this case law, the dissent looks up the word "character" in a dictionary. See post, at 13. But the dissent's preferred definition-"a thing's 'main or essential nature[,] esp[ecially] as strongly marked and serving to distinguish,' " post, at 20 (quoting Webster's Third New International Dictionary 376 (1976))-helps Goldsmith, not AWF. Even this definition does not support the implication that "character" is determined by any aesthetic distinctiveness, such as the addition of any new expression. Instead, it is the "main or essential nature" that must be "strongly marked and serv[e] to distinguish." So return to Orange Prince on the cover of the Conde Nast issue commemorating Prince, see fig. 5, supra, and ask, what is the main or essential nature of the secondary use of Goldsmith's photograph in that context?
##
## [15] The situation might be different if AWF licensed Warhol's Soup Cans  to a soup business to serve as its logo. That use would share much the same purpose of Campbell's logo, even though Soup Cans has some new meaning or message. This hypothetical, though fanciful, is parallel to the situation here: Both Goldsmith and AWF sold images of Prince (AWF's copying Goldsmith's) to magazines to illustrate stories about the celebrity, which is the typical use made of Goldsmith's photographs.
##
## [16] The dissent either does not follow, or chooses to ignore, this analysis.  The point is not simply that the Soup Cans series comments on consumer culture, similar to how Warhol's celebrity images comment on celebrity culture. Post, at 15 (opinion of KAGAN, J.). Rather, as the discussion makes clear, the degree of difference in purpose and character between Campbell's soup label and Warhol's painting is nearly absolute. Plus, Warhol's use targets Campbell's logo, at least in part. These features (which are absent in this case) strengthen Warhol's claim to fairness in copying that logo in a painting.
##
## [17] The dissent is stumped. Buried in a conclusory footnote, it suggests  that the fourth fair use factor alone takes care of derivative works like book-to-film adaptations. Post, at 12, n. 5. This idea appears to come from a Hail Mary lobbed by AWF when it got caught in the same bind. See Tr. of Oral Arg. 15-16. The Court is aware of no authority for the proposition that the first factor favors such uses (on the dissent's view, the first factor must, because the use modifies the expressive content of an original work), leaving it to the fourth factor to ensure that ?106(2) is not a dead letter. Certainly Google, which merely noted in passing that "[m]aking a film of an author's book may . . . mean potential or presumed losses to the copyright owner," did not hold as much. 593 U. S., at ___ (slip op., at 30); see id., at ___-___, ___-___ (slip op., at 24-28, 30-35).
##
## [18] The dissent makes a similar mistake with Google: It fails to read the  decision as a whole. So while the dissent claims that the "[Google] Court would have told this one to go back to school," it might be easier just to go back and read Google. Post, at 2 (opinion of KAGAN, J.). The Court did not hold that any secondary use that is innovative, in some sense, or that a judge or Justice considers to be creative progress consistent with the constitutional objective of copyright, is thereby transformative. The Court instead emphasized that Google used Sun's code in a "distinct and different" context, and "only insofar as needed" or "necessary" to achieve Google's new purpose. Google, 593 U. S., at ___ (slip op., at 26); see also n. 8, supra. In other words, the same concepts of use and justification that the Court relied on in Google are the ones that it applies today.
##
## [19] The dissent demonstrates the danger of this approach. On its view,  the first fair use factor favors AWF's use of Goldsmith's photograph simply because Warhol created worthy art. Goldsmith's original work, by contrast, is just an "old photo," one of Warhol's "templates." Post, at 2, 17 (opinion of KAGAN, J.). In other words, the dissent (much like the District Court) treats the first factor as determined by a single fact: "It's a Warhol." This Court agrees with the Court of Appeals that such logic would create a kind of privilege that has no basis in copyright law. See 11 F. 4th, at 43. Again, the Court does not deny that Warhol was a major figure in American art. But it leaves the worth of his works to the critics. Compare, e.g., D. Antin, Warhol: The Silver Tenement, in Pop Art: A  Critical History 287 (S. Madoff ed. 1997), with R. Hughes, The Shock of the New 346-351 (2d ed. 1991). Whatever the contribution of Orange Prince, Goldsmith's photograph is part of that contribution. A court need not, indeed should not, assess the relative worth of two works to decide a claim of fair use. Otherwise, "some works of genius would be sure to miss appreciation," and, "[a]t the other end, copyright would be denied to [works] which appealed to a public less educated than the judge." Bleistein, 188 U. S., at 251-252 (Holmes, J.). That Goldsmith's photograph "had [its] worth and [its] success is sufficiently shown by the desire to reproduce [it] without regard to [her] rights." Id., at 252.
##
## [20] At no point in this litigation has AWF maintained that any of the  Prince Series works, let alone Orange Prince on the cover of the 2016 Conde Nast special edition, comment on, criticize, or otherwise target Goldsmith's photograph. That makes sense, given that the photograph was unpublished when Goldsmith licensed it to Vanity Fair, and that neither Warhol nor Vanity Fair selected the photograph, which was instead provided by Goldsmith's agency.
##
## [21] The dissent wonders: Why does targeting matter? See post, at 24  (opinion of KAGAN, J.). The reason, as this opinion explains, is the first factor's attention to justification. Supra, at 17-20, and nn. 7-8, 29-30, and n. 18 (citing Campbell, 510 U. S., at 580-581; Google, 593 U. S., at ___ (slip op., at 26)). Compare, for example, a film adaptation of Gone With the Wind with a novel, The Wind Done Gone, that "inverts" the original's "portrait of race relations" to expose its "romantic, idealized" portrayal of the antebellum South. SunTrust Bank v. Houghton Mifflin Co., 268 F. 3d 1257, 1270 (CA11 2001); id., at 1280 (Marcus, J., specially concurring). Or, to build from one of the artistic works the dissent chooses to feature, consider a secondary use that borrows from Manet's Olympia to shed light on the original's depiction of race and sex. See R. Storr & C. Armstrong, Lunch With Olympia (2016). Although targeting is not always required, fair use is an affirmative defense, and AWF bears the burden to justify its taking of Goldsmith's work with some reason other than, "I can make it better."
##
## [22] The dissent oddly suggests that under the Court's opinion, the first  fair use factor favors such uses. See post, at 12, n. 5. This ignores, well, pretty much the entire opinion. See supra, at 14-17, 22-24, 26-27, 2829, 32-33 (degree of difference in purpose and character); supra, at 18, 24 (commercial nature); supra, at 17-19, 27, 30, 34-35 (justification). In particular, the Court does not hold that the first factor favors any user who "wants to reach different buyers, in different markets, consuming different products." Post, at 13, n. 5 (opinion of KAGAN, J.). The dissent apparently deduces this proposition from its inverse, which is a common logical fallacy.