-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
109 lines (76 loc) · 3.2 KB
/
README.Rmd
File metadata and controls
109 lines (76 loc) · 3.2 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
message = FALSE
)
```
# clessnverse
<!-- badges: start -->
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=wikiverse)
[](https://github.com/clessn/clessnverse/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
clessnverse contains functions for data domestication, analysis and visualization along with functions specific to the research chair's projects.
## Disclaimer
**July 2023**: clessnverse is no longer under active development.
To avoid breaking dependencies, the package remains available "as is" with no warranty of any kind.
## Installation
To install the latest stable version of this package, run the following line in your R console:
``` r
remotes::install_github("clessn/clessnverse")
```
## Usage
`library("clessnverse")` will load the following packages:
- [`hublot`](https://github.com/clessn/hublotr), to access clHub
- [`clessnhub`](https://github.com/clessn/hublotr), to access clessn hub
- [`locateip`](https://github.com/clessn/locateip), to locate IP addresses using [ip-api.com](https://ip-api.com/)
- [`wikirest`](https://github.com/clessn/wikirest), to get data from the [Wikimedia REST API](https://wikimedia.org/api/rest_v1/)
## Examples
### Wrangle data
Normalize a continuous variable between 0 and 1
```{r wrangle}
library(clessnverse)
data <- tibble::tibble(a = c(1, 0, 2, 0), b = c(4, 0, 1, 0))
# Base R
sapply(data, normalize_min_max)
# Dplyr
library("dplyr")
data %>%
mutate(across(c(a, b), normalize_min_max))
```
### Analyse data
```{r analyse}
run_dictionary(
data.frame(colnames(attitude)),
text = colnames(attitude),
dictionary = quanteda::data_dictionary_LSD2015
) %>% head()
```
### Visualise data
```{r visualise}
library("clessnverse")
p <- ggplot2::ggplot(data = ggplot2::mpg) +
ggplot2::geom_point(mapping = ggplot2::aes(x = displ, y = cty, colour = class)) +
ggplot2::labs(title = "Look at this graph!",
subtitle = "What a great theme, eh?",
caption = "Data: API Twitter \nCLESSN") +
ggplot2::xlab("x axis label") +
ggplot2::ylab("y axis label")
p + theme_clean_light()
p + theme_clean_dark()
p <- ggplot2::ggplot(data = ggplot2::mpg) +
ggplot2::geom_point(mapping = ggplot2::aes(x = displ, y = cty, colour = class)) +
ggplot2::labs(title = "Look at this graph!",
subtitle = "What a great look, eh?",
caption = "Data: Twitter API \nCLESSN")
p + scale_discrete_quorum(aesthetics = "colour")
```
## Issues and suggestions
You can submit bugs or suggestions in the Issues tab of this repo. To facilitate problem solving, please include a [minimal reproducible example](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html) of the issue.