Skip to content

Commit

Permalink
Re-document
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed May 16, 2014
1 parent 6f16124 commit 009213c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by roxygen2 (4.0.0): do not edit by hand

S3method(print,RefClass)
S3method(print,RefClassGenerator)
16 changes: 1 addition & 15 deletions man/createRefClass.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Class4 <- createRefClass("Class4",
members = list(
x = 1,
y = 2,
initialize = function(x = NULL, y = NULL, z = NULL) {
initialize = function(x = NULL, y = NULL) {
if (!is.null(x)) self$x <- x
if (!is.null(y)) self$y <- y
},
Expand Down Expand Up @@ -66,19 +66,5 @@ z$sum_xy2()
# Print, using the print.RefClass method:
print(z)
# Can also create S3 methods for Class4 objects
# This prints the contents of the public environment.
print.Class4 <- function(x, ...) {
names <- ls(x, all.names = TRUE)
values <- vapply(names, function(name) {
obj <- x[[name]]
if (is.function(obj)) "function"
else if (is.environment(obj)) "environment"
else as.character(obj)
}, FUN.VALUE = character(1))
cat(paste(" ", names, ": ", values, sep = "", collapse = "\\n"))
}
print(z)
}

0 comments on commit 009213c

Please sign in to comment.