-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
75 lines (57 loc) · 2.24 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
68
69
70
71
72
73
74
75
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# leninature <img src='man/figures/leninsticker_tiny.png' align="right"/>
<!-- badges: start -->
<!-- badges: end -->
The goal of this package is to make it easy to query and analyse the
works of Lenin.
If you would prefer to work with Lenin’s work in their original Russian, please
see [leninism](https://github.com/alicirce/leninism). 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/leninature")
```
Then, simply load the package and play around with the available data frame,
`leninru`
```{r example}
library(leninature)
library(dplyr, warn.conflicts = FALSE)
lenin %>%
head() %>%
mutate(text = substring(text, 1, 30)) # for nicer README printing
```
## From Scratch
If you would like to run the data compilation scripts yourself from scratch, you
will need to download the texts from the Marxists Internet Archive (MIA). MIA
provides instructions for (respectfully) downloading portions of their archives
in their [FAQ](https://www.marxists.org/admin/janitor/faq.htm#hdd).
The scripts in `data-raw` assume you have already run the following commands.
You will also need to have your working directory appropriately set.
```{bash eval=FALSE}
mkdir lenin
cd lenin
wget -mpnp -nH -N -t 3 -w .5 https://www.marxists.org/archive/lenin/by-title.htm
```
This took me about 2.5 hours to pull, but others have reported it taking
substantially longer. If your command is interrupted, you can restart it again.
## 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 text file:
```{r eval = FALSE}
library(leninature)
write.csv(lenin, "lenin.csv", row.names = FALSE)
```