I am beginning to explore creating functions and documenting them and am having trouble getting roxygen2 to generate the documentation.
Environment:
Rstudio - 2023.03.0 Build 386
R - 4.2.2 and have also tried 4.3.0
I created a DESCRIPTION text file which contains the following:
Package: SCCTempConverter
Type: Package
Title: Temperature Conversion Package for Demonstration
Version: 0.0.1.0
RoxygenNote: 7.2.3
Encoding: UTF-8
I then created an R script file with the following:
#' @description
#' Fahrenheit conversion
#'
#' Convert degrees Fahrenheit temperatures to degrees Celsius
#'
#' @param F_temp The temperature in degrees Fahrenheit
#'
#' @return The temperature in degrees Celsius
#'
#' @examples
#' temp1 <- F_to_C(50);
#' temp2 <- F_to_C( c(50, 63, 23) );
#' @export
F_to_C <- function(F_temp){
C_temp <- (F_temp - 32) * 5/9;
return(C_temp);
}
#' @description
#' Celsius conversion
#'
#' Convert degrees Celsius temperatures to degrees Fahrenheit
#'
#' @param C_temp The temperature in degrees Celsius
#'
#' @return The temperature in degrees Fahrenheit
#' @examples
#' temp1 <- C_to_F(22);
#' temp2 <- C_to_F( c(-2, 12, 23) );
#' @export
C_to_F <- function(C_temp){
F_temp <- (C_temp * 9/5) + 32;
return(F_temp);
}
When I run devtools::document() or roxygen2::roxygenise() it creates the file NAMESPACE and the folder man but both are empty. What am I missing here? I started the project as a new project.
Edwin