2020年CUG大气科学系
R、Python、Julia、Fortran、Rcpp混合编程模板
选择任意一个你擅长的语言,在该repository的基础上,编写滑动平均函数,测试通过后github推送给我。
主要步骤如下:
- 登陆github账户,fork此repository
- git clone 克隆的仓库链接
- 编写函数,编写R语言接口
- devtools::load_all()配合browser测试
- git commit提交到github,commit message中写明学号和姓名
- Pull request提交给我
如何修改remote-url:
# change remote url
git remote set-url origin https://github.com/your_username/movmean
git push
devtools::install_github("kongdd/movmean")
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)
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.