Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SISIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFCB
SISIR
Commits
880c7a6e
Commit
880c7a6e
authored
2 years ago
by
Nathalie Vialaneix
Browse files
Options
Downloads
Patches
Plain Diff
added a print method to SFCB
parent
166c7457
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NAMESPACE
+2
-0
2 additions, 0 deletions
NAMESPACE
R/SFCB.R
+54
-0
54 additions, 0 deletions
R/SFCB.R
with
56 additions
and
0 deletions
NAMESPACE
+
2
−
0
View file @
880c7a6e
# Generated by roxygen2: do not edit by hand
S3method(print,SFCB)
S3method(print,SISIRres)
S3method(print,ridgeRes)
S3method(print,sparseRes)
S3method(project,sparseRes)
S3method(summary,SFCB)
S3method(summary,SISIRres)
S3method(summary,ridgeRes)
S3method(summary,sparseRes)
...
...
This diff is collapsed.
Click to expand it.
R/SFCB.R
+
54
−
0
View file @
880c7a6e
...
...
@@ -204,3 +204,57 @@ sfcb <- function(X, Y, group.method = c("adjclust", "cclustofvar"),
return
(
out
)
}
# Methods for SFCB-class ####
#' @title Print SFCB object
#' @name SFCB
#' @export
#' @aliases summary.SFCB
#' @aliases print.SFCB
#' @aliases SFCB-class
#' @description Print a summary of the result of \code{\link{sfcb}} (
#' \code{SFCB} object)
#' @param object a \code{SFCB} object
#' @param x a \code{SFCB} object
#' @param ... not used
#' @author {Victor Picheny, \email{victor.picheny@inrae.fr}\cr
#' Remi Servien, \email{remi.servien@inrae.fr}\cr
#' Nathalie Vialaneix, \email{nathalie.vialaneix@inrae.fr}}
#' @seealso \code{\link{sfcb}}
summary.SFCB
<-
function
(
object
,
...
)
{
cat
(
"\nCall:\n"
)
print
(
object
$
call
)
cat
(
"\nSFCB object with:\n"
)
lobj
<-
length
(
object
$
groups
)
if
(
lobj
==
1
)
{
cat
(
" -"
,
length
(
unique
(
object
$
groups
[[
1
]])),
"interval(s)\n"
)
}
else
{
minl
<-
length
(
unique
(
object
$
groups
[[
1
]]))
maxl
<-
length
(
unique
(
object
$
groups
[[
lobj
]]))
cat
(
" -"
,
minl
,
"-"
,
maxl
,
"interval(s)\n"
)
}
if
(
"selected"
%in%
names
(
object
))
{
if
(
lobj
==
1
)
{
selected
<-
object
$
groups
[[
1
]][
object
$
selected
[[
1
]]]
cat
(
" -"
,
length
(
unique
(
selected
)),
"selected interval(s)\n"
)
}
else
{
selected
<-
mapply
(
function
(
a
,
b
)
a
[
b
],
object
$
groups
,
object
$
selected
)
selected
<-
sapply
(
selected
,
function
(
x
)
length
(
unique
(
x
)))
cat
(
" -"
,
min
(
selected
),
"-"
,
max
(
selected
),
"selected interval(s)\n"
)
}
}
cat
(
" -"
,
nrow
(
object
$
mse
)
/
lobj
,
"repeats\n"
)
cat
(
" - MSE ranging in ["
,
min
(
object
$
mse
$
mse
),
", "
,
max
(
min
(
object
$
mse
$
mse
)),
"]\n"
,
sep
=
""
)
if
(
"computational.times"
%in%
names
(
object
))
{
cat
(
" - computational time (total):"
,
sum
(
out1
$
computational.times
),
"(seconds)\n\n"
)
}
return
(
invisible
(
NULL
))
}
#' @export
#' @rdname SFCB
print.SFCB
<-
function
(
x
,
...
)
{
summary
(
x
)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment