StatisticalServicesCentre / ClimateObject

This R code
GNU General Public License v3.0
0 stars 7 forks source link

Documentation #11

Open rposn opened 9 years ago

rposn commented 9 years ago

To improve the documentation of the "climObj" methods I suggest the use of the "roxygen2" package. It allows making comments inline while coding in R. Once you have the inline comments, you just have to run the command: devtools::document(). Then the roxygen will create the help files (.Rd files) automatically.

More info: http://r-pkgs.had.co.nz/man.html#man-classes

As an example:

' @title climate2

' @name climate

' @export

' @field climate_data_object list. A list of climate_data objects. Each object

' Include all information necessary to use the methods described in the Reference Class.

' @field used_data_objects list. A list of extra climate_data objects, created during use

' @field meta_data list. Any information about the climate object. e.g. "name"

' @description

' Defining the reference class "climate"

' This reference class can contain multiple climate_data objects

' The fields are the properties every climate_data object will have.

climate <- setRefClass("climate", fields = list(climate_data_objects = "list", used_data_objects = "list", meta_data = "list") )