Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.51 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.51 KB

movmean

License

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:

# change remote url
git remote set-url origin https://github.com/your_username/movmean
git push

Installation

devtools::install_github("kongdd/movmean")

Benchmarks

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.