当前位置: 动力学知识库 > 问答 > 编程问答 >

roxygen2 - Trouble creating an R package with _roxygen2_

问题描述:

I am having trouble creating an R package with roxygen2 . Here is my code:

require(devtools)

require(roxygen2)

setwd("C://Users//[email protected]//Documents//sp th//R stuff")

create("myfunctions")

At this point, I used Windows File Explorer to add .R files to the folder "R" within the folder "myfunctions".

setwd("C:/Users/[email protected]/Documents/sp th/R stuff//myfunctions")

document()

setwd("C:/Users/[email protected]/Documents/sp th/R stuff")

install("myfunctions")

Everything appeared to work properly, but:

?vectorize #one of the .R files I added

No documentation for ‘vectorize’ in specified packages and libraries:

you could try ‘??vectorize’

网友答案:

Your problem is that you didn't load the package after you installed it.

Instead of

install("myfunctions")

Try running

install("myfunctions")
library("myfunctions")
分享给朋友:
您可能感兴趣的文章:
随机阅读: