-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
94 lines (68 loc) · 2.77 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
output:
github_document:
dev: 'svg'
---
<!-- 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%"
)
library(Ipaper)
```
# Ipaper
<!-- badges: start -->
[![R-CMD-check](https://github.com/rpkgs/Ipaper/workflows/R-CMD-check/badge.svg)](https://github.com/rpkgs/Ipaper/actions)
[![codecov](https://codecov.io/gh/rpkgs/Ipaper/branch/master/graph/badge.svg)](https://codecov.io/gh/rpkgs/Ipaper)
[![License](http://img.shields.io/badge/license-GPL%20%28%3E=%203%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-3.0.html)
[![CRAN](http://www.r-pkg.org/badges/version/rwiki)](https://cran.r-project.org/package=rwiki)
<!-- badges: end -->
## Installation
``` r
# devtools::install_github("kongdd/Ipaper")
devtools::install_git("https://gitee.com/adv-r/Ipaper")
# or from gz file
install.packages("../Ipaper_0.1.5.9000.tar.gz", repos = NULL, type = "source", dependencies = TRUE)
# $sudo apt-get install libfftw3-dev
```
## FUNCTIONS
### `rstudio` shortcuts addin
| Description | Shortcut |
| ------------------------------------------------- | ------------ |
| copy lines at the cursor position (sublime style) | Alt+c |
| clip lines at the cursor position | Alt+x |
| Insert `%<>%` | Ctrl+Shift+, |
| Insert `%do% {}` | Ctrl+Shift+D |
| Insert `%in% {}` | Ctrl+Shift+I |
### Visualization
* `draw.colorkey`: modified from lattice, add triangle head and tail
![](man/figures/lgd_draw.colorkey.svg)
* `geom_boxplot2`: boxplot without outlier
![](man/figures/geom_boxplot2.svg)
* `ggplot_legend`: get the legend (grid obj) of ggplot object
* `write_fig`: Unify figure writing functions, e.g. png, pdf, tif, svg
### Parallel functions
- `InitCluster`, `killCluster`.
- `llply_par`, `apply_par`
### Base tools
* `code`, `smerge`, `subl`, `github`: open app at assigned directory
* `mkdir`, `touch`
* `dir.show`: open at assigned directory in explorer
* `runningId`: print the running ID in the console
* `fprintf`: c style `fprintf`
* `melt_list`, `melt_tree`, `listk`, `dcast2`
```{r melt_list, echo = TRUE}
df <- data.frame(year = 2010, day = 1:2, month = 1, site = "A")
l <- list(a = df, b = df)
melt_list(l, "id")
l2 <- listk("type1" = l, "type2" = l)
melt_tree(l2, c("type", "id"))
```
* `reoder_name`, `rm_empty`, `match2`
* `write_list2xlsx`, `read_xlsx2list`
* `which.na`, `which.notna`, `which.isnull`, `which.notnull`
## Updates
- `mkTrend` and `slope` has been moved to the package [`rtrend`](https://cran.rstudio.com/web/packages/rtrend/index.html)