# NOT RUN {
f1 <- function(x) {x*x}
f2 <- function(x,y) {x+y}
## A data frame is returned: 1 row, 4 columns
SimilaR_fromTwoFunctions(f1,
f2,
returnType = "data.frame",
aggregation = "tnorm")
## Custom names in the returned data frame
SimilaR_fromTwoFunctions(f1,
f2,
functionNames = c("first", "second"),
returnType = "data.frame",
aggregation = "tnorm")
## A data frame is returned: 1 row, 5 columns
SimilaR_fromTwoFunctions(f1,
f2,
returnType = "data.frame",
aggregation = "both")
## A non-symmetric square matrix is returned,
## with 2 rows and 2 columns
SimilaR_fromTwoFunctions(f1,
f2,
returnType = "matrix",
aggregation = "both")
## Typical example, where we wish to compare the functions from different files,
## but we do not want to compare the functions from the same file.
## There will be one value describing the overall similarity level.
SimilaR_fromDirectory(system.file("testdata","data",package="SimilaR"),
returnType = "data.frame",
fileTypes="file",
aggregation = "sym")
## In this example we want to compare every pair of functions: even those
## defined in the same file. Two (non-symmetric) similarity degrees
## are reported.
SimilaR_fromDirectory(system.file("testdata","data2",package="SimilaR"),
returnType = "data.frame",
fileTypes="function",
aggregation = "both")
# }
Run the code above in your browser using DataLab