2015-06-09 96 views
1

運行devtools :: document()的輸出。我不知道如何解決這個問題,並且roxygen文檔在幫助排除錯誤信息方面並不是很出色。任何想法如何擺脫這個,所以我的功能可以記錄?Roxygen錯誤「跳過無效路徑」

Updating NEONExclusionZones documentation 
Loading NEONExclusionZones 
First time using roxygen2 4.0. Upgrading automatically... 
Writing NAMESPACE 
Skipping invalid path: 1CalcMosqImpact-TITLE.Rd 
Skipping invalid path: 1IstotopicChange-TITLE.Rd 
Skipping invalid path: 1findInters-TITLE.Rd 
Skipping invalid path: 1rad_foot-TITLE.Rd 

這是我試圖記錄的函數的一個示例。我意識到它沒有完整的文檔,但我正在試圖獲得一個基本的包,我可以繼續更新。

##'NAME 
#'@name 1findInters 
#' 
##'TITLE 
#'@title Find intersection between footprint curve and a threshold curve 
#' 
##'TYPE 
#'Standalone R Function 
#' 
##'DESCRIPTION 
#'@description Calculates where the flux footprint curve and the threshold curve intersect. 
#' 
##'USAGE 
#'\dontrun{ 
#' find_inters(fun_weight=impact_KM01[x,], location=x_step_airs[-1], threshold=SA_dist) 
#' } 
#' 
##'ARGUMENTS 
#' @param fun_weight List of footprint curve distances 
#' @param location List of distance from tower [m] 
#' @param threshold Threshold for influence of all activities on tower measurement source areas [%] 
#' 
##'DETAILS 
#' 
#' 
##'VALUE 
#' 
#' 
##'NOTE 
#' 
##'SEE ALSO 
#' 
#' 
#' 
#' 
##'EXAMPLES 
# 
#' 

find_inters <- function(
    fun_weight, 
    location, 
    threshold 
) { 

    #difference between footprint curve and threshold line 
    DIFF <- fun_weight - threshold 

    #interpolate to ensure finding local result 
    location1 <- approx(location, n=1e3)$y 
    DIFF1 <- approx(x=location, y=DIFF, xout=location1)$y  

    #find intersect farthest away from tower 
    #in order to find 1 real zero crossing, at least two zero crossings have to be present. 
    #Hence I added c(-1,1) here 
    WHR <- extrema(c(-Inf,Inf,DIFF1)) 
    if(WHR$ncross <= 1) { 
    out <- NA 
    } else { 
    #As I added c(-1,1) above, two indices have to be subtracted again here. 
    out <- round(location1[WHR$cross[WHR$ncross,2]-2]) 
    } 
    #return result 
    return(out) 

} 
+1

你應該遵循roxygen描述,小插曲,其他包等格式和例子https://github.com/yihui/roxygen2/ – rawr

回答

2

錯誤是因爲你的文件名是用數字而不是字母。該relevant code is here that produces the message is here。我相信@ rawr的評論是正確的:您使用的是格式錯誤的Roxygen語法,這是造成問題的根本原因。

+0

修復它。我沒有讀過任何關於不能以數字開頭的名字,但很高興知道。謝謝! –

相關問題