2013-03-05 14 views
11

私は自分自身のために小さなパッケージを作成し、devtoolsを使用するとすべてがうまくいっています。しかし、R CMD Checkを実行しようとしたところ、いくつかのエラーが発生しました。私の使用法と例は、私のパッケージに含まれていない基底Rからの関数を使用しています。例えば、私の最小限の関数とroxygenのドキュメントエラー使用法のオブジェクト aliasなしでドキュメントオブジェクト内のR CMDチェック

#' Function to Sort a dataframe with a given list of columns 
#' Cribbed from Spector, P. (2008). "Data Manipulation with R", UseR! Springer. Pg78 
#' @param df Dataframe to be sorted 
#' @param ... list of columns to sort on 
#' @return A sorted dataframe 
#' @author "Paul Hurley" 
#' @export 
#' @usage with(dataframe,sortframe(dataframe,column1, column2, column3)) 
#' @examples with(iris,sortframe(iris,Sepal.Length,Sepal.Width,Petal.Length)) 
sortframe<-function(df,...){df[do.call(order,list(...)),]} 

とR CMDチェックは/ R CMDチェックを指示する方法はあり

Undocumented arguments in documentation object 'sortframe' 
    'dataframe' 'sortframe(dataframe, column1, column2, column3)' 
Documented arguments not in \usage in documentation object 'sortframe': 
    'df' '...' 
Objects in \usage without \alias in documentation object 'sortframe': 
    'with' 

を与え、これらの機能をベースに記述されていることをroxygen2?

答えて

3

@usageタグは使用しないでください。 Roxygenはあなたのコードからそれを推測します。 @usageは実際の例です。あなたの関数定義にまったくないオブジェクトを参照しているので、Rは不平を言っています。 @usage、あなた自身でそれを置くことを主張する場合は、sortframedf、および...を参照する必要があります。 @exampleが既にあるので、@usageタグを省略できます。

関連する問題