I want to make a small R package from a few very simple functions. In the literature, I use “Creating R-Packages: A Tutorial” and “Writing R-Extensions”. Although I tried, but I do not understand the concept of common functions and methods and how to process arguments in different functions.
Here is a small example of what my code looks like:
f <- function(x,...) UseMethod("newmethod")
f.default <- function(a,b=5,c=3,...){
out <- a+b+c
class(out) <- "fclass"
}
print.f <- function(x,...){
cat("Result:")
print(x)
}
summary.f <- function(object,...){
res <- object
class(res) <- "fsummary"
print(res)
}
plot.f <-function(x,p=0.3,...){}
f f.default. ( x), ?
f.default( , ). plot.f f.default (). ? "" ""... , , ... ... , - .
-, , "" R- ( ).