1. devtools::, roxygen2:: 패키지 준비
library(devtools)library(roxygen2)2. 패키지 기본 구조 만들기
setwd("/Users/baek0508/Documents/2018 Big DATA/project/makepackages/")
getwd()
create("helloworld")3. 함수 만들기
test=function(x){
y=x+1
return(y)
}4. 도큐먼트 작성하기
#' test # 함수이름
#'
#' This is test function # 함수설명
#' @param x vector. This is argument
#' @return Summed Num
#' @export
#' @examples
#' test(3)5. 도큐먼트 생성
setwd("./makepackages/helloworld/")
document()6. 인스톨
setwd("./makepackages/")
getwd()
install("helloworld")