knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/" )
All the texts of Denis de Rougemont's books
The package rougemont gives access to all the texts of Denis de Rougemont's books including republications, at the exception of The Heart of Europe (1941) and The Christian Opportunity (1963), in a Tidy format, taken from the digital books library of the Rougemont 2.0 project from the University of Geneva.
Learn more about the Rougemont 2.0 project of the University of Geneva here.
Install the package from Github.
# install.packages("remotes") remotes::install_github("lgnbhl/rougemont")
Overview of the rougemont
dataset.
library(dplyr) library(rougemont) as_tibble(rougemont)
First lines of Denis de Rougemont's Les Méfaits de l’Instruction publique (1929).
rougemont$text[1:4]
The metadata of the Rougemont 2.0 project is also accessible.
rougemont_metadata
The data is structured in a tidy way, in order to ease the use of packages such as tidytext
.
For example, let's calculate the tf-idf to discover what are the most important (i.e. common) words for the content of four selected books of Denis de Rougemont.
library(tidytext) library(ggplot2) rougemont %>% filter(title_book %in% c("Politique de la personne (1946)", "Vingt-huit siècles d’Europe (1961)", "La Suisse ou l’histoire d’un peuple heureux (1965)", "L’Amour et l’Occident (1972)")) %>% unnest_tokens(word, text) %>% count(title_book, word) %>% bind_tf_idf(word, title_book, n) %>% group_by(title_book) %>% top_n(15, tf_idf) %>% ungroup() %>% mutate(word = reorder(word, tf_idf)) %>% ggplot(aes(word, tf_idf, fill = title_book)) + geom_col(show.legend = FALSE) + labs(x = NULL, y = "tf-idf") + facet_wrap(~title_book, ncol = 2, scales = "free") + coord_flip()
The eRougemont Github project is accessible here.
This package is in no way officially endorsed by the University of Geneva.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.