Skip to main content

Parsing and Analyzing Hamlet

  • Chapter
  • First Online:
Text Analysis with R

Abstract

In this chapter, we leverage the rich metadata available in XML and the power of dplyr to explore the interaction of speakers in a classic drama.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 89.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    In his book Computation into Criticism, Burrows (1987) explores how the gender of characters in Jane Austen’s novels are marked by certain habits of speech.

  2. 2.

    Since speeches_ns is a type of list, you can access the contents of the first node by entering speeches_ns[[1]] at the console prompt.

  3. 3.

    If we omit the call to rowwise, we end up with the total word count of all words appearing in every row.

  4. 4.

    When you run the code below you will get a warning that “Grouping rowwise data frame strips rowwise nature.” Warnings in R, unlike errors, mean that your code still ran successfully. The warning is there to tell you that something unexpected might have happened. In this case, we can ignore the warning.

References

  • Burrows JF (1987) Computation into Criticism: A Study of Jane Austen’s Novels. Oxford University Press, Oxford

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

L. Jockers, M., Thalken, R. (2020). Parsing and Analyzing Hamlet . In: Text Analysis with R. Quantitative Methods in the Humanities and Social Sciences. Springer, Cham. https://doi.org/10.1007/978-3-030-39643-5_13

Download citation

Publish with us

Policies and ethics