Skip to content

Instantly share code, notes, and snippets.

@yuu-ito
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save yuu-ito/a94300b7fa2a4ca90957 to your computer and use it in GitHub Desktop.

Select an option

Save yuu-ito/a94300b7fa2a4ca90957 to your computer and use it in GitHub Desktop.
RUnitのメモ
library('RUnit')
source('./mysum.r')
# refs
# - http://cran.r-project.org/web/packages/RUnit/RUnit.pdf
# - http://www.okada.jp.org/RWiki/?RUnit%20%A4%F2%BB%C8%A4%A6
test.mysum <- function(){
checkEqualsNumeric(mysum(1:10),55)
}
test:
R -e "library(RUnit);runTestFile('0_test.r')" --slave
mysum <- function(x){
# calc sum
sum(x)
}
@yuu-ito

yuu-ito commented Sep 2, 2014

Copy link
Copy Markdown
Author

@yuu-ito

yuu-ito commented Sep 2, 2014

Copy link
Copy Markdown
Author

R option e の場合、.Rprofileは読み込まないので注意。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment