-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
67 lines (49 loc) · 1.83 KB
/
README.Rmd
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE
)
```
# leninism
<!-- badges: start -->
<!-- badges: end -->
The goal of leninism is to provide the works of Lenin in the original Russian
in which they were written in an analysis-ready format.
If you would prefer to work with Lenin's work in English, please see
[leninature](https://github.com/alicirce/leninature). These databases are not
fully comparable; some documents may be present in one and not in the other.
# Getting started
## The Easy Way
If you would like to use the tidy data in the format provided, simply install
this package from github using devtools:
```{r eval=FALSE}
devtools::install_github("alicirce/leninism")
```
Then, simply load the package and play around with the available data frame,
`leninru`
```{r example}
library(leninism)
library(dplyr, warn.conflicts = FALSE)
leninru %>%
head(10) %>%
mutate(text = substring(text, 1, 30)) # for nicer README printing
```
## For Experts
If you would like to run the data compilation scripts yourself from scratch, you
will need to download calibre, an open source and freely available epub editing
tool.
The scripts in `data-raw` will download eBooks (FictionBook format) from
[leninism.su](leninism.su), convert them to epub, read them into R, and tidy
the data into a more usable data frame.
## I don't want to use R
If you'd like the tidied data available in this package, but would prefer to use
another language to perform your analysis, assuming you have R installed and
you've downloaded this package from github using the code above, you can run the
following lines to export the data as a CSV file:
```{r eval = FALSE}
library(leninism)
write.csv(leninru, "lenin_ru.csv", row.names = FALSE)
```