-
Notifications
You must be signed in to change notification settings - Fork 30
/
README.Rmd
65 lines (49 loc) · 1.62 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
---
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%"
)
```
# movmean
<!-- badges: start -->
[![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)
<!-- badges: end -->
> 2020年CUG大气科学系
> R、Python、Julia、Fortran、Rcpp混合编程模板
## Assignment (10 points)
选择任意一个你擅长的语言,在该repository的基础上,编写滑动平均函数,测试通过后github推送给我。
**主要步骤如下:**
1. 登陆github账户,fork此repository
2. git clone 克隆的仓库链接
3. 编写函数,编写R语言接口
4. devtools::load_all()配合browser测试
5. git commit提交到github,__**commit message中写明学号和姓名**__
6. Pull request提交给我
**如何修改remote-url:**
```bash
# change remote url
git remote set-url origin https://github.com/your_username/movmean
git push
```
## Installation
``` r
devtools::install_github("kongdd/movmean")
```
## Benchmarks
```{r}
x = c(NA, 1, 2, 3, 4, 5, Inf)
# answer = c(1, 1.5, 2, 3, 4, 4.5, 5)
r_cpp <- movmean_rcpp(x, halfwin = 1)
# 欲用此版本需安装Julia,Julia版本暂时不能考虑NA, Inf
# r_jl <- movmean_julia(x, halfwin = 1)
```
## Acknowledgements
Keep in mind that this repository is released under a GPL3 license,
which permits commercial use but requires that the source code (of
derivatives) is always open even if hosted as a web service.