-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathr_packg.qmd
More file actions
94 lines (75 loc) · 9.98 KB
/
r_packg.qmd
File metadata and controls
94 lines (75 loc) · 9.98 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
---
title: "🚢 R Packages"
format: html
editor: visual
---
# Our Task
- To list, evaluate and determine the necessary R packages needed for our Shiny application are supported in R CRAN.
# **Tackling the task**
- Here, we load up our ship to set sail to work on our project with these R CRAN supported packages.
## **Packages supported in R CRAN:**
+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
| **Utility Tools** | **Graphing Tools** |
+============================================================================================================================+==============================================================================================================================+
| - [jsonlite](https://cran.r-project.org/web/packages/jsonlite/index.html) - To parse JSON | - [patchwork](https://cran.r-project.org/web/packages/patchwork/index.html) - For combining ggplot plots |
| | |
| - [tidyverse](https://www.tidyverse.org/) - Data science tools | - [ggraph](https://ggraph.data-imaginist.com/) - For plotting network data |
| | |
| - [ggtext](https://cran.r-project.org/web/packages/ggtext/index.html) - Tools for text formatting | - [tidygraph](https://cran.r-project.org/web/packages/tidygraph/index.html) - For graph manipulations |
| | |
| - [knitr](https://cran.r-project.org/web/packages/knitr/index.html) - For better table displays | - [igraph](https://cran.r-project.org/web/packages/igraph/index.html) - Contains functions for network analysis |
| | |
| - [lubridate](https://cran.r-project.org/web/packages/lubridate/vignettes/lubridate.html) - For processing date and time | - [ggiraph](https://cran.r-project.org/web/packages/ggiraph/index.html) - Interactive plots |
| | |
| - [hms](https://cran.r-project.org/web/packages/hms/index.html) - For durations | - [plotly](https://cran.r-project.org/web/packages/plotly/index.html) - Interactive plots |
| | |
| - [scales](https://cran.r-project.org/web/packages/scales/index.html) - For breaks and labels | - [wordcloud](https://cran.r-project.org/web/packages/wordcloud/index.html)- For frequency representation of words |
| | |
| - [tidytext](https://cran.r-project.org/web/packages/tidytext/index.html) - For functions text mining | - [ggh4x](https://cran.r-project.org/web/packages/ggh4x/index.html) - For axis, strip, and facet customizations |
| | |
| - [tm](https://cran.r-project.org/web/packages/tm/index.html) - For text mining | - [visNetwork](https://cran.r-project.org/web/packages/visNetwork/index.html) - For interactive visualisation of networks. |
| | |
| - [SnowBallC](https://cran.r-project.org/web/packages/SnowballC/index.html) - For Porter's word stemming | - [RColorBrewer](https://cran.r-project.org/web/packages/RColorBrewer/index.html) - Colour schemes for graphics |
| | |
| - [SmartEDA](https://cran.r-project.org/web/packages/SmartEDA/index.html) - EDA with some graphing | - [circlize](https://cran.r-project.org/web/packages/circlize/index.html) - For circular plots |
| | |
| - [reactable](https://cran.r-project.org/web/packages/reactable/index.html) - For interactive data tables | - [ggalluvial](https://cran.r-project.org/web/packages/alluvial/index.html) - For alluvial diagrams |
| | |
| - [highcharter](https://cran.r-project.org/web/packages/highcharter/index.html)- For wrapper function | - [networkD3](https://cran.r-project.org/web/packages/networkD3/index.html)- For D3-based interactive network graphs |
| | |
| - [conflicted](https://cran.r-project.org/web/packages/conflicted/index.html) - For managing namespace conflicts | - [leaflet](https://cran.r-project.org/web/packages/leaflet/index.html)- For interactive maps |
+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
- We will use the code chunk below uses p_load() of pacman package to check if packages are installed in the computer. If they are, then they will be launched into R.
```{r}
#| code-fold: true
#| code-summary: "Show the code"
pacman::p_load(jsonlite, tidyverse, ggtext,
knitr, lubridate, hms, scales,
tidytext, tm, SnowballC,
patchwork, ggraph,
tidygraph, igraph, ggiraph,
SmartEDA, plotly, wordcloud,
ggh4x, visNetwork, RColorBrewer,
circlize, ggalluvial, reactable,
networkD3, highcharter, leaflet, conflicted)
```
## **🧰 Part of Tidyverse**
::: {.card style="background-color: #f5f9ff; padding: 1rem; border-left: 5px solid #6482eb; margin-bottom: 1rem;"}
- [stringr](https://cran.r-project.org/web/packages/stringr/index.html) - For wrapping text and string manipulation
- [readr](https://cran.r-project.org/web/packages/readr/index.html) - For reading rectangular data (CSV, TSV, etc)
- [dplyr](https://cran.r-project.org/web/packages/dplyr/index.html) - For transforming, filtering, summarising data
- [ggplot2](https://cran.r-project.org/web/packages/ggplot2/index.html) - For building data visualisation
:::
## 🔄**Workarounds:**
These are some workarounds required for Shiny application:
::: {.card style="background-color: #f5f9ff; padding: 1rem; border-left: 5px solid #6482eb; margin-bottom: 1rem;"}
- magick - For graphics and image processing will be replaced by renderImage() + impageOutput()
- We will use renderWordcloud2() (from the wordcloud2 package) and wordcloud2Output() in our UI.
:::
## 🆚**Settle Conflict Issues:**
::: {.card style="background-color: #f5f9ff; padding: 1rem; border-left: 5px solid #6482eb; margin-bottom: 1rem;"}
- conflicts_prefer(shinydashboard::box)
- conflicts_prefer(dplyr::filter)
- conflicts_prefer(dplyr::lag)
- conflicts_prefer(networkD3::JS)
:::