-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME.Rmd
67 lines (51 loc) · 1.71 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
---
output:
md_document
---
esmisc
============
[](https://travis-ci.org/EDiLD/esmisc)
[](https://ci.appveyor.com/project/EDiLD/esmisc-98v1t)
[](https://codecov.io/gh/EDiLD/esmisc)
[](https://github.com/edild/esmisc/issues)
[](http://cranlogs.r-pkg.org/badges/esmisc)
[](http://cran.r-project.org/web/packages/esmisc)
`esmisc` is a R package containing misc functions of Eduard Szöcs.
## Functions
Currently the following functions are available:
+ `read_regnie()` reads DWD REGNIE data into R.
+ `theme_edi()` is a custom ggplot2 theme that I use.
## Installation
`esmisc` is currently only available on github. To install `esmisc` use:
```{r install, eval=FALSE}
install.packages('devtools')
library(devtools)
install_github('esmisc', 'EDiLD')
library(esmisc)
```
## Examples
```{r load}
library(esmisc)
```
### Read DWD REGNIE data into R
```{r read_regnie, message=FALSE}
r <- read_regnie(system.file("extdata", "ra050120.gz", package = "esmisc"))
# plot the raster
require(raster)
plot(r, main = 'Precipitation on 20.01.2005')
```
### ggplot2 theme
```{r ggplot_themes}
library(ggplot2)
p <- ggplot(mtcars) +
geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
facet_wrap(~am) +
theme_edi()
p
```
### other functions
#### Geometric mean
```{r}
mean(c(1, 10, 100))
geomean(c(1, 10, 100))
```