R.oo/0000755000177400001440000000000013005746667011277 5ustar murdochusersR.oo/inst/0000755000177400001440000000000013005671245012241 5ustar murdochusersR.oo/inst/CITATION0000644000177400001440000000256013005671245013401 0ustar murdochuserscitHeader("Please cite R.oo/R.methodsS3 as"); citEntry( # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # BibTeX entry: # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - entry="InProceedings", author = "Henrik Bengtsson", title = "The {R.oo} package - Object-Oriented Programming with References Using Standard {R} Code", booktitle = "Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003)", year = "2003", editor = "Kurt Hornik and Friedrich Leisch and Achim Zeileis", address = "Vienna, Austria", month = "March", issn = "1609-395X", url = "https://www.r-project.org/conferences/DSC-2003/Proceedings/Bengtsson.pdf", howpublished = "https://www.r-project.org/conferences/DSC-2003/Proceedings/", # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Plain-text citation: # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - textVersion = paste(sep="", "Bengtsson, H. ", "The R.oo package - Object-Oriented Programming with References Using Standard R Code, ", "Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), ", "ISSN 1609-395X, ", "Hornik, K.; Leisch, F. & Zeileis, A. (ed.), ", "2003" ) ); R.oo/inst/misc/0000755000177400001440000000000012726216524013200 5ustar murdochusersR.oo/inst/misc/Exception.R0000755000177400001440000002357212726216524015275 0ustar murdochusers###########################################################################/** # @RdocClass Exception # # \title{The Exception class to be thrown and caught} # # \description{ # @classhierarchy # # Creates an Exception that can be thrown and caught. The \code{Exception} # class is the root class of all other \code{Exception} classes. # } # # @synopsis # # \arguments{ # \item{...}{One or several strings, which will be concatenated and contain # informative message about the exception.} # \item{sep}{The string to used for concatenating several strings.} # \item{collapse}{The string to used collapse vectors together.} # } # # \section{Fields and Methods}{ # @allmethods # } # # @examples "Exception.Rex" # # @author # # \seealso{ # See also @see "base::tryCatch" (and @see "base::try"). # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setConstructorS3("Exception", function(..., sep="", collapse=", ") { calls <- sys.calls(); last.dump <- sys.frames(); names(last.dump) <- limitedLabels(calls); # last.dump <- last.dump[-length(last.dump)]; attr(last.dump, "error.message") <- geterrmessage(); class(last.dump) <- "dump.frames"; stackTrace <- NULL; if (length(last.dump) > 0) { calls <- names(last.dump); matchStr <- "Exception("; offset <- which(substr(calls, 1, nchar(matchStr)) == matchStr); if (length(offset) == 0 || offset == 1) stackTrace <- list(""=NA) else stackTrace <- last.dump[1:(offset-1)]; } # The new class is Exception, but for convenience it should also # derive from 'try-error', which is used by try() etc. extend(Object(), c("Exception", "simpleError", "error", "condition", "try-error"), .msg = paste(..., sep=sep, collapse=collapse), .when = Sys.time(), .stackTrace = stackTrace ) }) ###########################################################################/** # @RdocMethod as.character # # \title{Gets a character string representing of the Exception} # # @synopsis # # \description{ # @get "title". # By default the format is: "[{POSIX date string}] {class name}: {msg}". # } # # \value{ # Returns a @character string. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("as.character", "Exception", function(this) { paste("[", getWhen(this), "] ", class(this)[1], ": ", getMessage(this), sep=""); }) ###########################################################################/** # @RdocMethod print # # \title{Prints the Exception} # # @synopsis # # \description{ # @get "title". By default the \code{as.character()} representation plus # the stack trace is printed. # } # # \value{Returns nothing.} # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seemethod "as.character". # @seemethod "getStackTrace". # @seemethod "printStackTrace". # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("print", "Exception", function(this) { cat(getStackTraceString(this)); }) ###########################################################################/** # @RdocMethod getWhen # # \title{Gets the time when the Exception was created} # # @synopsis # # \description{ # Gets the time, as a POSIX object, when the Exception was created. # } # # \value{ # Returns a POSIX time object. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getWhen", "Exception", function(this) { this$.when; }) ###########################################################################/** # @RdocMethod getMessage # # @title "Gets the message of the Exception" # # @synopsis # # \description{ # @get "title". # } # # \value{ # Returns a @character string. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getMessage", "Exception", function(this) { this$.msg; }) ###########################################################################/** # @RdocMethod throw # # \title{Throws an Exception that can be caught} # # @synopsis # # \description{ # Throws an Exception that can be caught by \code{tryCatch()}. # } # # \value{ # Returns nothing. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # See also @see "base::tryCatch". # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("throw", "Exception", function(this) { Exception$.lastException <- this; message <- getStackTraceString(this); # message <- as.character(this); if (R.Version()$major <= 1 && R.Version()$minor < 8.0) { .Internal(stop(as.logical(FALSE), message)); } else { signalCondition(this); .Internal(.dfltStop(paste("\n", getStackTraceString(this), sep=""), getCall(this))); } # if (R.Version()$major <= 1 && R.Version()$minor < 8.0) }) ###########################################################################/** # @RdocMethod getLastException # # \title{Static method to get the last Exception thrown} # # @usage # # \description{ # Static method to get the last Exception instanciated. # } # # \value{ # Returns an @see "Exception" object. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # \seealso{ # @seeclass # See also @see "base::tryCatch". # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getLastException", "Exception", function(this) { Exception$.lastException; }, static=TRUE); ###########################################################################/** # @RdocMethod getStackTrace # @aliasmethod getCall # # \title{Gets the stack trace saved when the exception was created} # # @synopsis # # \description{ # @get "title". # } # # \value{ # Returns a @list containing the stack trace. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # \seealso{ # @seemethod "printStackTrace". # @see "base::dump.frames". # @see "base::tryCatch". # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getStackTrace", "Exception", function(this) { this$.stackTrace; }) setMethodS3("getCall", "Exception", function(this) { getStackTrace(this); }) ###########################################################################/** # @RdocMethod getStackTraceString # # \title{Gets the stack trace as a string} # # @synopsis # # \description{ # @get "title". # } # # \value{ # Returns a @character string. # } # # \seealso{ # @seemethod "getStackTrace". # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getStackTraceString", "Exception", function(this) { calls <- names(this$.stackTrace); len <- length(calls); width <- floor(log(len, base=10))+1; s <- paste(this, "\n", sep=""); for (k in len:1) s <- paste(sep="", s, " at ", calls[k], "\n"); s; }, private=TRUE) ###########################################################################/** # @RdocMethod printStackTrace # # \title{Prints the stack trace saved when the exception was created} # # @synopsis # # \description{ # @get "title". # } # # \value{ # Returns nothing. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # \seealso{ # @seemethod "getStackTrace". # @see "base::tryCatch". # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("printStackTrace", "Exception", function(this) { cat(getStackTraceString(this)); }) ############################################################################ # HISTORY: # 2005-02-10 # o Moved showAndWait() from Exception to simpleError. # 2004-10-18 # o Added more Rdoc comments. # 2004-03-02 # o The Exception class now inherits from the simpleError, error and # condition classes. # o The throw() method of Exception does now make use of the new (R v1.8.0) # signalCondition() method. # 2003-12-16 # o Now throw() includes the complete stacktrace when generating an internal # error signal. # 2003-04-13 # o Wrote Rdoc comments that were missing and updated some others. # 2003-03-23 # o Added showAndAsk(), which will, if tcltk is installed, display a dialog # box with the error message. If tcltk is not installed, The message will # be printed on the command line and a prompt requesting the user to press # enter will be shown. showAndAsk() will give an error if run in a non- # interactive mode. # 2003-01-19 # o Added stacktrace information to *each* Exception object. This is created # when the object is created. # 2003-01-18 # o Replaced all occurences of getClass() with data.class(). Will change # the use of getClass() in the future to return a Class object. # 2002-10-17 # o Made getLastException() a static method of Exception. # o Created from previous ideas in R.oo. ############################################################################ R.oo/inst/misc/ASCII.R0000755000177400001440000001432612726216524014164 0ustar murdochusers#########################################################################/** # @RdocObject ASCII # # @alias ASCII.BEL # @alias ASCII.BS # @alias ASCII.HT # @alias ASCII.LF # @alias ASCII.FF # @alias ASCII.CR # @alias ASCII.SO # @alias ASCII.SI # @alias ASCII.DC1 # @alias ASCII.DC3 # @alias ASCII.ESC # # @title "8-bit ASCII table" # # \description{ # ASCII is the 8-bit ASCII table with ASCII characters from 0-255. # } # # \examples{ # ch <- ASCII[65+1]; # ch == "A" # } # # @author # # \seealso{ # @see charToInt # @see intToChar # } # # @keyword character # # @keyword internal #*/######################################################################### ASCII <- c( "\000","\001","\002","\003","\004","\005","\006","\007", # 000-007 "\010","\011","\012","\013","\014","\015","\016","\017", # 010-017 "\020","\021","\022","\023","\024","\025","\026","\027", # 020-027 "\030","\031","\032","\033","\034","\035","\036","\037", # 030-037 "\040","\041","\042","\043","\044","\045","\046","\047", # 040-047 "\050","\051","\052","\053","\054","\055","\056","\057", # 050-057 "\060","\061","\062","\063","\064","\065","\066","\067", # 060-067 "\070","\071","\072","\073","\074","\075","\076","\077", # 070-077 "\100","\101","\102","\103","\104","\105","\106","\107", # 100-107 "\110","\111","\112","\113","\114","\115","\116","\117", # 110-117 "\120","\121","\122","\123","\124","\125","\126","\127", # 120-127 "\130","\131","\132","\133","\134","\135","\136","\137", # 130-137 "\140","\141","\142","\143","\144","\145","\146","\147", # 140-147 "\150","\151","\152","\153","\154","\155","\156","\157", # 150-157 "\160","\161","\162","\163","\164","\165","\166","\167", # 160-167 "\170","\171","\172","\173","\174","\175","\176","\177", # 170-177 "\200","\201","\202","\203","\204","\205","\206","\207", # 200-207 "\210","\211","\212","\213","\214","\215","\216","\217", # 210-217 "\220","\221","\222","\223","\224","\225","\226","\227", # 220-227 "\230","\231","\232","\233","\234","\235","\236","\237", # 230-237 "\240","\241","\242","\243","\244","\245","\246","\247", # 240-247 "\250","\251","\252","\253","\254","\255","\256","\257", # 250-257 "\260","\261","\262","\263","\264","\265","\266","\267", # 260-267 "\270","\271","\272","\273","\274","\275","\276","\277", # 270-277 "\300","\301","\302","\303","\304","\305","\306","\307", # 300-307 "\310","\311","\312","\313","\314","\315","\316","\317", # 310-317 "\320","\321","\322","\323","\324","\325","\326","\327", # 320-327 "\330","\331","\332","\333","\334","\335","\336","\337", # 330-337 "\340","\341","\342","\343","\344","\345","\346","\347", # 340-347 "\350","\351","\352","\353","\354","\355","\356","\357", # 350-357 "\360","\361","\362","\363","\364","\365","\366","\367", # 360-367 "\370","\371","\372","\373","\374","\375","\376","\377" # 370-377 ); # Alternatively one can do like this. Idea by Peter Dalgaard, # Dept. of Biostatistics, University of Copenhagen, Denmark. # ASCII <- c("\000", sapply(1:255, function(i) parse(text=paste("\"\\", # structure(i,class="octmode"), "\"", sep=""))[[1]]) ); # Some special ASCII characters. ASCII.BEL <- "\007"; ASCII.BS <- "\010"; ASCII.HT <- "\011"; ASCII.LF <- "\012"; ASCII.FF <- "\014"; ASCII.CR <- "\015"; ASCII.SO <- "\016"; ASCII.SI <- "\017"; ASCII.DC1 <- "\021"; ASCII.DC3 <- "\023"; ASCII.ESC <- "\033"; #########################################################################/** # @RdocDefault charToInt # # @title "Converts a vector of integers into a vector of ASCII characters" # # \description{ # Converts a @vector of ASCII @characters to a equal length vector of ASCII # @integers. # } # # @synopsis # # \arguments{ # \item{ch}{A @character @vector.} # \item{...}{Not used.} # } # # \value{ # Returns an ASCII @character @vector. # } # # @author # # \examples{ # i <- charToInt(unlist(strsplit("Hello world!", split=NULL))) # # Gives: 72 101 108 108 111 32 119 111 114 108 100 33 # ch <- intToChar(c(72,101,108,108,111,32,119,111,114,108,100,33)) # # Gives: "H" "e" "l" "l" "o" " " "w" "o" "r" "l" "d" "!" # } # # \seealso{ # @see intToChar # } # # @keyword character #*/######################################################################### setMethodS3("charToInt", "default", function(ch, ...) { match(ch, ASCII) - 1; }) #########################################################################/** # @RdocDefault intToChar # # @title "Converts a vector of ASCII characters into a vector of integers" # # \description{ # Converts a vector of ASCII integers to a equal length vector of ASCII # characters. To make sure that all values in the input vector are in # the range [0,255], the input vector is taken modulo 256. # } # # @synopsis # # \arguments{ # \item{i}{An @integer @vector.} # \item{...}{Not used.} # } # # \value{ # Returns a ASCII @integer @vector. # } # # @author # # \examples{ # i <- charToInt(unlist(strsplit("Hello world!", split=NULL))) # # Gives: 72 101 108 108 111 32 119 111 114 108 100 33 # ch <- intToChar(c(72,101,108,108,111,32,119,111,114,108,100,33)) # # Gives: "H" "e" "l" "l" "o" " " "w" "o" "r" "l" "d" "!" # } # # \seealso{ # @see charToInt # } # # @keyword character #*/######################################################################### setMethodS3("intToChar", "default", function(i, ...) { ASCII[i %% 256 + 1]; }) ############################################################################ # HISTORY: # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2002-10-20 # o Added keywords to the Rdoc comments. # 2002-05-26 # * Changed the \keyword{}'s to contain valid keyword as in KEYWORDS.db. # 2002-02-04 # * Added alternative idea of creating the ASCII table. # 2002-01-29 # * Rewritten to make use of setMethodS3. # 2001-08-06 # * Moved ASCII back to R.oo from R.base. It is needed by the String class. # By moving it back R.oo is stand-alone again. # 2001-07-28 # * Also defined up the ASCII.BEL constants etc. # * Moved the ASCII stuff from R.oo to R.base. # 2001-07-13 # * Made all methods using UseMethod. # 2001-06-07 # * Added [R] documents to ASCII, charToInt and intToChar. # 2001-04-02 # * Created! ############################################################################ R.oo/inst/doc/0000755000177400001440000000000012726216524013012 5ustar murdochusersR.oo/inst/doc/Bengtsson.pdf0000755000177400001440000065703212726216524015467 0ustar murdochusers%PDF-1.5 % 164 0 obj<> endobj 180 0 obj<<7cf91b959c184f4bba70f1c6d9bfafb6>]/Length 91/Filter/FlateDecode/DecodeParms<>/W[1 2 1]/Type/XRef/Prev 220285/Info 163 0 R/Index[164 126]>>stream xbbd``b`Y$!@:$8 A a HpO6 HJ01W L @@\3F T N endstream endobj 167 0 obj<>stream xb```? ,@2AX,.9\@PG<Ғb|3xuyxbx~N}yFn@} "f>M #^؝Q8EoF5+Yk kty&Kmf1)g7glzF$f.ť5St}7 ^tӡK]=Fo:JyZV8Z0;eQ[(f4F4 ` h"T@@S RJ@1F0f !T.B 10L@,`Tdc`crQc$wAk6ôӶG[6gD&:@B3ï @ډSg`cou endstream endobj 165 0 obj<>/Type/Catalog/PageMode/UseOutlines/OpenAction 166 0 R/Names 181 0 R/ViewerPreferences<<>>/Metadata 67 0 R/PTEX.Fullbanner(This is pdfTeX, Version 3.14159-1.10b)>> endobj 166 0 obj<> endobj 168 0 obj<>/ProcSet[/PDF/Text]>>>> endobj 169 0 obj<>stream xYr8I3OVSóرg\ɌCd޼}#8ɒI$ j?b<2pcjie)%TL;I"0g:A>Acq GӤul Bdр`p% %xF?F{X䅈ILTE [H.C%ڐFuIdcìѸA$<)BsČ5aV2pV\`ʒ}&*9FrR8/H:n 2Ҵ>ٌdjʇ{M˪&!1W&2EX^zZ2Q:˿/`tJ቙ 0`gNB 9'y.qFoK>>6+V6'8l#bSTZTzl`A, c1[l&X- r4a]BJd =3޲H&qm?ڀlGTS +tz{*[.[[m_wDc7;j0@ *,7,. z&aL[n ?: G{4b[ͻFywzp"  ah |%g{FNl=Z!z4! ܦS8( 4aceMzsÈmq-6-;Q$to7C4겿Fv6X7Xi"붓=E,竴wr> S?b1@Dv)*1Fm>Bq BVf6NZs0dTDm-tTsz%Ը+;xY'vGӔblðaX%gt7M]>ٳbI},zx4m>wnqQ+ěnWGo.ɨ{ 4ݽ]]w+Կ;=rsڻ/G5uEX!vehc( o]Pi>iܮ%n6Zڌe&qÑKa یIJM3#ч!nWx`}N#m[H9n &GG._tF,Qswȉwщv-e?16czp|2${nNrسIn|ᚽ" endstream endobj 170 0 obj<>stream xe\[߶!wwwnťHq+nEk8›=㽟&_5֘sΕJYMBэ )j8 v  $ [8  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{VJS KW{7>ъS_~p%R>6zWc'O^C>o#+H  endstream endobj 66 0 obj<>stream xڔn1 EEeђ`J E$ yXv?,V22)3w%, aDXQĒL#T1bKU؟5RcRłHAB y&Vkn'‰`|Bq5Ϭ3̶ =VCxw{S%_X5 hю%%D;Dh-[[R%ڿo D}#v,#vì#vl#v\G5p"pe8b7(4b7(enP*u-#Cmġ^;?=Ṗ^fu/jњan€i&ڋe&V&4b&ZubjWuZ,SR>1T}͠ifO۸lA\1lOJ'6 51 ޳6@:2=Q\,ؕV@!&>-XW 8 '4FJ/nM5S-ٴȎ{X3\ۘFme1=!l# endstream endobj 67 0 obj<>stream endstream endobj 68 0 obj<>stream xڔPN059y"V*&. :rU{;8eg= PGHd9p>BXZ gm[Oa Ϭv+4e^ff)M Sk-9D:T{M=y2ޫzSl1#%1qc:CleiZuVhuxYњwL:piMِ9<` endstream endobj 69 0 obj<>/W[1 3 1]/Type/XRef/Index[0 164]>>stream xbb&FFƳ L s@D2EY"{j?ٗjH`9`>E)Le"EK#H*=x"jx5 p,{Ibn$wNgfFc=I^"E Hwze%"|@&KٗՃ̾DrN|S&c68H0N2ŧ<xp$㝡Z'd x2 endstream endobj startxref 116 %%EOF R.oo/tests/0000755000177400001440000000000012726216524012432 5ustar murdochusersR.oo/tests/StaticMethodsAndNamespaces.R0000644000177400001440000000031212726216524017747 0ustar murdochusersmessage("TESTING: Static methods and classes...") clazz <- R.oo::Class print(clazz) clazz <- R.oo::Class$forName("Object") print(clazz) message("TESTING: Static methods and classes...DONE") R.oo/tests/Object.R0000644000177400001440000000360512726216524013767 0ustar murdochusersmessage("TESTING: Object...") library("R.oo") obj <- Object() print(obj) obj <- Object(42L) print(obj) stopifnot(obj == 42L) obj$a <- 1:99 print(obj) fields <- getFields(obj) print(fields) hasA <- hasField(obj, "a") print(hasA) stopifnot(hasA) value <- obj$a str(value) stopifnot(identical(value, 1:99)) obj$a <- 1:100 print(obj) value <- obj[["a"]] str(value) stopifnot(identical(value, 1:100)) size <- objectSize(obj) print(size) ref <- isReferable(obj) print(ref) stopifnot(isTRUE(ref)) time <- getInstantiationTime(obj) print(time) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Attach and detach # - - - - - - - - - - - - - - - - - - - - - - - - - - - - res <- attach(obj) print(res) stopifnot(exists("a", mode="integer")) str(a) ## Object already attached res <- tryCatch(attach(obj), warning=function(w) w) stopifnot(inherits(res, "warning")) res <- detach(obj) print(res) ## Object already detached res <- tryCatch(detach(obj), warning=function(w) w) stopifnot(inherits(res, "warning")) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Save and load # - - - - - - - - - - - - - - - - - - - - - - - - - - - - obj <- Object() obj$a <- 1 obj$b <- 2 pathnameT <- tempfile() save(obj, file=pathnameT) obj2 <- Object$load(pathnameT) stopifnot(all.equal(getFields(obj2), getFields(obj))) for (key in getFields(obj)) { stopifnot(identical(obj2[[key]], obj[[key]])) } file.remove(pathnameT) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Class # - - - - - - - - - - - - - - - - - - - - - - - - - - - - obj2 <- newInstance(obj, 43L) print(obj2) stopifnot(obj2 == 43L) hash <- hashCode(obj) print(hash) stopifnot(length(hash) == 1L) neq <- equals(obj, 1) print(neq) stopifnot(!neq) eq <- equals(obj, obj) print(eq) stopifnot(eq) obj3 <- clone(obj) print(obj3) stopifnot(!identical(obj3, obj)) stopifnot(all.equal(obj3, obj)) message("TESTING: Object...DONE") R.oo/tests/objectSize.R0000644000177400001440000000113312726216524014654 0ustar murdochusersmessage("TESTING: objectSize()...") library("R.oo") ## Simple object x <- 1:100 y0 <- object.size(x) y <- objectSize(x) print(y) stopifnot(y == y0) ## A list x <- as.list(1:100) y0 <- object.size(x) y <- objectSize(x) print(y) stopifnot(y == y0) ## An environment env <- new.env() env$a <- 1:100 env$b <- as.list(1:100) env$c <- new.env() y0 <- object.size(env) print(y0) y <- objectSize(env) print(y) ## An environment with circular dependencies env <- new.env() env$a <- 1:100 env$env <- env y0 <- object.size(env) print(y0) y <- objectSize(env) print(y) message("TESTING: objectSize()...DONE") R.oo/tests/Package.R0000644000177400001440000000361512726216524014115 0ustar murdochusersmessage("TESTING: Package...") library("R.oo") # By defining .onAttach() as follows in zzz.R for a package, an # instance of class Package with the same name as the package will # be made available on the search path. More over, the code below # will also inform the user that the package has been loaded: # # > library(R.oo) # R.oo v0.52 (2003/04/13) was successfully loaded. # .onAttach <- function(libname, pkgname) { pkg <- Package(pkgname); assign(pkgname, pkg, pos=getPosition(pkg)); cat(getName(pkg), " v", getVersion(pkg), " (", getDate(pkg), ")", " was successfully loaded.\n", sep=""); } # The Package class works for any packages, loaded or not. # Some information about the base package pkg <- Package("base") print(pkg) # [1] "Package: base v1.6.2 (NA) is loaded (pos=5). The official webpage # is NA and the maintainer is R Core Team . The # package is installed in c:/PROGRA~1/R/rw1062/library/base/." print(list.files(Package("base")$dataPath)) # Some information about the R.oo package print(R.oo::R.oo) # [1] "Package: R.oo v0.52 (2003/04/13) is loaded (pos=2). The official # webpage is http://www.braju.com/R/ and the maintainer is Henrik # Bengtsson . The package is installed in # c:/PROGRA~1/R/rw1062/library/R.oo/." pkg <- Package("R.oo") classes <- getClasses(pkg) print(classes) stopifnot(all(c("Object", "Class", "Interface", "Exception", "Package") %in% classes)) pkg <- Package("R.oo") res <- showDescriptionFile(pkg, pager=function(...) TRUE) stopifnot(isTRUE(res)) res <- showNews(pkg, pager=function(...) TRUE) stopifnot(isTRUE(res)) res <- showChangeLog(pkg, pager=function(...) TRUE) stopifnot(isTRUE(res)) res <- showHistory(pkg, pager=function(...) TRUE) stopifnot(isTRUE(res)) res <- try(Package("Non-Existing-Package"), silent=TRUE) stopifnot(inherits(res, "try-error")) message("TESTING: Package...DONE") R.oo/tests/equals.R0000644000177400001440000000034612726216524014052 0ustar murdochusersmessage("TESTING: equals()...") library("R.oo") print(equals(1,1)) print(equals(1,2)) a <- 1:100 b <- 1:100 print(equals(a,b)) obj <- Object() print(equals(obj, 1)) print(equals(obj, obj)) message("TESTING: equals()...DONE") R.oo/tests/extend.default.R0000644000177400001440000000203312726216524015465 0ustar murdochusersmessage("TESTING: extend()...") library("R.oo") setConstructorS3("MyDouble", function(value=0, ...) { extend(as.double(value), "MyDouble", ...) }) setMethodS3("as.character", "MyDouble", function(object, ...) { fmtstr <- attr(object, "fmtstr") if (is.null(fmtstr)) fmtstr <- "%.6f" sprintf(fmtstr, object) }) setMethodS3("print", "MyDouble", function(object, ...) { print(as.character(object), ...) }) x <- MyDouble(3.1415926) print(x) x <- MyDouble(3.1415926, fmtstr="%3.2f") print(x) attr(x, "fmtstr") <- "%e" print(x) setConstructorS3("MyList", function(value=0, ...) { extend(list(value=value, ...), "MyList") }) setMethodS3("as.character", "MyList", function(object, ...) { fmtstr <- object$fmtstr if (is.null(fmtstr)) fmtstr <- "%.6f" sprintf(fmtstr, object$value) }) setMethodS3("print", "MyList", function(object, ...) { print(as.character(object), ...) }) x <- MyList(3.1415926) print(x) x <- MyList(3.1415926, fmtstr="%3.2f") print(x) x$fmtstr <- "%e" print(x) message("TESTING: extend()...DONE") R.oo/tests/local.R0000644000177400001440000000106312726216524013647 0ustar murdochusersmessage("TESTING: local()...") library("R.oo") setConstructorS3("Foo", function() { extend(Object(), "Foo") }) setMethodS3("finalize", "Foo", function(this, ...) { cat("Finalized Foo\n") }) x <- Foo() print(x) # Trigger finalizer via garbage collection rm(list="x") gc() local({ setConstructorS3("Bar", function() { extend(Object(), "Bar") }) setMethodS3("finalize", "Bar", function(this, ...) { cat("Finalized Bar\n") }) x <- Bar() print(x) # Trigger finalizer via garbage collection rm(list="x") gc() }) message("TESTING: local()...DONE") R.oo/tests/Exception.R0000644000177400001440000000421212726216524014512 0ustar murdochusersmessage("TESTING: Exception...") library("R.oo") oopts <- options(warn=1) ###################################################################### # 1. To catch a regular "error" exception thrown by e.g. stop(). ###################################################################### x <- NA y <- NA tryCatch({ x <- log(123) y <- log("a") }, error = function(ex) { print(ex) }) print(x) print(y) ###################################################################### # 2. Always run a "final" expression regardless or error or not. ###################################################################### filename <- tempfile("R.methodsS3.example") con <- file(filename) tryCatch({ open(con, "r") }, error = function(ex) { cat("Could not open ", filename, " for reading.\n", sep="") }, finally = { close(con) cat("The id of the connection is ", ifelse(is.null(con), "NULL", con), ".\n", sep="") }) ###################################################################### # 3. Creating your own Exception class ###################################################################### setConstructorS3("NegativeLogValueException", function( msg="Trying to calculate the logarithm of a negative value", value=NULL) { extend(Exception(msg=msg), "NegativeLogValueException", .value = value ) }) setMethodS3("as.character", "NegativeLogValueException", function(this, ...) { paste(as.character.Exception(this), ": ", getValue(this), sep="") }) setMethodS3("getValue", "NegativeLogValueException", function(this, ...) { this$.value }) mylog <- function(x, base=exp(1)) { if (x < 0) throw(NegativeLogValueException(value=x)) else log(x, base=base) } # Note that the order of the catch list is important: l <- NA x <- 123 tryCatch({ l <- mylog(x) }, NegativeLogValueException = function(ex) { cat(as.character(ex), "\n") }, "try-error" = function(ex) { cat("try-error: Could not calculate the logarithm of ", x, ".\n", sep="") }, error = function(ex) { cat("error: Could not calculate the logarithm of ", x, ".\n", sep="") }) cat("The logarithm of ", x, " is ", l, ".\n\n", sep="") options(oopts) message("TESTING: Exception...DONE") R.oo/tests/attachLocally.Object.R0000644000177400001440000000073512726216524016553 0ustar murdochusersmessage("TESTING: attachLocally()...") library("R.oo") foo <- function(object, arg1="some value", ...) { cat("Local objects in foo():\n") print(ls()) attachLocally(object) cat("\nLocal objects in foo():\n") print(ls()) for (name in ls()) { cat("\nObject '", name, "':\n", sep="") print(get(name, inherits=FALSE)) } } a <- "A string" obj <- Object() obj$a <- "Another string" obj$b <- NA foo(obj) print(a) message("TESTING: attachLocally()...DONE") R.oo/tests/Package.unload.R0000644000177400001440000000030412726216524015366 0ustar murdochusersmessage("TESTING: Package unloading...") library("R.oo") pkg <- Package("datasets") load(pkg) print(isLoaded(pkg)) unload(pkg) print(isLoaded(pkg)) message("TESTING: Package unloading...DONE") R.oo/tests/hashCode.R0000644000177400001440000000063312726216524014275 0ustar murdochuserslibrary("R.oo") message("TESTING: hashCode() ...") y <- hashCode(character(0L)) print(y) y <- hashCode("") print(y) y <- hashCode(base::letters) print(y) y <- hashCode(integer(0L)) print(y) y <- hashCode(1:10) print(y) y <- hashCode(double(0L)) print(y) y <- hashCode(1:10+0.1) print(y) y <- hashCode(list(0L)) print(y) y <- hashCode(as.list(1:10)) print(y) message("TESTING: hashCode() ... DONE") R.oo/tests/getConstructorS3.R0000644000177400001440000000023712726216524016012 0ustar murdochusersmessage("TESTING: getConstructorS3()...") library("R.oo") fcn <- getConstructorS3("Object") print(args(fcn)) message("TESTING: getConstructorS3()...DONE") R.oo/tests/Object.finalize.R0000644000177400001440000000162512726216524015567 0ustar murdochuserslibrary("R.oo") oopts <- options(warn=1L) message("TESTING: finalize() on Object ...") setConstructorS3("MyClass", function() { extend(Object(), "MyClass") }) setMethodS3("finalize", "MyClass", function(this, ...) { cat(as.character(this), "is about to be removed from the memory!\n") }) o <- MyClass() o <- MyClass() o <- MyClass() o <- MyClass() gc() ## MyClass: 0x01BE602C is about to be removed from the memory! ## MyClass: 0x01BFF634 is about to be removed from the memory! ## MyClass: 0x01C13584 is about to be removed from the memory! ## used (Mb) gc trigger (Mb) ## Ncells 229903 6.2 467875 12.5 ## Vcells 53725 0.5 786432 6.0 rm(o) ## MyClass: 0x01C578B0 is about to be removed from the memory! ## used (Mb) gc trigger (Mb) ## Ncells 229903 6.1 467875 12.3 ## Vcells 53725 0.5 786432 6.0 message("TESTING: finalize() on Object ... DONE") options(oopts) R.oo/tests/throw.R0000644000177400001440000000105512726216524013721 0ustar murdochusersmessage("TESTING: throw()...") library("R.oo") ## Generate an error ex <- tryCatch({ stop("An error") }, error = function(ex) { ex }) print(ex) ## Re-throw the error ex2 <- tryCatch({ throw(ex) }, error = function(ex) { ex }) print(ex2) stopifnot(identical(ex2, ex)) ## Generate an Exception ex <- tryCatch({ throw("An error") }, error = function(ex) { ex }) print(ex) ## Re-throw the Exception ex2 <- tryCatch({ throw(ex) }, error = function(ex) { ex }) print(ex2) stopifnot(identical(ex2, ex)) message("TESTING: throw()...DONE") R.oo/tests/typeOfClass.R0000644000177400001440000000107012726216524015007 0ustar murdochusersmessage("TESTING: typeOfClass()...") library("R.oo") type <- typeOfClass(NULL) print(type) stopifnot(is.na(type)) type <- typeOfClass(Object) print(type) stopifnot(type == "S3-Object") type <- typeOfClass("Object") print(type) stopifnot(type == "S3-Object") library("methods") type <- typeOfClass("data.frame") print(type) stopifnot(type == "S4") clazz <- getClass("data.frame") type <- typeOfClass(clazz) print(type) stopifnot(type == "S4") type <- typeOfClass("Non-Existing-Class") print(type) stopifnot(is.na(type)) message("TESTING: typeOfClass()...DONE") R.oo/tests/ASCII.R0000644000177400001440000000053012726216524013403 0ustar murdochusersmessage("TESTING: ASCII...") library("R.oo") ## Display ASCII table print(R.oo::ASCII) idxs <- 1:255 str(idxs) chars <- intToChar(idxs) print(chars) stopifnot(length(chars) == length(idxs)) idxs2 <- charToInt(chars) str(idxs2) stopifnot(length(idxs2) == length(chars)) stopifnot(identical(idxs2, idxs)) message("TESTING: ASCII...DONE") R.oo/tests/BasicObject.R0000644000177400001440000000470412726216524014732 0ustar murdochusersmessage("TESTING: BasicObject...") library("R.oo") obj <- BasicObject() print(obj) obj <- BasicObject(42L) print(obj) stopifnot(obj == 42L) obj$a <- 1:99 print(obj) fields <- getFields(obj) print(fields) hasA <- hasField(obj, "a") print(hasA) stopifnot(hasA) value <- obj$a str(value) stopifnot(identical(value, 1:99)) obj$a <- 1:100 print(obj) value <- obj[["a"]] str(value) stopifnot(identical(value, 1:100)) size <- objectSize(obj) print(size) ref <- isReferable(obj) print(ref) stopifnot(isTRUE(ref)) time <- getInstantiationTime(obj) print(time) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Attach and detach # - - - - - - - - - - - - - - - - - - - - - - - - - - - - obj <- BasicObject(42L) obj$a <- 1:99 res <- attach(obj) print(res) stopifnot(exists("a", mode="integer")) str(a) ## Object already attached res <- tryCatch(attach(obj), warning=function(w) w) stopifnot(inherits(res, "warning")) res <- detach(obj) print(res) ## Object already detached res <- tryCatch(detach(obj), warning=function(w) w) stopifnot(inherits(res, "warning")) obj <- BasicObject(list(a=1L, b=2, c=3)) res <- attach(obj) print(res) stopifnot(exists("a", mode="integer")) str(a) res <- detach(obj) print(res) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Class # - - - - - - - - - - - - - - - - - - - - - - - - - - - - obj2 <- newInstance(obj, 43L) print(obj2) stopifnot(obj2 == 43L) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Inheritance # - - - - - - - - - - - - - - - - - - - - - - - - - - - - setConstructorS3("MyObject", function(...) { extend(BasicObject(), "MyObject", ...) }) obj <- MyObject(a=1, b=2) print(obj) str(obj) stopifnot(all(c("a", "b") %in% names(attributes(obj)))) setMethodS3("foo", "MyObject", function(static, x=1L, ...) { list(x=x, ...) }, static=TRUE) res <- MyObject$foo(y=2L) stopifnot(identical(res$x, 1L)) stopifnot(identical(res$y, 2L)) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # FIXME: hashCode() return integer(0) whenever # getInstantiationTime() returns NULL, which is # now the default behavior of BasicObject # - - - - - - - - - - - - - - - - - - - - - - - - - - - - hash <- hashCode(obj) print(hash) ## FIXME: Currently returns integer(0) ## stopifnot(length(hash) == 1L) neq <- equals(obj, 1) print(neq) ## FIXME: Currently returns NA ## stopifnot(!neq) eq <- equals(obj, obj) print(eq) ## FIXME: Currently returns NA ## stopifnot(eq) message("TESTING: BasicObject...DONE") R.oo/tests/trim.R0000644000177400001440000000063212726216524013531 0ustar murdochusersmessage("TESTING: trim()...") library("R.oo") x <- character(0L) y <- trim(x) print(y) stopifnot(identical(y, x)) x <- "Hello world!" y <- trim(x) print(y) stopifnot(identical(y, x)) x <- " \tHello world!\n " y <- trim(x) print(y) stopifnot(identical(y, "Hello world!")) x <- c(" \tHello", "world!") y <- trim(x) print(y) stopifnot(identical(y, c("Hello", "world!"))) message("TESTING: trim()...DONE") R.oo/tests/Interface.R0000644000177400001440000000120012726216524014446 0ustar murdochuserslibrary("R.oo") message("TESTING: Interface...") int <- Interface() print(int) setConstructorS3("MyInterface", function(...) { extend(Interface(), "MyInterface") }) int <- MyInterface() print(int) setConstructorS3("MyClass", function(...) { extend(Object(), c("MyClass", uses(MyInterface(), Interface()))) }) obj <- MyClass() print(obj) ## For some reason uses() doesn't play well with covr if (!"covr" %in% loadedNamespaces()) { setConstructorS3("MyClass", function(...) { extend(Object(), c("MyClass", uses("MyInterface", "Interface"))) }) obj <- MyClass() print(obj) } message("TESTING: Interface...DONE") R.oo/tests/ll.R0000644000177400001440000000157212726216524013171 0ustar murdochusersmessage("TESTING: ll()...") library("R.oo") ## Create some objects in the current environment a <- 1:100 env <- new.env() env$b <- letters[1:10] ## List the content of evironments x <- ll(envir=env) print(x) ## Empty environment x <- ll(envir=new.env()) print(x) ## search() path environment x <- ll(envir=1L) str(x) ## search() path environment x <- ll(envir="R.oo") str(x) ## Filter by name pattern x <- ll(envir="R.oo", pattern="^throw.*") print(x) x <- ll(envir="R.oo", pattern="^NonExistingName$") print(x) ## List all functions and sort them by size x <- ll(envir="R.oo", mode="function", sortBy="objectSize") str(x) ## List all functions of a package and sort them by size x <- ll(R.oo, mode="function", sortBy="objectSize") str(x) ## List all functions of an Object obj <- Object() obj$a <- 1:100 obj$b <- new.env() x <- ll(obj) print(x) message("TESTING: ll()...DONE") R.oo/tests/Object.finalize,noattach.R0000644000177400001440000000206212726216524017361 0ustar murdochusersoopts <- options(warn=1L) message("TESTING: finalize() on Object without attach ...") pkgs <- c("R.methodsS3", "R.oo") isAttached <- function(pkgs) { structure(sprintf("package:%s", pkgs) %in% search(), names=pkgs) } # Record which packages were attached from the beginning # (happens if not a fresh session) wasAttached <- isAttached(pkgs) assertPackages <- function(loaded=c("R.methodsS3", "R.oo")) { s <- utils::sessionInfo() s$R.version <- NULL; s$platform <- ""; s$locale <- ""; cat("----------------------------------") print(s) cat("----------------------------------\n\n") loaded <- loaded[!wasAttached[loaded]] stopifnot(!any(isAttached(loaded))) } R.oo::setConstructorS3("MyClass", function(a=1:10) { R.oo::extend(R.oo::Object(), "MyClass", a=a) }) # Create an object with a finalizer x <- MyClass() assertPackages() # Remove 'x' so that it will be finalized below rm(x) gc() assertPackages(loaded="R.oo") message("TESTING: finalize() on Object without attach ... DONE") options(oopts) R.oo/tests/abort.R0000644000177400001440000000160112726216524013662 0ustar murdochusersmessage("TESTING: abort()...") library("R.oo") foo <- function() { cat("foo()...\n") on.exit(cat("foo()...done\n")) tryCatch({ stop("Woops!") }, error = function(ex) { cat("An error was caught: ", ex$message, "\n", sep="") }) cat("Continuing...\n") } bar <- function() { cat("bar()...\n") on.exit(cat("bar()...done\n")) tryCatch({ abort("Woops!") }, error = function(ex) { cat("An error was caught: ", ex$message, "\n", sep="") }) cat("This message will never be displayed...\n") } # An error generated by stop() can be caught foo() ## abort() will abort covr::package_coverage() and ## and any other evaluations beyond this point. if (!"covr" %in% loadedNamespaces() && FALSE) { # ...which is not possible when using abort() bar() # This expression is never reached cat("This line will never be outputted.\n") } # message("TESTING: abort()...DONE") R.oo/tests/Object.finalize,onoff.R0000644000177400001440000000334012726216524016667 0ustar murdochuserslibrary("R.methodsS3") library("R.oo") oopts <- options(warn=1L) message("TESTING: finalize() on Object on and off ...") finalized <- NULL if ("covr" %in% loadedNamespaces()) { assertFinalization <- function(name) TRUE } else { assertFinalization <- function(name) { cat(sprintf("Is '%s' in '%s'?\n", name, paste(finalized, collapse=", "))) stopifnot(is.element(name, finalized)) } } name <- NULL nextName <- function() { if (is.null(name)) return(letters[1L]) letters[which(letters == name) + 1L] } setMethodS3("finalize", "Foo", function(this, ...) { cat(sprintf("Finalizing %s()...\n", class(this)[1L])) name <- unclass(this) cat(sprintf(" Value: %s\n", name)) finalized <<- c(finalized, name) cat(sprintf("Finalizing %s()...done\n", class(this)[1L])) }) setConstructorS3("Foo", function(..., ...finalize=NA) { extend(Object(...), "Foo", ...finalize=...finalize) }) # Default x <- Foo(name <- nextName()) rm(list="x"); gc() assertFinalization(name) # Default (explicit) x <- Foo(name <- nextName(), finalize=TRUE, ...finalize=NA) rm(list="x"); gc() str(finalized) assertFinalization(name) # Disable x <- Foo(name <- nextName(), finalize=FALSE, ...finalize=FALSE) rm(list="x"); gc() str(finalized) # Disable (forced) x <- Foo(name <- nextName(), finalize=TRUE, ...finalize=FALSE) rm(list="x"); gc() str(finalized) # Enable (forced) x <- Foo(name <- nextName(), finalize=FALSE, ...finalize=TRUE) rm(list="x"); gc() str(finalized) assertFinalization(name) print(finalized) # Finalize upon exit options("R.oo::Object/finalizeOnExit"=TRUE) y <- Foo(name <- "OnExit") message("TESTING: finalize() on Object on and off ... DONE") options(oopts) R.oo/tests/Class.R0000644000177400001440000000253112726216524013623 0ustar murdochusersmessage("TESTING: Class...") library("R.oo") clazz <- Object print(clazz) print(as.character(clazz)) message(" - instantiation ...") obj <- Object() print(obj) obj <- newInstance(clazz) print(obj) stopifnot(inherits(obj, "Object")) obj <- clazz[["newInstance"]]() print(obj) stopifnot(inherits(obj, "Object")) message(" - instantiation ... DONE") message(" - reflection ...") clazz <- Class$forName("Object") print(clazz) print(getKnownSubclasses(clazz)) static <- getStaticInstance(clazz) print(static) pkg <- getPackage(clazz) print(pkg) stopifnot(pkg == "R.oo") ## Odds and ends print(isBeingCreated(clazz)) ## FIXME: Case should never occur but code allows for it print(isBeingCreated.Class(obj)) message(" - reflection ... DONE") message(" - modifiers ...") print(isAbstract(clazz)) print(isPrivate(clazz)) print(isProtected(clazz)) print(isPublic(clazz)) print(isDeprecated(clazz)) print(isStatic(clazz)) ## TRUE because of Object$load() message(" - modifiers ... DONE") message(" - inheritance ...") setConstructorS3("MyClass", function(...) { extend(Object(), "MyClass", ...) }) obj <- MyClass(a=1, b=2, c=3) print(obj) stopifnot(all(c("a", "b", "c") %in% names(obj))) obj <- newInstance(MyClass, a=1, b=2, c=3) print(obj) stopifnot(all(c("a", "b", "c") %in% names(obj))) message(" - inheritance ... DONE") message("TESTING: Class...DONE") R.oo/tests/InternalErrorException.reportBug.R0000644000177400001440000000127412726216524021176 0ustar murdochusersmessage("TESTING: InternalErrorException...") library("R.oo") ex <- InternalErrorException("Hmm... I didn't expect this!") print(ex) ex2 <- InternalErrorException("Hmm... I didn't expect this!", package=R.oo) print(ex2) ex3 <- InternalErrorException("Hmm... I didn't expect this!", package="R.oo") print(ex3) myLog <- function(x, ...) { if (!is.numeric(x)) { throw(InternalErrorException("Argument 'x' to myLog() is not numeric: ", mode(x), package=R.oo)) } log(x, ...) } myLog(2) ex <- NULL tryCatch({ myLog("a") }, error= function(ex) { ex <- Exception$getLastException() }) message("TESTING: InternalErrorException...DONE") R.oo/tests/zzz.Object.finalize,reentrant.R0000644000177400001440000000272212726216524020421 0ustar murdochusersmessage("TESTING: finalize() reentrant...") ## FIXME: 'covr' does not play well with tests ## detaching/unloading packages if ("covr" %in% loadedNamespaces()) { detach <- function(...) NULL } library("R.methodsS3") library("R.oo") lotsOfParsing <- function(code="y <- 1:3") { parse(text=rep(code, times=10000)) } setConstructorS3("MyClass", function(a=1:10) { extend(Object(), "MyClass", a=a) }) setMethodS3("finalize", "MyClass", function(this, ...) { cat("finalize...\n") utils::str(sys.calls()) cat("finalize...done\n") }) # Parse and eval expression (works) expr <- lotsOfParsing() eval(expr) print(y) ## [1] 1 2 3 stopifnot(identical(y, 1:3)) # Create an object with a finalizer x <- MyClass() # Detach R.oo so that the finalizer will try to reload it detach("package:R.oo") # Remove 'x' so that it will be finalized below rm(x) # This may trigger garbage collection via parse() # If so, it is important that parse() is not called # (indirectly via library()) by the finalizer. # Because otherwise R may crash. expr2 <- lotsOfParsing(code="y <- 1:4") ## finalize... ## Dotted pair list of 9 ## $ : ... ## ... ## $ : language function (env) { ... ## $ : language finalize(this) ## $ : language finalize.MyClass(this) ## Parse called: TRUE ## finalize...done eval(expr2) print(y) ## [1] 1 2 3 4 stopifnot(identical(y, 1:4)) print(warnings()) message("TESTING: finalize() reentrant...DONE") R.oo/tests/isBeingCreated.Class.R0000644000177400001440000000130312726216524016466 0ustar murdochusersmessage("TESTING: isBeingCreated()...") library("R.oo") setConstructorS3("Car", function(brand=NULL, nbrOfWheels=0) { if(!isBeingCreated(Car)) { if (is.null(brand)) throw("A car must have a brand") if (nbrOfWheels <= 0) throw("A car must have one or more wheels: ", nbrOfWheels) } extend(Object(), "Car", .brand = brand, .nbrOfWheels = nbrOfWheels ) }) setMethodS3("as.character", "Car", function(this, ...) { cat(class(this)[1], ":", this$.brand, " with ", this$.nbrOfWheels, " wheels.", sep=""); }) print(Car("Volvo", 4)) print(Car("BMW", 4)) print(Car("Tyrrell P34", 6)) print(Car("T-Rex", 3)) message("TESTING: isBeingCreated()...DONE") R.oo/NAMESPACE0000644000177400001440000002125712763175003012513 0ustar murdochusers# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # IMPORTS # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - importFrom("R.methodsS3", "setMethodS3") importFrom("R.methodsS3", "setGenericS3") importFrom("R.methodsS3", "isGenericS3") importFrom("R.methodsS3", "throw") importFrom("R.methodsS3", "pkgStartupMessage") importFrom("R.methodsS3", "appendVarArgs") importFrom("methods", "getClasses") importFrom("methods", "getMethods") importFrom("methods", "getClass") importFrom("methods", "isClass") importFrom("utils", "as.person") importFrom("utils", "capture.output") importFrom("utils", "citation") importFrom("utils", "compareVersion") importFrom("utils", "file_test") importFrom("utils", "install.packages") importFrom("utils", "installed.packages") importFrom("utils", "object.size") importFrom("utils", "old.packages") importFrom("utils", "packageDescription") importFrom("utils", "sessionInfo") importFrom("utils", "str") importFrom("utils", "update.packages") importFrom("utils", ".DollarNames") if (getRversion() >= "2.14.0") { importFrom("stats", "getCall") } if (getRversion() >= "3.3.0" && "getSource" %in% getNamespaceExports("utils")) { importFrom("utils", "getSource") } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # EXPORTS # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Export all public methods, that is, those without a preceeding dot # in their names. exportPattern("^[^\\.]") # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # DECLARATIONS # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # default S3method("getClasses", "default") ## Should be renamed/removed from API S3method("getMethods", "default") ## Should be renamed/removed from API # BasicObject S3method(".subset2Internal", "BasicObject") S3method("$", "BasicObject") S3method("$<-", "BasicObject") S3method("[[", "BasicObject") S3method("[[<-", "BasicObject") S3method("as.character", "BasicObject") S3method("attach", "BasicObject") S3method("detach", "BasicObject") S3method("equals", "BasicObject") S3method("extend", "BasicObject") S3method("getFields", "BasicObject") S3method("getInstantiationTime", "BasicObject") S3method("hasField", "BasicObject") S3method("hashCode", "BasicObject") S3method("isReferable", "BasicObject") S3method("newInstance", "BasicObject") S3method("objectSize", "BasicObject") S3method("print", "BasicObject") S3method(".DollarNames", "BasicObject") # character S3method("uses", "character") # Class S3method(".subset2Internal", "Class") S3method("$", "Class") S3method("$<-", "Class") S3method("[[", "Class") S3method("[[<-", "Class") S3method("argsToString", "Class") S3method("as.character", "Class") S3method("forName", "Class") S3method("getDetails", "Class") S3method("getFields", "Class") S3method("getKnownSubclasses", "Class") S3method("getMethods", "Class") S3method("getName", "Class") S3method("getPackage", "Class") S3method("getRdDeclaration", "Class") S3method("getRdHierarchy", "Class") S3method("getRdMethods", "Class") S3method("getStaticInstance", "Class") S3method("getSuperclasses", "Class") S3method("isAbstract", "Class") S3method("isBeingCreated", "Class") S3method("isDeprecated", "Class") S3method("isPrivate", "Class") S3method("isProtected", "Class") S3method("isPublic", "Class") S3method("isStatic", "Class") S3method("newInstance", "Class") S3method("print", "Class") S3method(".DollarNames", "Class") # classRepresentation S3method("getKnownSubclasses", "classRepresentation") S3method("getRdDeclaration", "classRepresentation") S3method("getRdHierarchy", "classRepresentation") S3method("getRdMethods", "classRepresentation") S3method("getSuperclasses", "classRepresentation") # condition S3method("abort", "condition") # default S3method("abort", "default") S3method("attach", "default") S3method("callSuperMethodS3", "default") S3method("charToInt", "default") S3method("detach", "default") S3method("dimension", "default") S3method("equals", "default") S3method("extend", "default") S3method("gc", "default") S3method("getConstructorS3", "default") S3method("hashCode", "default") S3method("intToChar", "default") S3method("ll", "default") S3method("load", "default") S3method("objectSize", "default") S3method("save", "default") S3method("setConstructorS3", "default") S3method("throw", "default") S3method("trim", "default") S3method("typeOfClass", "default") # environment S3method("getName", "environment") S3method("objectSize", "environment") # error S3method("throw", "error") # Exception S3method("as.character", "Exception") if (getRversion() >= "2.14.0") { S3method("getCall", "Exception") # Only in R (>= 2.14.0) } S3method("getCalls", "Exception") S3method("getLastException", "Exception") S3method("getMessage", "Exception") S3method("getStackTrace", "Exception") S3method("getStackTraceString", "Exception") S3method("getWhen", "Exception") S3method("print", "Exception") S3method("printStackTrace", "Exception") S3method("throw", "Exception") # Interface S3method("as.character", "Interface") S3method("extend", "Interface") S3method("getFields", "Interface") S3method("print", "Interface") S3method("uses", "Interface") # InternalErrorException S3method("getMessage", "InternalErrorException") S3method("getPackage", "InternalErrorException") # Object S3method(".subset2Internal", "Object") S3method("$", "Object") S3method("$<-", "Object") S3method("[[", "Object") S3method("[[<-", "Object") S3method("as.character", "Object") S3method("attach", "Object") S3method("attachLocally", "Object") S3method("clearCache", "Object") S3method("clearLookupCache", "Object") S3method("clone", "Object") S3method("detach", "Object") S3method("equals", "Object") S3method("extend", "Object") S3method("finalize", "Object") S3method("gc", "Object") S3method("getEnvironment", "Object") S3method("getFieldModifier", "Object") S3method("getFieldModifiers", "Object") S3method("getFields", "Object") S3method("getInstantiationTime", "Object") S3method("getInternalAddress", "Object") S3method("getStaticInstance", "Object") S3method("hasField", "Object") S3method("hashCode", "Object") S3method("isReferable", "Object") S3method("ll", "Object") S3method("load", "Object") S3method("names", "Object") S3method("newInstance", "Object") S3method("novirtual", "Object") S3method("objectSize", "Object") S3method("print", "Object") S3method("save", "Object") S3method("registerFinalizer", "Object") S3method("staticCode", "Object") S3method(".DollarNames", "Object") # Package S3method("as.character", "Package") S3method("getAuthor", "Package") S3method("getBundle", "Package") S3method("getBundlePackages", "Package") S3method("getChangeLog", "Package") S3method("getClasses", "Package") S3method("getContents", "Package") S3method("getContribUrl", "Package") S3method("getDataPath", "Package") S3method("getDate", "Package") S3method("getDescription", "Package") S3method("getDescriptionFile", "Package") S3method("getDevelUrl", "Package") S3method("getDocPath", "Package") S3method("getEnvironment", "Package") S3method("getExamplePath", "Package") S3method("getHistory", "Package") S3method("getHowToCite", "Package") S3method("getLicense", "Package") S3method("getMaintainer", "Package") S3method("getName", "Package") S3method("getNews", "Package") S3method("getPath", "Package") S3method("getPosition", "Package") S3method("getTitle", "Package") S3method("getUrl", "Package") S3method("getVersion", "Package") S3method("isLoaded", "Package") S3method("isOlderThan", "Package") S3method("ll", "Package") S3method("load", "Package") S3method("showChangeLog", "Package") S3method("showContents", "Package") S3method("showDescriptionFile", "Package") S3method("showHistory", "Package") S3method("showHowToCite", "Package") S3method("showNews", "Package") S3method("startupMessage", "Package") S3method("unload", "Package") S3method("update", "Package") # RccViolationException S3method("as.character", "RccViolationException") S3method("getRccUrl", "RccViolationException") # Rdoc S3method("argsToString", "Rdoc") S3method("check", "Rdoc") S3method("compile", "Rdoc") S3method("createManPath", "Rdoc") S3method("createName", "Rdoc") S3method("declaration", "Rdoc") S3method("escapeRdFilename", "Rdoc") S3method("getClassS4Usage", "Rdoc") S3method("getKeywords", "Rdoc") S3method("getManPath", "Rdoc") S3method("getNameFormat", "Rdoc") S3method("getObject", "Rdoc") S3method("getPackageNameOf", "Rdoc") S3method("getRdTitle", "Rdoc") S3method("getUsage", "Rdoc") S3method("hierarchy", "Rdoc") S3method("isKeyword", "Rdoc") S3method("isVisible", "Rdoc") S3method("methodsInheritedFrom", "Rdoc") S3method("setManPath", "Rdoc") S3method("setNameFormat", "Rdoc") # RdocException S3method("as.character", "RdocException") S3method("getSource", "RdocException") R.oo/NEWS0000644000177400001440000017075013005670545011777 0ustar murdochusersPackage: R.oo ============= Version: 1.21.0 [2016-10-30] o Now TAB-completion works on elements of Object, BasicObject and Class. o Now getElement() works also for Object, Class and BasicObject. o [[() for Object, Class and BasicObject gained argument 'exact', but exact=FALSE is currently ignored and treated as exact=TRUE. Version: 1.20.0 [2016-02-17] o Some S3 methods for R.oo classes Object and Exception would interfere with ditto for rJava objects that had class attributes containing "Object" and "Exception". Although these classes have the same name, and therefore are in conflict, they represent completely different classes. For methods where conflicts have been identified, the R.oo implementations will try to detect the conflict and call the next method instead. o Now print() and startupMessage() for Package only report on package date if date exists. o CLEANUP: Package requires R (>= 2.13.0) (April 2011), because R.methodsS3 effectively requires that version. o CLEANUP: Explicit namespace imports also from 'utils' package. o CLEANUP: Drop unused code. o BUG FIX: clazz[[method]]() for Class object clazz did not call the intended static method, as clazz$() would do. o BUG FIX: getClasses() for Package would return NULL. Version: 1.19.0 [2015-02-27] o Now charToInt() returns integers as documented (was numerics). o ROBUSTNESS: Now explicitly declare "default" S3 methods for getClasses and getMethods. o ROBUSTNESS: Dropped non-ASCII characters from R source comments. o BUG FIX: objectSize() for environment could result in infinite recursive calls if there circular dependencies between environments. Added package test for objectSize() including this case. o BUG FIX: getKnownSubclasses() for Class could throw an error if one of the objects "scanned" for being a function and of class Class would thrown an error from just looking at it. See R-devel thread 'Inspect a "delayed" assigned whose value throws an error?' on 2015-01-26 for details. o BUG FIX: Forgot to explicitly import getClasses and getMethods from the 'methods' package. Interestingly, this one has never given an error. o BUG FIX: getStaticInstance() for Object now searches the parent/calling environment as well. This covers the case when constructors and objects are created in a local environment (contrary to package namespaces and the global environment). Version: 1.18.5 [2015-01-05] o CLEANUP: Now update() for Package is defunct; use update.packages(). Version: 1.18.4 [2014-12-29] o Added argument 'decreasing' to ll(), e.g. ll(sortBy="objectSize", decreasing=TRUE). Version: 1.18.3 [2014-10-18] o BUG FIX: Rdoc$compile() and Rdoc tag @allmethods failed to provide links and titles on non-exported S3 methods. Version: 1.18.2 [2014-04-26] o Now Rdoc$getRdUsage() escapes '%*%' to `'\%*\%'` in the Rd output. Version: 1.18.1 [2014-03-30] o BUG FIX: Now getRdDeclaration(), getRdHierarchy() and getRdMethods() for Class handles also non-exported methods and Classes. Version: 1.18.0 [2014-02-22] o IMPORTANT: A registered finalizer function for Object:s no longer calls finalize() on the Object itself unless the R.oo package is loaded, whereas previously it would have tried to temporarily reattach the R.oo package. On the other hand, it is now sufficient to have R.oo loaded for finalize() to be called, whereas in the passed it also had to be attached. o DEPRECATED: Deprecated gc() for Object. Use clearCache(..., gc=TRUE) instead. Version: 1.17.1 [2014-02-05] o CLEANUP: Argument 'properties' of ll() defaults to an options, which if not set in turn defaults to a given value. The ll() method is no longer trying to set that option if missing. The option is also no longer set when the package is attached. Version: 1.17.0 [2014-01-05] o Now Class$forName() searches all loaded namespaces as a last resort. Version: 1.16.2 [2014-01-05] o Now static method Class$forName() accepts optional 'envir' argument for specifying from where to search for the Class object. o Added argument 'gc=FALSE' to clearCache(). It is recommended to start using clearCache(obj, gc=TRUE) instead of gc(obj). o CLEANUP: Defunct registerFinalizer() for Object. o BUG FIX: The temporary finalizer() registered for Object while loading the R.oo package itself would cause cyclic loading of R.oo. The reason was that it checked whether R.oo was available or not, by only looking at attached namespaces but not loaded ones. This bug was introduced in R.oo 1.16.0. o Bumped package dependencies. Version: 1.16.1 [2014-01-04] o ROBUSTNESS: Added several missing importFrom() and S3method() statements to the NAMESPACE file. Version: 1.16.0 [2013-10-13] o ROBUSTNESS: Added argument 'finalize' to Object() to specify whether a finalizer should be registered or not. If so, then generic function finalize() is called on the Object. Furthermore, extend() for Object gained argument '...finalize', which, regardless of argument 'finalize' of Object, force the registration of a finalizer (...finalize=TRUE) or the removal of one (...finalize=FALSE). If ...finalize=NA (default), then the finalizer is enabled/disabled according to argument 'finalize' of Object. For backward compatibility reasons, the default behavior is still to register a finalizer for Object:s, but this may change in a future release. o ROBUSTNESS: Now the package's system tests assumes that it's only the 'base' package that is attached. o BUG FIX/ROBUSTNESS: Now Object finalizers will no longer try to re-attach the 'R.oo' package if library() is in the process of trying to attach another package, because otherwise a cyclic loading of namespaces may occur. This was observed for a package that allocated a temporary Object .onAttach() which then was garbage collected and finalized. Version: 1.15.8 [2013-10-10] o BUG FIX/ROBUSTNESS: It appears that when loading the package it may happen that the 'R.oo' namespace is loaded cyclicly, though this has only been observed while running 'R CMD INSTALL'. This may be because a Package object (R.oo::R.oo) is assigned during the loading of the namespace. Since Package extends() an Object object, this may end up loading 'R.oo' again. To avoid this, R.oo::R.oo is now assigned using delayed assignment. Version: 1.15.7 [2013-10-08] o ROBUSTNESS: Now using inherits=FALSE in several internal exists()/get() calls. Version: 1.15.6 [2013-10-07] o Now importing getCall() from 'stats', iff R (>= 2.14.0). o Now Rdoc tag @howToCite does a better job when there are multiple citations in CITATION. Version: 1.15.5 [2013-09-28] o Now the 'R.oo' Package object is also available when the package is only loaded (but not attached). Version: 1.15.4 [2013-09-26] o CLEANUP: Deprecated update() for Package. o CLEANUP: Deprecated non-used registerFinalizer() for Object. Version: 1.15.3 [2013-09-23] o Now properly declaring all S3 methods in the NAMESPACE file. Version: 1.15.2 [2013-09-20] o ROBUSTNESS: Forgot to import R.methodsS3::appendVarArgs(). o BUG FIX: The finalizer function registered by extend() for Object:s assumed that the 'utils' is attached while calling capture.output(), which under certain conditions could generate 'Error in getObjectInfo(this) : could not find function "capture.output"' while the garbage collector was running. In extreme cases it could also crash R. Version: 1.15.1 [2013-08-29] o library("R.oo", warn.conflicts=FALSE, quietly=TRUE) will load the package completely silently. o Now startupMessage() for Package acknowledges library(..., quietly=TRUE). o setConstructorS3() no longer requires that R.oo is attached ("loaded"). Version: 1.15.0 [2013-08-23] o CLEANUP: Dropped deprecated inst/HOWTOSITE replaced by inst/CITATION. o CLEANUP: Package no longer utilizes ':::'. o CLEANUP: Made get- and showHowToCite() protected methods. o CLEANUP: Now getHowToCite() for Package utilizes utils::citation(), if package don't contain a HOWTOCITE file. It is recommended to write packages with CITATION instead of HOWTOCITE. o CLEANUP: Hiding non-essential methods from the Rd help index, e.g. charToInt(), intToChar(), hashCode(), equals(), dimension() and trim(). Version: 1.14.0 [2013-08-20] o Now it's possible to call static methods without attaching ("loading") the package, e.g. R.oo::Class$forName("Object"). Added unit tests for this. o Now getPackage() for Class first searches the namespace of the Class object and then the attached ("loaded") packages. o Now '$' and '$<-' for Object locates the static instance of the Class using getStaticInstance() for Object. o Updated getStaticInstance() for Object to search more locations. Version: 1.13.10 [2013-07-11] o Now R.oo::ll() works without attaching the package. This is done by attaching R.oo when called. o Now it is possible to use static methods of a Class without attaching the package where the Class is defined, e.g. R.utils::Arguments$getIndex(2). To enable this feature, options("R.oo::Class/searchNamespaces"=TRUE) must be set. o BUG FIX: ll(private=TRUE) gave an error if the environment contained the special '...' argument. Version: 1.13.9 [2013-07-01] o Bumped up package dependencies. Version: 1.13.8 [2013-06-27] o Added a trial version of Rdoc tag @usage. Version: 1.13.7 [2013-05-30] o Now Rdoc$compile() infer the package name from the DESCRIPTION file (instead from the package directory name). o Added argument 'path' to compileRdoc(). Version: 1.13.6 [2013-05-25] o Minor speedup by replacing all rm(x) with rm(list="x"). Version: 1.13.5 [2013-05-20] o Now Rdoc$getUsage() inserts line breaks so that any usage line is at most 90 characters long. o CRAN POLICY: Now all Rd \usage{} lines are at most 90 characters long. Version: 1.13.4 [2013-04-08] o Now the @RdocData Rdoc tag also adds an \docType{data} Rd tag. Version: 1.13.3 [2013-04-04] o BUG FIX: In R.oo v1.13.1 a bug was introduced causing the value of Rdoc tag @allmethods not to be parsed and instead treated as text. Version: 1.13.2 [2013-04-03] o Now Rdoc$compile() outputs the same Rd files regardless of system settings. More precisely, it always uses '\n' for line breaks and locale "C" (default) for sorting strings. o Now Rdoc$compile(..., filename) handles when argument 'filename' is a vector of filenames. Version: 1.13.1 [2013-03-25] o Now Rdoc$compile(..., check=TRUE) saves the erroneous Rd to file before throwing the exception. This helps troubleshooting. o BUG FIX: Rdoc$compile() could sometimes drop '}' following Rdoc tags. Version: 1.13.0 [2013-03-08] o Added support for Rdoc tag @author to have an optional value, e.g. @author "John Doe" as well as @author "JD, FB" where the initials are inferred from the package's DESCRIPTION file. o Added compileRdoc() to make it easier to compile Rdoc comments into Rd help files, e.g. Rscript -e "R.oo::compileRdoc()". o Now getAuthor() and getMaintainer() for Package use the 'Authors@R' field of DESCRIPTION and if not found then the 'Author'/'Maintainer' field. In addition, using argument 'as="person"' will parse and return the results as a 'person' list. o Added an Authors@R field to the DESCRIPTION. Version: 1.12.0 [2013-03-04] o DOCUMENTATION: It is now easier to find help for static method, e.g. help("Object$load") and ?"Object$load". o DOCUMENTATION: For "static" methods (e.g. Object$load()), the Rdoc compiler now generates a \usage{} section without the deprecated Rd markup \synopsis{}, which has been replaced by the static call placed in a comment. It also uses the static method as the name and alias (e.g. \name{Object$load}). Version: 1.11.7 [2013-01-08] o ROBUSTNESS/BUG FIX: Made the Object finalizers reentrant. This was previously not the case on R prior to R v2.15.2 Patched r61487 iff the garbage collection is triggered from within base::parse() and the R.oo package is not already loaded when the finalizer is called. In such cases, R could crash. Added a package system test for this. Thanks to Duncan Murdoch (R core) for reporting on this and R core for making base::library() reentrant in R (>= 2.15.2 Patched r61487). Version: 1.11.6 [2013-01-08] o Added argument 'format' to getInternalAddress() for Object. o BUG FIX: The hexadecimal string returned by as.character() for Object would contain the decimal value and not the hexadecimal one. Version: 1.11.5 [2012-12-28] o GENERALIZATION: Further preparation for supporting R.oo and its derived packages to be imported without attaching ("loading") them. o Replaced all data.class(obj) with class(obj)[1L]. o ROBUSTNESS/BUG FIX: getMethods() for Class would give an error if no methods were found for the queried Class. o ROBUSTNESS/BUG FIX: In the rare case where getStaticInstance() for Class failed to setup a static instance, the temporary state set internally would not be unset. Version: 1.11.4 [2012-12-19] o Added startupMessage() for Package. Version: 1.11.3 [2012-12-18] o R CMD check for R devel no longer gives a NOTE on attach(). Version: 1.11.2 [2012-11-29] o Made getKnownSubclasses() for Class a bit faster. Version: 1.11.1 [2012-11-28] o LIMITATION: Registered finalizer for pure Object:s (i.e. excluding those which are of a subclass of Object) will no longer be called if the R.oo package has been detached. This should be a very unlikely scenario. o BUG FIX: extend() for Object dropped existing field modifiers. Version: 1.11.0 [2012-11-23] o GENERALIZATION: Preparing for better support for Object/Class in import-only namespaces, i.e. without packages being loaded. o Now getStaticInstance() for Class sets the environment for the returned Object to that of the Class. Version: 1.10.3 [2012-11-18] o ROBUSTNESS: Now nearly all S3 methods are declared properly in the namespace. o Updated the URL returned by RccViolationException$getRccUrl(). Version: 1.10.2 [2012-11-07] o BUG FIX: obj$(...) would throw an error iff the Object 'obj' was saved/instantiated by R.oo (< 1.10.0). Code is now backward compatible with this case. Thanks Roger Day at University of Pittsburgh Cancer Institute and Dan Tenenbaum (BioC core) for reporting on this. Version: 1.10.1 [2012-10-16] o ROBUSTNESS/BUG FIX: No longer passing '...' to NextMethod(), cf. R-devel thread 'Do *not* pass '...' to NextMethod() - it'll do it for you; missing documentation, a bug or just me?' on Oct 16, 2012. Version: 1.10.0 [2012-10-14] o GENERALIZATION: Now $(...) calls the corresponding generic function (static, ...), where 'static' is the static object of Class . This allows for using NextMethod() in static functions. Calls to $(...) and $(...) were adjusted analogously. o Now throw() for Exception outputs the error message both above and below the stack trace, which is particularly useful when the stack trace is long. o BUG FIX: The stacktrace details collected by Exception dropped the names of the functions. Version: 1.9.10 [2012-09-14] o ROBUSTNESS/BUG FIX: The Exception constructor could generate warning 'In if (regexpr("^function\\(", code) != -1) return("") : the condition has length > 1 and only the first element will be used' occurring in its local fcnName() function. Now code no longer assumes that 'code' is of length 1. Version: 1.9.9 [2012-09-11] o Now throw() for Exception aborts (after signalling and outputting the message) by calling stop(). Ideally it should utilize abort(), but the new version of abort() may be "caught" is certain cases. o ROBUSTNESS/CRAN POLICY: Updated abort() for condition to utilize invokeRestart("abort"). This avoids having to call .Internal(.signalCondition(...)). It also means that the message outputted by abort() no longer starts with a "Error in ...:" line. abort() imitates how stop() works but without the signalling. o BUG FIX: getContribUrl() and getDevelUrl() would give an error if corresponding fields did not exists in the DESCRIPTION file. Now they return NAs just as getUrl(). Version: 1.9.8 [2012-06-22] o GENERALIZATION: Added newInstance() for BasicObject. o ROBUSTNESS: Now constructor BasicObject() is guaranteed to return an object with non-duplicated class attribute elements. Version: 1.9.7 [2012-06-20] o CLEANUP: Dropped non-used adjusted getClass() generic function, which means that now there is one less function masking the 'methods' package. o BUG FIX/GENERALIZATION: throw() for Exception would give an error on R < 2.14.0, where no generic getCall() exists. Now it works for all versions of R. Version: 1.9.6 [2012-06-11] o BUG FIX/GENERALIZATION: Rdoc$getKeywords() now uses system environment variable R_DOC_DIR for locating the internal KEYWORDS.db. Thanks Charles Hogg at NIST for suggesting this. Version: 1.9.5 [2012-04-20] o Added argument 'export' to setConstructorS3(). o Now Rdoc$getUsage() searches also the package namespace for the function/method definition. This is done, before looking in the global search path. o CLEANUP: setConstructorS3() no longer sets attribute "formals". It has been deprecated since April 2003. Version: 1.9.4 [2012-04-05] o Now package imports and exports getCall() from the 'stats' package so that generic function getCall() is available for Exception:s also when 'stats' is not loaded, e.g. during executing .Rprofile. Version: 1.9.3 [2012-03-18] o Now it is possible to set the default value of argument 'cleanup' of getStackTrace() for Exception via an option. Version: 1.9.2 [2012-03-08] o Made stack traces of Exception:s more informative and cleaner. o Now the default throw() of R.methodsS3 is "quietly" overwritten, i.e. there is no longer a warning about it when R.oo is loaded. o Now package no longer warns about renaming existing functions getMethods() and getClasses() of 'base' to default methods during installation, iff R.methodsS3 (>= 1.2.3). Version: 1.9.1 [2012-03-05] o CLEANUP: throw() for 'error' is now just a wrapper for stop(). Previously it had to do what stop() now does for 'condition' objects. o CRAN POLICY: Replaced all appendVarArgs() for 'base' functions that do .Internal() calls, because they would then appear as local functions of this package and hence not be accepted by CRAN according to their new policies. Instead we now create "default" functions that are wrappers to the corresponding functions in the 'base' package. Extra care has to be taken for functions that have arguments whose values are dependent on the call environment/closure. o CRAN POLICY: Dropped .Internal() calls in the default ll() method, in getMethods() for Class objects, and in throw() for Exceptions. Version: 1.9.0 [2012-02-23] o Now the package imports 'utils' instead of depending on it. This means that all packages that depends on 'R.oo' for loading 'utils' for them need to explicitly load it themselves. o The R.oo package now requires (at least) R v2.4.0 (Oct 2006!) Version: 1.8.3 [2011-11-01] o CLEANUP/FIX: Dropped package.description() from getDescriptionFile() for Package, which was done for compatibility reasons when it was deprecated in R v1.9.0. It will be dropped completely in R v2.15.0. Version: 1.8.2 [2011-08-25] o DOCUMENTATION: Added further clarification to help(setConstructorS3) about the requirement that constructors defined by setConstructorS3() have to be callable without arguments. Version: 1.8.1 [2011-07-10] o Changed first argument of getCall() to 'x', because that is what the new getCall() method of 'stats' in R v2.14.0 uses. Version: 1.8.0 [2011-04-03] o ROBUSTNESS: Now finalizers for Object:s are registered to be called also when the R session is quit, if the "R.oo::Object/finalizeOnExit" option is TRUE. If FALSE (default), as before, the finalizers were only executed when Object:s were cleaned up by the garbage collector. o Turned of the default instantiation timestamp for Object and BasicObject. The main reason is that it makes it very complicated to calculate reproducible checksums. However, for backward compatibility, it is possible to turn on the timestamp by setting option "R.oo::Object/instantiationTime". For BasicObject there is option "R.oo::BasicObject/instantiationTime". o Added protected getFieldModifiers() and getFieldModifier(). o Added argument 'recursive' to clearCache() for recursively traversing all elements are clearing the cache of all detected Object:s. o Now clearCache() also calls clearLookupCache(). o Added protected clearLookupCache() for clearing internal objects stored in the Object and that are used for faster field lookups. o CLEANUP: Dropped deprecated getInstanciationTime(). Version: 1.7.5 [2011-02-01] o ROBUSTNESS: Now using 'inherits' (not 'inherit') in all calls to get() and exists(). Version: 1.7.4 [2010-09-22] o Now Rdoc lines are allowed to start with double ('##') or triple ('###') comment characters in addition to single ('#') ones. Version: 1.7.3 [2010-06-04] o Now argument 'addTimestamp' of Rdoc$compile() defaults to FALSE. This way the generate Rd file will remain identical unless there are real Rdoc/code changes. Not adding timestamps is better when working with a version control systems. o BUG FIX: If there are no Rd files, then check() of Rdoc would throw the error "object 'res' not found". Version: 1.7.2 [2010-04-13] o BUG FIX: Package(pkg) would throw "Error in Package(pkgname) : object 'package' not found", if 'pkg' is installed in multiple libraries. Version: 1.7.1 [2010-03-17] o CLEAN UP: Loading the package would generate warnings of of several conflicts. Forgot to export '.conflicts.OK' after adding the name space. Version: 1.7.0 [2010-03-13] o Added a NAMESPACE. Version: 1.6.7 [2010-01-21] o Added some more "get started" help to help(R.oo). Version: 1.6.6 [2009-11-19] o Added isOlderThan() for Package. Version: 1.6.5 [2009-10-30] o ROBUSTIFICATION: Lowered the risk for save() of Object to leave an incomplete file due to say power failures etc. This is done by first writing to a temporary file, which is then renamed. If the temporary file already exists, an exception is thrown. Version: 1.6.4 [2009-10-27] o Removed a stray print() statement in attachLocally() for Object:s. Version: 1.6.3 [2009-10-26] o Added objectSize() for environments. o BUG FIX: Rdoc$compile() did not work with R v2.10.0 and newer. Version: 1.6.2 [2009-10-16] o Some cleanup of Rd files to meet the stricter requirements. Version: 1.6.1 [2009-10-09] BUG FIX: getBundle() of Package gave "Error in getBundle.Package(pkg) : subscript out of bounds" starting with R v2.10.0. Version: 1.6.0 [2009-10-02] o Added the Interface class, which is in an alpha version. Version: 1.5.0 [2009-09-09] o Fixed broken/missing Rd links. Version: 1.4.9 [2009-07-07] o Added protected method registerFinalizer() for Object. Version: 1.4.8 [2009-05-18] o DOC FIX: The titles for intToChar() and charToInt() where mixed up. Thanks to Jens Philip Hoehmann for reporting this. Version: 1.4.7 [2009-01-10] o FIXUP: There were some Rd warnings with the new R v2.9.0. Version: 1.4.6 [2008-08-11] o Replaced all 'a %in% b' with is.element(a,b) due to an old and weird bug that I cannot reproduce, cf. my R-devel post in thread 'Argument "nomatch" matched by multiple actual arguments ... %in% -> match?!?' on March 6, 2008. Thanks Ran Pang for reminding me and for additional troubleshooting. o Added support for more "short tags" in the Rdoc compiler. Version: 1.4.5 [2008-05-28] o SPELL CORRECTION: Added getInstantiationTime(), but keeping misspelled (and now deprecated) getInstanciationTime() for backward compatibility. The internal attribute was also renamed, but the above method look for both in case saved objects are loaded. Version: 1.4.4 [2008-05-08] o Added getNews() and showNews() to the Package class. NEWS files are now detected (first). o Added getConstructorS3(). o The NEWS file does now replace the former HISTORY file of R.oo. o If running R v2.7.0 or new, the first element of vector 'ASCII' is an empty string. This is because ASCII 0x00 cannot be represented as an R string and in R v2.8.0 it will give a warning. Note though that regardless of this, charToInt(intToChar(0)) == 0 is still TRUE. Version: 1.4.3 [2008-03-25] o BUG FIX: getInternalAddress() would return NA. o Added getName() for environment:s. Version: 1.4.2 [2008-03-06] o Added paper to citation("R.oo"). o BUG FIX: Regular expression pattern 'a-Z' is illegal on (at least) some locale, e.g. 'C' (where 'A-z' works). The only way to specify the ASCII alphabet is to list all characters explicitly, which we now do in all methods of the package. See the r-devel thread "invalid regular expression '[a-Z]'" on 2008-03-05 for details. Version: 1.4.1 [2008-01-10] o Made the registered finalizer calling finalize() more error prone. Version: 1.4.0 [2007-09-17] o Extracted setMethodS3() and related methods from R.oo and put them in a standalone R.methodsS3 package. While doing this, the 'enforceRCC' argument used by setMethodS3() was renamed to 'validators' which now takes an optional list of functions. Any code using argument 'enforceRCC=FALSE' must now use 'validators=NULL'. o CLEAN UP: Removed code that patched R v1.8.0 and before. Version: 1.3.0 [2007-08-29] o Now the startup message when loading the package is generated with packageStartupMessage() so that it can be suppressed. o CLEAN UP: Removed showAndWait() for simpleError, which displayed a TclTk dialog for a generic error. Never used. If someone wants the code, please tell me and I'll forward it. o CLEAN UP: Removed deprecated trycatch(); use tryCatch() instead. o CLEAN UP: Removed patched for R v1.8.x and before: stop(), try(). o BUG FIX: If Object:s are garbage collected after R.oo has been detached, the error 'Error in function (env) : could not find function "finalize"' would be thrown, because the registered finalizer hook tries to call the generic function finalize() in R.oo. We solve this by trying to reload R.oo (and the unload it again). Special care was taken so that Object:s allocated by R.oo itself won't cause an endless loop. Version: 1.2.8 [2007-06-09] o Removed (incorrect) argument name 'list' from all substitute() calls. o Removed already deprecated getData() because there might be a name clash with the 'nlme' package. o BUG FIX: Queried non-existing object 'error' instead of 'ex' in the exception handling of update() of the Package class. Version: 1.2.7 [2007-04-07] o Removed support for R v2.0.0 and before. o Removed reportBug() since it was never completed. Version: 1.2.6 [2007-03-24] o Now ll() uses objectSize() instead of object.size(). It also returns the properties in its "minimal" data type, e.g. the 'objectSize' column contains integers (not characters as before). This makes it possible to utilize subset() on the ll() output. o Added a default method for objectSize(), which is just a wrapper for object.size(). o Made trycatch() defunct, i.e. it gives an error suggesting to use tryCatch() instead. Version: 1.2.5 [2007-01-05] o BUG FIX: getMethods(..., private=FALSE) for class Class would return private methods, and private=TRUE would remove them. It should be the other way around. o BUG FIX: getMethods() for Class would sometimes give error message: "Error in result[[k]] : subscript out of bounds". This in turn would cause Rdoc to fail. Version: 1.2.4 [2006-10-03] o BUG FIX: Since getInternalAddress() coerced the address to an integer, addresses about 2^32 bytes = 4GB got address NA. Now getInternalAddress() and the default hashCode() return a double. Version: 1.2.3 [2006-09-07] o Added package 'utils' as a package this one depends on. This is required for package without a namespace in the upcoming R v2.4.0 release. o Removed deprecated method getClass() for class Object but also BasicObject. These were deprecated on 2002-12-15. Version: 1.2.2 [2006-08-11] o Added support for give modifiers to fields in classes extending the Object class. Currently it is only the "cached" modifier that is recognized. To specify that a field, say, "foo" is "cached", list it as "cached:foo". Fields that are "cached" will be assigned to NULL when clearCache() of the object is called. For convenience there is also a gc() method for all Object:s. See ?gc.Object for an example. o Made the package smaller by removing the DSC-2003 logo from the R.oo paper, which shrunk from 324kb to 220kb. The rest of the files in the source distribution is about 80kb when gzipped, i.e. still the paper is three times larger than the rest of the package. Version: 1.2.0 [2006-07-14] o BUG FIX: update(R.oo) would throw an error and the package was detached. Version: 1.1.9 [2006-06-14] o Added method getEnvironment() to class Object, which will return the environment where the Object's members are stored. o Now ll() does not assign variables in the lookup environment, which means it will work with sealed environments too. Version: 1.1.8 [2006-05-30] o Added isBeingCreated() to Class in order to check if the constructor was called to create the static instance or just any instance. o Removed setClassS3() which has been deprecated since 2003(!). o Now the Rdoc tag @allmethods takes an optional argument specifying if private, protected or public methods should be listed. Version: 1.1.7 [2006-05-22] o Added argument 'addTimestamp=TRUE' to Rdoc$compile(). This makes it possible to turn of the timestamp, because timestamps makes diff, say the one in Subversion, think there is a real different. o BUG FIX: Rdoc$compile() did not write the name of the source file in the header (anymore). o BUG FIX: The code for automatic formatting of replacement methods generated an error. Version: 1.1.6 [2006-04-03] o This version was commited to CRAN. o Now the Rdoc compiler recognizes replacement functions and creates the correct Rd \usage{} format for these. Version: 1.1.5 [2006-03-28] o Now argument 'properties' of ll() is given by the option "R.oo::ll/properties". If not set when the package is loaded, it is set to a default value. See help(ll) for more details. This was suggested by Tim Beissbarth, German Cancer Research Center. o BUG FIX: showHistory() for the Package class was calling itself. o BUG FIX: Compiling Rdoc comments with invalid keyword tags would generate an internal error. Same for invalid visibility tags etc. Version: 1.1.4 [2006-02-18] o Now the Rdoc compiler also escapes Rd filenames for @see and @seemethod tags. Version: 1.1.3 [2006-02-09] o Removed all usage of NULL environments since they are now deprecated in R v2.3.0. o Added getChangeLog() and showChangeLog() to the Package class. The get- and showHistory(), which are to be made deprecated in the future, are now wrappers for these two methods. o Added Rdoc tag @RdocPackage to generate -package.Rd files. o Now the Rdoc compiler makes sure that the generated Rd files all starts with a letter or a digit. If not, it adds a default prefix (currently "000"). If not, the new R v2.3.0 R CMD check may complaint about missing objects. o Now '...' is added explicitly to setMethodS3() in all Rd examples. Version: 1.1.2 [2006-01-06] o Added Rd links to classes listed under "Directly known subclasses:". Version: 1.1.1 [2005-11-23] o Added validation of arguments in replacement functions. o Added RCC validation of arguments in 'picky' methods, e.g. $()". o BUG FIX: The "$<-" function goes through alternatives where to save the new value, e.g. set(), field, static field etc. When a "match" found and the value was assigned, it did not return (except for the set() match), but instead contiued search for the rest. One effect of this was that the new value was always assign to the static field too. The fix make the code run faster too. Thanks Edouard Duchesnay at Service Hospitalier Frdric Joliot, Commissariat l'Energie Atomique, France for spotting this. Version: 1.1.0 [2005-07-18] o BUG FIX: Rdoc$compile() sometimes generated the error "invalid regular expression '\name{[^\}]*}'" (forgot to escape '{' and '}'). Fixed. Thanks Lorenz Wernisch, School of Crystallography, University of London of reporting this. o BUG FIX: getDetails() in Class would list private and protected methods as public. o BUG FIX: Argument 'enforceRCC' of setMethodS3() was not passed to setGenericS3(). o Added a section on "Defining static fields" to the help page of Object. o Added argument 'replaceNewline' to getDescription() of Package. o Now as.character() of Package reports the title, the license, and the description, but no longer if the package is part of a bundle. The latter was too slow since it had to scan all installed packages. o Now print() of Class passes '...' to getDetails(), that is, now print(Class, private=TRUE) will work too. o Added attachLocally() to the Object class. o Added extend.default(), which can be used to extend any type of object. o Now pure Object:s are also finalized. Before only subclasses defined via extend(, "", ...) was finalized. This was not a big deal, because the finalize():er of the Object class is empty anyway. Version: 1.0.5 [2005-06-03] o Now the static load() method in Object asserts that the loaded Object inherits from the class that the static object, which is used to call load(), is of. Thus, Object$load(...) will load all Object:s, whereas MyClass$load(...) will only load objects inheriting from MyClass. o Rdoc compiler: - Now an RdocMethod tag will not add keyword 'internal' if the class starts with a lower case, e.g. 'matrix'. - A '@keyword foo' can now be removed with '@keyword -foo'. Order is irrelevant, since @keyword:s are added at the very end. Version: 1.0.4 [2005-05-02] o Added getDevelUrl() to the Package class. Version: 1.0.3 [2005-02-28] o Argument 'appendVarArgs' of setMethodS3() is now ignored if a replacement function (named "nnn<-") is defined. Version: 1.0.2 [2005-02-25] o setMethodS3(..., abstract=TRUE) generated warnings of type "using .GlobalEnv instead of package:". Found a way (ad hoc?) to get rid of them. See source code for details. This should remove similar warnings from packages loading R.oo. Version: 1.0.1 [2005-02-20] o Package now outputs "See ?R.oo for help" when loaded. o Now using three-digit version numbers, e.g. a.b.c where a,b,c in 0,1,...,9. 'a' is updated for major updates, 'b' for minor updates and 'c' is for minor revisions. o Removed require(methods) for R v2.0.0 and above. o setMethodS3(..., abstract=TRUE) now defines abstract methods with '...' as the only argument(s). Version: 1.00 [2005-02-15] o Moved to CRAN. Version: 0.70 [2005-02-15] o Package now passes R CMD check on R v2.1.0 devel without warnings. o Added appendVarArgs=TRUE to setMethodS3(), which specifies that '...' should be added, if missing. o Add argument '...' to all methods to make it even more consistent with any generic function. This is also done for a few methods in the R base packages. Version: 0.69 [2005-02-11] o Package now passes R CMD check on R v2.1.0 devel also. Had do modify a few lines of code to meet the new stricter regular expression patterns. o Renamed get- & showDescription() to get- & showDescriptionFile() and added getDescription() to get the 'Description' field of DESCRIPTION. o Moving away from trycatch() in favor of tryCatch(). trycatch() remains for a while, but will be made deprecated in future version and later probably defunct. o Added an example to setMethodS3() that is not using Object(). Version: 0.68 [2005-02-09] o By default, now Rdoc$compile() runs Rdoc$check() at the end. o Rdoc: Added a first simple test for undefined top-level tags in the generated Rd code. Utilizes tools::Rd_parse(), which might be renamed etc. according to its help page. o Tag-variables such as @author now search for value in options() too. Version: 0.67 [2004-10-23] o BUG FIX: getRdMethods() in Class returned empty \tabular{rll}{} if no methods exist, but this gives an error in R CMD Rdconv. Version: 0.66 [2004-10-21] o When using setMethodS3(..., abstract=TRUE) in a package that uses lazy loading, which all new packages do by default, warnings like "using .GlobalEnv instead of package:utils" will be generated the first time the abstract method is accessed. This is because eval() is used to create the abstract method; we are looking for a way that will not generate these warnings, although they are not serious. Example: library(R.colors); print(getColorSpace.Color) o Made the package compatible with R v2.0.0 too. Had to move example file 'Exception.R' from data/ to inst/misc/ and update the help example for Rdoc. Update the example of unload() for the Package class to load the 'boot' package instead of obsolete 'ts'. o Added help to more methods. o Added getEnvironment() to the Package class. o BUG FIX: Rdoc tags was not be parsed by the Rdoc compiler for deprecated methods. Version: 0.65 [2004-06-27] o Substantially improved the loading of all my packages. The Package() constructor, which was called when a new package was loaded, was slow unnecessarily slow because of an internal call to installed.packages(). o BUG FIX: getInternalAddress() for class Object was "too" hard coded making it not work correctly on for instance Suse Linux. Assumed fixed positions of the hexadecimal address of the environment. Now a gsub() with a backreference is used. Should be more safe. o Added known generic function 'as.vector()'. o Added documentation to many methods. Version: 0.64 [2004-04-21] o Fixed deprecated warning about package.description() that occured R v1.9.0 such that the code still works for older versions of R. This was needed for the Package class. Version: 0.63 [2004-03-03] o To anyone using setClassS3(), please use setConstructorS3() instead; setClassS3() is deprecated and will be phased out soon! o Updated trycatch() (and the Exception class) to work with R v1.8.1. If running R v1.8.1, then tryCatch() is used internally. For R v1.7.1 and before the old trycatch() is used, which will be made deprecated later on. Added a throw() for the error class too for rethrowing errors. o Update the Rdoc compiler to generate correct \name and \alias Rd tags. o BUG FIX: Package class - from R v1.8.1 we noted that R CMD check made installed.packages() return multiple matches of the same package. This might have been a problem before too, but R CMD check never complained. Version: 0.62 [2003-12-31] o Added an "about" section in the documentation. o Added showDescription(), getHistory(), showHistory(), getHowToCite() and showHowToCite() to the Package class. o BUG FIX: For some Rdoc types the \keyword{} statement was placed on the same line as the previous Rd statement. This sometimes generated cluttered Rd index files. Version: 0.61 [2003-12-16] o Package: update() does now also reload the updated package by default. o Exception: Now the throw() method includes the complete stacktrace too when generating a error signal. In other words, the user will automatically see the stacktrace of the error if the error is not caught. Same for stop(). o Rdoc: Added the tag @RdocDocumentation for general documentation. Version: 0.60 [2003-10-28] o BUG FIX: "$<-.Class" was incorrectly returning the static object instead of itself. o BUG FIX: The way "$.Object", "$<-.Object", "$.Class" and "$<-.Class" were checking if an attribute exists was not done correctly. Now they get the list of names of the attributes and compares to that. o Added argument 'compress=TRUE' to Object's save() to make it more explicit that compression is supported too. Compression is supported by all R systems since R v1.5.0. See ?capabilities. o BUG FIX: If Object's save() was called with a connection it would still interpret it as a filename. o Now Rdoc tries to create the 'man/' (destPath) directory if missing. Version: 0.59 [2003-09-19] o BUG FIX: getMethods() was not sensitive to 'deprecated=TRUE'. o Rdoc updates: The Rdoc compile does no long list deprecated methods by default. Version: 0.58 [2003-09-03] o BUG FIX: dimension() would not always be found if ll() was called on another package, e.g. ll(envir="methods"). Version: 0.57 [2003-07-18] o Added Rdoc comments saying that the constructor function must be able to be called without any arguments! Thanks Nathan Whitehouse at Baylor College of Medicine, Houston for making me aware of the missing documentation. o Rdoc$compile() generated an InternalException when a class was not found saying "Not a class". Now it throws an RdocException and is more specific saying that the class does not exists. Updated the Rdoc comments saying pointing out that the classes and methods have to be loaded before calling Rdoc$compile(). Again, thanks Nathan. Version: 0.56 [2003-07-07] o BUG FIX: Forgot to escape '%' in \usage{} in Rdoc, which lead to unbalanced curly brackets when R CMD check * ran. Version: 0.55 [2003-05-14] o Slight improvement in the internal generation of get and set, which is done by using substr()<-. Version: 0.54 [2003-05-03] o Now the Rdoc compiler generates the correct \synopsis and \usage pairs. Before they were added either or, but that was a mistake by me. \synopsis should be *added* whenever the the \usage statement is not complete. o BUG FIX: update() of Package did not work. Did by mistake add a package argument to update.packages() too. That argument is only used in install.packages though. Version: 0.54 [2003-04-29] o Added argument force=FALSE to update() in the Package class. Version: 0.53 [2003-04-28] o R.oo: The Rdoc compiler was further improved and made more flexible. I am aiming to make it possible for the user to define their own simple tags. o All Rd files are now making use of \link[pkg:name]{label} for refering to methods not named according to the label. This is for instance the case with all class specific methods. More over, all Rd files for classes has \keyword{classes} and the \usage{} is used where it works and otherwise \synopsis{} is used (as recommended on the R help pages). All this is automatically taken care of by the Rdoc compiler. Version: 0.52 [2003-04-23] o Added almost all missing help pages, i.e. I wrote up *a lot* of Rd files. More help is still though for the Rdoc class, which compiles Rdoc comments in the source files into Rd files. However, if you want to use Rdoc$compile() already now, see the source files for plenty of examples and just run Rdoc$compile() in the same directory. o Added getDocPath(), update() and unload() to the Package class. With update() it is now possible to update a package or its bundle by just typing update(R.oo). o Added showAndAsk() to the Exception. It will, if tcltk is installed, display a dialog box with the error message. If tcltk is not installed, The message will be printed on the command line and a prompt requesting the user to press enter will be shown. showAndAsk() will give an error if run in a non-interactive mode. o Spell correction: "c.f." -> "cf." o BUG FIX: getStaticInstance() of class Class did not recover correctly if static instance was missing. Version: 0.51 [2003-01-17] o Added getUrl(), getMaintainer(), getAuthor(), getTitle(), getLicense() and getBundle(). Made the output from as.character() more informative. o Added a caching feature of "$"() to speed up access to members. The first time a member (field, virtual field, static field, method etc) is accessed it is done by looking it up one at the time and taking the first existing one (in a predefined order). The second time the same field is accessed, the name is remembered and "$"() access the right member directly. If this works out, "$<-"() will get a similar cache. Version: 0.50 [2002-12-20] o Updated try(), which a slight modification to the base::try() for improved exception handling, to have its own internal restart() function (just like base::try()), because restart() has been made deprecated from R v1.6.0. This is how the try() in the base package does it. Version: 0.49 [2002-12-15] o Added the finalizer method finalize(), which any subclass can override and that will be called by the garbage collector just before an object is about to be removed from the memory. o Added default function for equals(). o Added argument 'overwrite=TRUE' and 'conflict=c("error", "warning", "quiet")' to setMethodS3(). o COMPATIBILITY FIX: Removed default getClass(), because it was not would not work with the methods package. o Now extend() in class Object removes duplicated class attributes. o Now it is possible to create methods (also generic) with one (or several) . (period) as a prefix of the name. Such a method should be considered private in the same manner as fields with a period are private. o Added argument 'path=NULL' to save() and load() in class Object. It will remove the need using paste() etc. o For ll(), replaced "getClass" with "data.class" in the 'properties' argument. Since 'data.class' is almost the same as 'mode', mode was also removed. o SPELL CHECK: "...name name..." in one of setGenericS3()'s error messages. Thanks Gordon Smyth, WEHI, Melbourne, for the comment. o Removed deprecated and obsolete is.interface(). o BUG FIX: The Rdoc class listed too many methods in the "Methods inherited" # section. Version: 0.48 [2002-11-23] o Renamed setClassS3() to setConstructorS3(), since this is what it is actually doing. Keeping setClassS3() for backward compatibility but made it deprecated. o Updated setGenericS3() to *always* create generic functions with no arguments except "..." to follow the RCC. o Now $() and $<-() in class Object and Class also gets and sets attribute values too, respectively. o BUG FIX: $<-() of class Class did not work for static fields. o Added getInstanciationTime(), which returns the time point when the object was created. o BUG FIX: getDetails() would not add a newline after the class name if the class did not have a superclass, i.e. for root class Object. o Updated getField() of class Class to call generic method getField() and not getField.Object(). Version: 0.47 [2002-10-23] o Package named Rx.oo as long as it is a beta package. o Decided to declare all Rd files for class methods as \keyword{internal} which means that they will not show up in the HTML table of contents. Only classes and stand-alone functions should be there. o The package now contains the public classes Object, Exception, RccViolationException. It also contains the internal classes Class, Package and Rdoc. The class Class is essential, but Package and Rdoc are just utility classes containing useful static methods for development purposes etc. o The idea behind the Rx.oo package are the same as behind "old" R.oo, but internally environments are used for emulating references, whereas in R.oo a global so called object space was used. However, API-wise not much have been changed. o FYI: R.oo was first published in March 2001 and has undergone several updates, tests and bug fixes. Experience from that project has been brought into this package. Version: 0.46 [2002-10-14] o Added trial versions of extend() of class Object and class Reference. Also added trial version of superMethodS3() to replace faulty NextMethod(). o Added as.Reference() to class Object and class Reference and made the constructor accept Reference objects by just returning them again. Before an exception was thrown. o Added argument 'showDeprecated=FALSE' to classinfo() in class Class. This has the effected that when typing a name of a class and pressing enter at the prompt to display class information, deprecated method are *not* shown by default. o Added the class Class for dealing with static methods, static fields, accessing methods and fields of classes, generating class information etc. Since the handling of static methods and fields are now dealt by a specific class it means that the access of non-static methods and fields, which is done by the Object class, should now be a bit faster due to less overhead. Version: 0.45 [2002-09-23] o BUG FIX: setGenericS3() would sometimes believe that a non-function object actually was a function and tried to set it as a generic function, which resulted in an error exception. o Internal updates: Made .ObjectSpace.count an internal variable of the .ObjectSpace environment, meaning that it is harder to delete it by mistake. o relibrary(R.oo) was reloading the .RObjectSpace file too, which is not a wanted feature. o BUG FIX: createClassS3() would throw an error exception if there where two packages *loaded* such the name of the first one was the same as the beginning of the name of the second one, e.g. R.oo and R.oo2. o Added internal function getPackagePosition(). Version: 0.44 [2002-09-12] o Added the functions Q() and Quit() for quiting with the option to save the ObjectSpace also. o Added isGenericS3() and isGenericS4(). o If trying to use delete() to remove a non-existing variable or Object now only a warning() is given, before an exception was thrown which was quite annoying. delete() works as rm() plus it also deletes objects in ObjectSpace, which means that all calls to rm() can be replaced by calls to delete(). o Added the static methods ObjectSpace$save() and ObjectSpace$load() to save and load an image of the ObjectSpace. o BUG FIX: "[[" in class Reference did not work for numeric indices, e.g. ref[[5]]. Strange that I haven't noticed this before. o Package passes the R CMD check with 5 warnings. Version: 0.43 [2002-07-09] o Now "$" and "[[" also searches for fields in attributes(). This is a first step towards making use of structure() and friends instead. I've been thinking about this from the very beginning, but newer done it. The plan is to move away from the internal list() and accept any [R] object as the core object. This will also be more consistent with the R.methods/S4 strategy. Version: 0.42 [2002-05-31] o Removed forgotten debug messages in setGenericS3(). Version: 0.41 [2002-05-26] o Package now passes the R CMD check with 5 warnings. o Moved about() from R.base to this package and removed old description(). o Now the package reports its name, version and date if it was succesfully loaded. o Minimized the number of warnings when loading packages. o Added argument dontWarn to setGenericS3(), which by default is set so no warnings are produced for renamed methods in the base package. o Copied packagePaths() from package R.base to package R.oo, since it is required in R.oo and we do not want R.oo to depend on R.base. Version: 0.40 [2002-05-05] o BUG FIX: trycatch() didn't with methods created by setMethodS3(). This was due to I did (internally) object <- try(eval(substitute(object, envir=envir))) instead of object <- try(eval(substitute(object), envir=envir)) Hmm, a tricky typo to find since it worked elsewhere. o The classes Throwable and Exception have been transfer to here from the R.lang package. With the trycatch() they are really useful. o throw() and trycatch() are now available in both R.base and R.oo. o Added createClassS3() and internal variable .NewClassesNotCreated. o "$.Object"() and "$.Reference"() now returns NULL if a field/method etc is not found! Before it an error was thrown. o BUG FIX: Tiny bug fix in message of throw() clause in "$"(). Version: 0.39 [2002-04-21] o Added a trial version of "[.Reference". Currently, it does not support the get() idea as described below. Maybe a "[<-.Reference" will be added later. o Added trial version of a new feature for Object/Reference fields. Now, if a field does not exists and there is no method with the same name, then, if a method named "get()" exists, the value of get() is returned. This way one can have fields that are generated "on the fly" to save memory etc. This new feature required that "[[".Object was modified (actually created). Example: For an object 'obj' one can get its class by either the classical getClass(obj) or by the new feature obj$Class. If this new feature are successful, I will also look at implementing a corresponding set() support. o BUG FIX: setGenericS3() gave an error if one tried to set a generic function with the same name as an [R] object that was *not* a function. A simple add of argument mode="function" to the exists() check fixed this. Version: 0.38 [2002-04-02] o BUG FIX: clone() in class Reference did not work properly; it gave the wrong internal reference names, which in turn would generate errors such as 'Error in get(x, envir, mode, inherits) : variable "Reference.METHODS" was not found' when one tried object$foo() instead of foo(object). Now it works again. Version: 0.37 [2002-03-30] o IMPROVEMENT: Since library(methods) might be loaded after library(R.oo) the function extends() breaks down. Worked this out a little bit by detaching and reloading R.oo in function createClass() if it is detected that extends() has changed. o IMPROVEMENT: Forces extends <- function(...) UseMethod("extends") The reason for doing this is that if we have anything but '...' that argument might be matched by an attribute. Not good! Version: 0.36 [2002-03-06] o BUG FIX: When running the OO garbage collector, calling a finalize() that used the method super() failed with an exception. Internally, the class attributes of the freeable references were lost. o BUG FIX: extends() and implements() in Rdoc sometime gave errors. o Added names() to the class Reference. Version: 0.35 [2002-03-03] o Added the methods attach() and detach() which works both on Object's and Reference's. Version: 0.34 [2002-02-27] o Renamed the (still) internal class .Reference to Reference. o Added the setInterfaceS3() method. Makes it easier to define interfaces. o Update the examples in the help files to make use of the new setClassS3, setInterfaceS3 and setMethodS3. o Static method buildClass() in class Rdoc now also creates a list of methods and saves the result in the file .methods.Rdoc, which can be included in the Rdoc comments by @include ".methods.Rdoc". Hopefully, this will mean that the list of methods in the help files will be more up to date. o Declared more internal methods as "private". o BUG FIX: Internal scanForMethods() did not make a difference of functions and non-functions, since it basically only looked at the name. For instance would CONST.Foo <- 256 be considered a method in previous versions. This was not a big deal, but it is correct now. Version: 0.33 [2002-02-26] o BUG FIX: buildClass() in class Rdoc did not work due to the new package "methods". Corrected with one line of code. Version: 0.32 [2002-01-29] o Added the arguments 'trial', 'deprecated', 'static', 'protection' and 'abstract' to setMethodS3 (and to some extend also to setClassS3). o Started to make more use of setClassS3 and setMethodS3 internally. Version: 0.31 [2002-01-21] o Added createGeneric() to make life easier for class developers. Version: 0.30 [2002-01-18] o Added the (optional) argument 'path=NULL' to loadObject(). Version: 0.29 [2002-01-13] o Bug fix in gco(). [R] v1.4.0 made it crash. o When obj$foo is evaluated first the field "foo" is searched for and secondly the class method "foo" is searched for. Previously, methods had higher priority than fields. Version: 0.28 [2002-01-09] o Made R.oo compatible with new [R] v1.4.0 and the new package "methods". Version: 0.27 [2002-01-02] o Internally renamed the methods, e.g. new(), getClass() and extends(), that conflicted with methods defined in the new [R] package "methods". Hopefully these changes makes "methods" run when R.classes is loaded. o Starting to seperate Object methods and .Reference methods. Eventually maybe R.oo Object's could work very similar to "methods" object where .Reference is just an add-on to make the Object's referensable. Version: 0.26 [2001-12-29] o First steps to make R.classes work *together* with the new library "methods". These fixes made R.classes work when "methods" was loaded, but "methods" didn't work when R.classes was loaded. o This version was never released to the public. Version: 0.25 [2001-08-09] o Added super(), which provides a simple way to access methods in the super class. Version: 0.24 [2001-08-07] o Improved the speed of the garbage collector and it can now also run until no more objects are deleted. o Added support for 'this[[field]]' and 'this[[field]] <- value' when this is a reference. Another step away from get- and putObject(). o Introduced the modifers() function instead of old attr(...). o Updated many of the out-of-date examples in the help pages. Version: 0.23 [2001-08-04] o Major break-through in memory and speed efficiency. A lot of expressions are now evaluated directly in the object space environment, which means that no copying between the object space and the current environment is needed. This improvement makes the need for getObject() and setObject() much less of interest and they will probably be made obsolete or private, which is another step towards a more user friendly oo core. Version: 0.22 [2001-08-03] o Improved the error and warning messages for false references. o delete() can now remove any number of any kind of objects, i.e. it is now more consistent to rm(). o Created this HISTORY file. Everything below is recreated from from this date and is therefore not complete. Version: 0.21 [2001-07-29] Version: 0.20 [2001-07-27] Version: 0.19 [2001-07-06] o Renamed the package to R.oo (from com.braju.oo). Version: 0.15 [2001-05-06] Version: 0.14 [2001-04-30] o Bug fixes in garbage collection algorithm. Version: 0.13 [2001-04-15] o Now it is possible to add new fields to an object. Even though this is not true oo-style, it certainly is helpful. Also, fields (not methods) can be assign new values using regular style 'foo$value <- bar', where 'foo' is either the object itself or more common the reference to the object. Version: 0.12 [2001-04-13] o Now objects "physically" contains only the fields. The methods are looked up in an internal static class. Also, by writing the name of a class, information about the class is listed. Version: 0.11 [2001-04-11] Version: 0.10 [2001-04-04] o Support for static classes. Static methods in static classes can be called by 'Foo$myStaticMethod()'. For class developers: a static class is created by 'new(Foo(), static=TRUE)' which will not return a reference. A static class is only living on object space. Version: 0.9 [2001-04-02] o Support for static methods. A static method is declared as 'myStatic = METHOD+STATIC' and implemented as 'myStatic.myClass <- function(arg1, arg2, ...)'. Note that there is no 'this' argument to static classes. Version: 0.8 [2001-04-01] o Totally changed the declaration of methods in a class. Previously, one wrote 'myFcn = function() NULL' and now one writes 'myFcn = METHOD' where 'METHOD' is predefined constant. This allows fields in a class to also contain functions, i.e. 'myField = sqrt(x)', which was not possible in previous versions. Version: 0.5 [2001-03-27] o This is the first public release. Version: 0.2 [2001-03-16] Version: 0.1 [2001-03-12] o The very first version. Version: 0.0 [2001-03-10] o The very first attempt to create an object-oriented core for [R]. At this moment I was a beginner in [R]. LocalWords: HOWTOCITE FIXUP R.oo/R/0000755000177400001440000000000012763175003011466 5ustar murdochusersR.oo/R/error.throw.R0000755000177400001440000000234112726216524014112 0ustar murdochusers###########################################################################/** # @set "class=error" # @RdocMethod throw # # @title "Throws (rethrows) an object of class 'error'" # # \description{ # Rethrows an 'error' object. The 'error' class was introduced in R v1.8.1 # with the new error handling mechanisms. # } # # @synopsis # # \arguments{ # \item{error}{An object or class 'error'.} # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # See the \code{tryCatch()} method etc. # See the @see "Exception" class for more detailed information. # } # # \keyword{error} #*/########################################################################### setMethodS3("throw", "error", function(error, ...) { base::stop(error); }) ############################################################################ # HISTORY: # 2012-02-29 # o CLEANUP: throw() for 'error' is now just a wrapper for stop(). # Previously it had to do what stop() now does for 'condition' objects. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-03-03 # o Added throw() for the error class (new in R v1.8.0). ############################################################################ R.oo/R/equals.default.R0000755000177400001440000000333712726216524014542 0ustar murdochusers###########################################################################/** # @RdocDefault equals # # @title "Compares an object with another" # # \description{ # @get "title" and returns @TRUE if they are equal. # The equal property must be # # 1) \emph{reflexive}, i.e. \code{equals(o1,o1)} should be @TRUE. # # 2) \emph{symmetric}, i.e. \code{equals(o1,o2)} is @TRUE if and only # if \code{equals(o2,o1)} is @TRUE. # # 3) \emph{transitive}, i.e. \code{equals(o1,o2)} is @TRUE and # \code{equals(o2,o3)} is @TRUE, then \code{equals(o1,o3)} should # be @TRUE. # # 5) \emph{consistent}, i.e. \code{equals(o1,o2)} should return the same # result on multiple invocations as long as nothing has changed. # # 6) \code{equals(o1,}@NULL\code{)} should return @FALSE, unless # \code{o1} is also @NULL. # # By default @see "base::identical" is used. # } # # @synopsis # # \arguments{ # \item{object, other}{Objects to be compared.} # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the objects are equal, otherwise @FALSE. # } # # @author # # \seealso{ # @see "base::identical". # } # # @keyword attribute # @keyword utilities # @keyword internal #*/########################################################################### setMethodS3("equals", "default", function(object, other, ...) { (is.null(object) && is.null(other)) || identical(object, other); }) ############################################################################ # HISTORY: # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-10-18 # o Added Rdoc comments. # 2002-12-08 # o Created because it was needed for convience in the R.util::Tree class. ############################################################################ R.oo/R/000.R0000755000177400001440000000031312726216524012113 0ustar murdochusers## Look for existing generic functions also in imported namespaces. ## This will affect whether setGenericS3() creates a generic function ## or not. options("R.methodsS3:checkImports:setGenericS3"=TRUE) R.oo/R/Rdoc.R0000755000177400001440000032244212726216524012515 0ustar murdochusers##########################################################################/** # @RdocClass Rdoc # # @title "Class for converting Rdoc comments to Rd files" # # \description{ # @classhierarchy # # @get "title". # } # # @synopsis # # \section{Fields and Methods}{ # @allmethods # } # # @author # # \examples{\dontrun{@include "../incl/Rdoc.Rex"}} # # \references{ # R developers, # \emph{Guidelines for Rd files}, # \url{http://developer.r-project.org/Rds.html}, # 2003 # } # # @keyword documentation #*/########################################################################### setConstructorS3("Rdoc", function() { extend(Object(), "Rdoc", .START = paste(sep="", "/", "**"), # To hide it from itself!!! .STOP = paste(sep="", "*", "/"), # - " - .nameFormat = "method.class", .manPath = "../man/", package = NULL, source = NULL ) }) ###########################################################################/** # @RdocMethod getNameFormat # # @title "Gets the current name format" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seemethod "setNameFormat" # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getNameFormat", "Rdoc", function(static, ...) { Rdoc$.nameFormat; }, static=TRUE) ###########################################################################/** # @RdocMethod setNameFormat # # @title "Sets the current name format" # # \description{ # @get "title". # Throws a @see "RccViolationException" if an unknown format is requested. # } # # @synopsis # # \arguments{ # \item{nameFormat}{ # If \code{"method.class"}, help files for methods belonging to classes are # named .. # If \code{"class.method"}, help files for methods belonging to classes are # named .. # These are currently the only name formats supported. # } # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # @seemethod "getNameFormat" # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("setNameFormat", "Rdoc", function(static, nameFormat, ...) { if (nameFormat == "class.method") { } else if (nameFormat == "method.class") { } else { throw(RdocException("Unknown name format: ", nameFormat)); } Rdoc$.nameFormat <- nameFormat; }, static=TRUE) ###########################################################################/** # @RdocMethod getKeywords # # @title "Gets the keywords defined in R with descriptions" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seemethod "setManPath" # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getKeywords", "Rdoc", function(this, fullInfo=FALSE, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Locate the KEYWORDS.db file # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - path <- Sys.getenv("R_DOC_DIR"); if (is.null(path) || nchar(path) == 0) { # Backward compatibility path <- file.path(Sys.getenv("R_HOME"), "doc"); tryCatch({ path <- R.home("doc"); }, error = function(ex) {}); if (!file.exists(path)) { throw("Cannot determine the R doc directory. R_DOC_DIR was not set and R_HOME/doc/ does not exist: ", path); } } pathname <- file.path(path, "KEYWORDS.db"); if (!file.exists(pathname)) { throw("The KEYWORDS.db file was not found: ", pathname); } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Read keywords # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - keywords <- readLines(pathname, warn=FALSE); keywords <- strsplit(keywords, ":"); names <- lapply(keywords, FUN=function(x) x[1]); names <- unlist(names); names <- gsub("[[:space:]]+$", "", gsub("^[[:space:]]+", "", names)); desc <- lapply(keywords, FUN=function(x) x[2]); desc <- unlist(desc); desc <- gsub("[[:space:]]+$", "", gsub("^[[:space:]]+", "", desc)); keywords <- strsplit(names, "\\|"); len <- unlist(lapply(keywords, FUN=length)); keywords <- unlist(lapply(keywords, FUN=function(x) x[length(x)])); keywords <- keywords[len > 1]; desc <- desc[len > 1]; names(keywords) <- desc; keywords; }, static=TRUE); ###########################################################################/** # @RdocMethod isKeyword # # @title "Checks if a word is a Rd keyword" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @logical. # } # # @author # # \seealso{ # @seemethod "getKeywords" # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("isKeyword", "Rdoc", function(this, word, ...) { is.element(word, Rdoc$getKeywords()); }, static=TRUE) ###########################################################################/** # @RdocMethod getManPath # # @title "Gets the path to the directory where the Rd files will be saved" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seemethod "setManPath" # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getManPath", "Rdoc", function(this, ...) { this$.manPath; }, static=TRUE); ###########################################################################/** # @RdocMethod setManPath # # @title "Sets the path to the directory where the Rd files should be saved" # # \description{ # @get "title". By default the path is \code{../man/} assuming that the # current directory is \code{../R/}, which is where source files commonly # are placed. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # @seemethod "getManPath" # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("setManPath", "Rdoc", function(this, path="../man/", ...) { info <- file.info(path); if (is.na(info$isdir)) path <- gsub("/$", "", path); info <- file.info(path); if (is.na(info$isdir)) throw("Path does not exists: ", path); if (info$isdir != TRUE) throw("Specified path is not a directory: ", path); this$.manPath <- as.character(path); }, static=TRUE); ###########################################################################/** # @RdocMethod createManPath # # @title "Creates the directory where the Rd files should be saved" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the directory was creates, @FALSE if it already exists # and throws an @Exception if failed. # } # # @author # # \seealso{ # @seemethod "getManPath" # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("createManPath", "Rdoc", function(this, ...) { # Check if the path already exists, otherwise create it. path <- getManPath(this); # file.exists() and file.info() is sensitive to trailing '/'. path <- gsub("/$", "", path); isdir <- as.logical(file.info(path)["isdir"]); if (file.exists(path) && isdir) return(FALSE); # Path 'destPath' does not exist at all. It might be that there is # a file with the same name, but in any case, the OS should # take care of conflict if it thinks it is a conflict. if (!dir.create(path)) throw(Exception("Could not create destination directory: ", path)); return(TRUE); }, static=TRUE, protected=TRUE) ###########################################################################/** # @RdocMethod createName # # @title "Creates a class-method name" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{class}{A class name (@character string).} # \item{method}{A method name (@character string).} # \item{escape}{If @TRUE, non-valid filename characters are escaped into # valid character strings.} # \item{...}{Not used.} # } # # \value{ # Returns @character string. # } # # @author # # \seealso{ # @seemethod "escapeRdFilename". # @seeclass # } # # @keyword documentation # @keyword internal #*/########################################################################### setMethodS3("createName", "Rdoc", function(static, class, method, escape=TRUE, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Get name format to be used (can be set globally) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - nameFormat <- Rdoc$getNameFormat(); if (nameFormat == "class.method") { name <- paste(class, ".", method, sep=""); } else if (nameFormat == "method.class") { name <- paste(method, ".", class, sep=""); } else { throw(RdocException("Unknown name format: ", nameFormat)); } if (escape) { name <- Rdoc$escapeRdFilename(name); } name; }, static=TRUE, private=TRUE); ###########################################################################/** # @RdocMethod escapeRdFilename # # @title "Escape non-valid characters in a filename" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{filename}{A filename (@character string) to be escaped.} # \item{...}{Not used.} # } # # \value{ # Returns @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("escapeRdFilename", "Rdoc", function(static, filename, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Escape non-valid filenames # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - filename <- gsub("\\\\\\$", "DOLLAR", filename); filename <- gsub("[$]", "DOLLAR", filename); filename <- gsub("<-", "< -", filename); filename <- gsub("<", "LT", filename); filename <- gsub("[[]", "-LB-", filename); # From R v1.8.1 can't Rd filenames contain whitespace. filename <- gsub("[ \t]", "_", filename); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # A filename must start with a letter or a digit # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - startOk <- (regexpr("^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9]", filename) != -1); if (!startOk) { # Fix Rd filename (not really important actually). filename <- paste("000", filename, sep=""); } filename; }, protected=TRUE, static=TRUE) # escapeRdFilename() ###########################################################################/** # @RdocMethod compile # # @title "Compile source code files containing Rdoc comments into Rd files" # # \description{ # @get "title". # # \emph{Note, the class and methods to be compiled have to be loaded into # \R by for instance \code{library()} or \code{source()} before calling # this method.} # } # # @synopsis # # \arguments{ # \item{filename}{The pathname or filename pattern of the Rdoc files to be # compiled.} # \item{destPath}{The path where the generated Rd files should be saved.} # \item{showDeprecated}{If @TRUE, Rd files are generated for deprecated # objects too, otherwise not.} # \item{addTimestamp}{If @TRUE, a date and time stamp is added to the # Rd header comments. This timestamp might be confusing for version # control systems, which is why it can be turned off with @FALSE.} # \item{locale}{The locale to be set/used when compiling Rdoc comments. # This help assuring strings are sorted the same way across systems.} # \item{source}{If @TRUE, the Rdoc files will be \code{source()}:ed first. # This work of course only for Rdoc files that are R source files.} # \item{verbose}{If @TRUE, detailed compilation information is printed.} # \item{debug}{If @TRUE, extra debug information is printed.} # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("compile", "Rdoc", function(this, filename=".*[.]R$", destPath=getManPath(this), showDeprecated=FALSE, addTimestamp=FALSE, locale="C", verbose=FALSE, source=FALSE, check=TRUE, debug=FALSE, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Global variables # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - authorWarn <- FALSE; pkgAuthors <- NULL; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - isCapitalized <- function(str) { first <- substring(str,1,1); (first == toupper(first)) } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # a d d K e y w o r d ( ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - validateKeyword <- function(keyword) { knownKeywords <- Rdoc$getKeywords(); if (!is.element(keyword, knownKeywords)) { alts <- agrep(keyword, knownKeywords); alts <- paste("'", knownKeywords[alts], "'", collapse=", ", sep=""); if (nchar(alts) > 0) alts <- paste("Did you mean ", alts, "?", sep=""); throw(RdocException("Unknown keyword: ", keyword, ". ", alts, source=sourcefile)); } } # validateKeyword() rdocKeywords <- c(); addKeyword <- function(keyword) { keyword <- as.character(keyword); # A remove keyword? if (regexpr("^-", keyword) != -1) { rdocKeywords <<- unique(c(rdocKeywords, keyword)); keyword <- gsub("^-", "", keyword); } else { rdocKeywords <<- unique(c(rdocKeywords, keyword)); } # Validate keyword validateKeyword(keyword); } # addKeyword() getRdKeywords <- function(...) { # Get all keywords if (length(rdocKeywords) == 0) return(""); isRemove <- (regexpr("^-", rdocKeywords) != -1); keywords <- rdocKeywords[!isRemove]; exclKeywords <- gsub("^-", "", rdocKeywords[isRemove]); keywords <- setdiff(keywords, exclKeywords); keywords <- unique(keywords); # Empty current list of keywords rdocKeywords <<- c(); if (length(keywords) == 0) return(NULL); lines <- paste("\\keyword{", keywords, "}", sep=""); lines <- paste(lines, collapse="\n"); lines; } # getRdKeywords() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # e s c a p e N a m e ( ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # From the help: # \name{name} # name typically is the basename of the Rd file containing the # documentation. It is the "name" of the Rd object represented # by the file, has to be unique in a package, and must not # contain LaTeX special characters (#, $, %, &, ~, _, ^, \, {, }). escapeName <- function(name) { name <- gsub("\\#", "POUND", name); name <- gsub("\\$", "DOLLAR", name); name <- gsub("\\%", "PERCENT", name); name <- gsub("\\&", "AND", name); name <- gsub("\\~", "TILDE", name); name <- gsub("\\_", "UNDERSCORE", name); name <- gsub("\\^", "POWER", name); name <- gsub("\\\\", "BACKSLASH", name); name <- gsub("\\{", "LCURLY", name); name <- gsub("\\}", "RCURLY", name); name <- gsub("<-", "< -", name); name; } # escapeName() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # e s c a p e A l i a s ( ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - escapeAlias <- function(alias) { # Don't escape aliases?!? /HB 2004-03-03 alias <- gsub("\\%", "\\\\%", alias); # alias <- gsub("\\$", "\\\\$", alias); # alias <- gsub("<-", "< -", alias); alias; } # escapeAlias() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # e x t r a c t R d o c s ( ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - extractRdocs <- function(filename, verbose=FALSE, debug=FALSE) { if (!file.exists(filename)) throw(RdocException("File not found: ", filename)); # Read all lines from the source code file lines <- readLines(filename, warn=FALSE); if (length(lines) == 0) return(list()); # Keep only the lines that are comments. lines <- lines[(regexpr("^ *#", lines) != -1)]; if (length(lines) == 0) return(list()); # Find all Rdoc begins and ends begins <- which(regexpr("/\\*\\*", lines) != -1); ends <- which(regexpr("\\*/", lines) != -1); if (length(begins) != length(ends)) throw(RdocException("Number of Rdoc begins do not match number of Rdoc ends: ", filename)); if (any(begins - ends > 0)) throw(RdocException("Some of the Rdoc begins comes after the Rdoc ends: ", filename)); rdocs <- list(); for (k in seq_along(begins)) { idx <- begins[k]:ends[k]; tmp <- lines[idx]; # Remove everything before the begin tag including the tag tmp[1] <- gsub("^#.*/\\*\\*", "", tmp[1]); # Remove everything after the end tag including the tag last <- length(tmp); tmp[last] <- gsub("^#.*\\*/.*", "", tmp[last]); # Remove all leading single and double comment characters tmp <- gsub("^#{1,3}", "", tmp); # Find (minimum) indentation indents <- regexpr("[^ ]", tmp[nchar(tmp) > 0]) indent <- min(indents); tmp <- substring(tmp, first=indent); # Remove all trailing whitespace tmp <- gsub("[ \t\v\r\n]$", "", tmp); # Remove all empty lines at the beginning while (nchar(tmp[1]) == 0) tmp <- tmp[-1]; # Remove all empty lines at the end while (nchar(tmp[length(tmp)]) == 0) tmp <- tmp[-length(tmp)]; attr(tmp, "sourcefile") <- filename; rdocs[[k]] <- tmp; } rdocs; } # extractRdocs() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # w r i t e R d ( ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sourcefile <- NA; writeRd <- function(rds, path=getManPath(this), addTimestamp=TRUE, verbose=FALSE, debug=FALSE) { for (rd in rds) { name <- attr(rd, "name"); if (!is.null(path)) { if (regexpr("/$", path) == -1 && regexpr("\\$", path) == -1) path <- paste(path, "/", sep=""); } filename <- Rdoc$escapeRdFilename(name); filename <- paste(path, filename, ".Rd", sep=""); if (verbose) { cat("Generating ", filename, "...", sep=""); } sourcefile <<- sourcefile <- attr(rd, "sourcefile"); hdr <- c("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); hdr <- c(hdr, "% Do not modify this file since it was automatically generated from:"); hdr <- c(hdr, "% "); hdr <- c(hdr, paste("% ", sourcefile, sep="")); hdr <- c(hdr, "% "); if (addTimestamp) { hdr <- c(hdr, paste("% on ", date(), ".", sep="")); hdr <- c(hdr, "% "); } hdr <- c(hdr, "% by the Rdoc compiler part of the R.oo package."); hdr <- c(hdr, "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); bfr <- paste(c(hdr, "", rd, ""), collapse="\n"); writeChar(bfr, eos=NULL, con=filename); } } # writeRd() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # c o m p i l e R d o c () # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - compileRdoc <- function(rdocs, showDeprecated=FALSE, verbose=FALSE, debug=FALSE) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Validate arguments # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (!is.list(rdocs)) throw(RdocException("Internal error: Expected a list: ", class(rdocs)[1L])); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Defines all simple tags that are shortcuts to different help documents. # Example: @TRUE -> \\code{\\link[base:logical]{TRUE}} # NA means that the text should just be place inside \code{}. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - shorttags <- list( # Package base: "0" = NA, "1" = NA, "..." = NA, "." = NA, # Must come *after* "..." "array" = "base", "attributes" = "base", "attr" = "base", "ANY" = NA, "call" = "base", "character" = "base", "complex" = "base", "connection" = "base:connections", "data.frame" = "base", "dimnames" = "base", "dim" = "base", "double" = "base", "environment" = "base", "expression" = "base", "factor" = "base", "FALSE" = "base:logical", "formula" = "base", "function" = "base", "Inf" = "base:is.finite", "integer" = "base", "length" = "base", "list" = "base", "logical" = "base", "matrix" = "base", "names" = "base", "name" = "base", "NA" = "base", "NaN" = "base:is.finite", "NULL" = "base", "numeric" = "base", "table" = "base", "TRUE" = "base:logical", "raw" = "base", "ts" = "base", "vector" = "base", "warning" = "base", # Package R.oo: "Object" = "R.oo", "Exception" = "R.oo", "throw" = "R.oo" ); names <- names(shorttags); match <- gsub("\\.", "\\\\.", names); attr(shorttags, "beginsWith") <- paste("^@", match, sep=""); attr(shorttags, "contains") <- paste("[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9.]@", match, sep=""); replace <- paste("\\link[", unlist(shorttags), "]{", names, "}", sep=""); replace[is.na(shorttags)] <- names[is.na(shorttags)]; replace <- paste("\\code{", replace, "}", sep=""); attr(shorttags, "replace") <- replace; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getTagValue <- function(bfr) { # 1. Remove all leading whitespace bfr <- gsub("^[ \t]", "", bfr); # 2a. Is there a '{' + '}' pair? (nesting brackets are not allowed) if ((beginPos <- regexpr("^\\{", bfr)) != -1L) { # Find the end '}' endPos <- regexpr("\\}", bfr); if (endPos == -1L) throw(RdocException("Closing } is missing: ", substring(bfr, first=1L, last=20L), source=sourcefile)); value <- substring(bfr, first=beginPos+1L, last=endPos-1L); bfr <- substring(bfr, first=endPos+1L); } # 2b. ...or a '"' + '"' pair? (*internal* escaped " are ignored) else if ((beginPos <- regexpr("^\"", bfr)) != -1L) { endPos <- regexpr("[^\\]\"", bfr); if (endPos == -1L) throw(RdocException("Closing \" is missing: ", substring(bfr, first=1L, last=20L), source=sourcefile)); value <- substring(bfr, first=beginPos+1L, last=endPos); bfr <- substring(bfr, first=endPos+2L); } # 2c. ...otherwise the value is the first word found # (on the same line!) else { beginPos <- 1L; endPos <- regexpr("([ \t\n\r]|$)", bfr); value <- substring(bfr, first=1L, last=endPos-1L); # Ad hoc. /HB 2013-03-25 if (value != "}") { bfr <- substring(bfr, first=endPos); } else { value <- ""; } } attr(bfr, "value") <- value; bfr; } # getTagValue() isObjectDeprecated <- function(name, ...) { obj <- getObject(this, name=name, ...); mods <- attr(obj, "modifiers"); is.element("deprecated", mods); } # isObjectDeprecated() # Read and parse authors from DESCRIPTION's 'Authors@R' or 'Author'. getPackageAuthors <- function() { if (!is.null(pkgAuthors)) { return(pkgAuthors); } pkg <- Package(Rdoc$package); authors <- getAuthor(pkg, as="person"); authorsN <- format(authors, include=c("given", "family")); maintainers <- getMaintainer(pkg, as="person"); maintainersN <- format(maintainers, include=c("given", "family")); # Append maintainers, if not already listed as authors keep <- !is.element(maintainersN, authorsN); maintainers <- maintainers[keep]; if (length(maintainers) > 0L) { ## authors <- c(authors, maintainers); } authors; } # getPackageAuthors() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocClass <- function(bfr) { bfr <- getTagValue(bfr); class <<- attr(bfr, "value"); typeOfClass <- typeOfClass(class); if (is.na(typeOfClass)) { throw(RdocException("Class is either not defined or loaded, or not an S4/setClass() or S3/setConstructorS3() class: ", class)); } if (typeOfClass == "S4") { clazz <<- getClass(class); } else if (typeOfClass == "S3-Object") { clazz <<- Class$forName(class); } line <- paste("\\name{", escapeName(class), "}\n", sep=""); line <- paste(line, "\\docType{class}\n", sep=""); line <- paste(line, "\\alias{", class, "}\n", sep=""); addKeyword("classes"); if (typeOfClass == "S4") { line <- paste(line, "\\alias{", class, "-class}\n", sep=""); usage <- Rdoc$getClassS4Usage(clazz); } else if (typeOfClass == "S3-Object") { usage <<- Rdoc$getUsage(method=class); isDeprecated <<- isDeprecated(clazz); } name <<- class; objectName <<- class; rd <<- paste(rd, line, sep=""); bfr; } # tagRdocClass() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagClass <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); class <<- value; bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocMethod <- function(bfr) { bfr <- getTagValue(bfr); method <- attr(bfr, "value"); objectName <<- paste(method, class, sep="."); isDeprecated <<- isObjectDeprecated(objectName); # Find method fcn <- NULL; tryCatch({ fcn <- Rdoc$getObject(objectName, mode="function"); }, error = function(ex) { cat("Failed...\n"); print(ex); cat("Failed...done\n"); }) if (!is.function(fcn)) { throw(RdocException("Could not get method. Function was not found: ", objectName, "()", source=Rdoc$source)); } methodName <- createName.Rdoc(NULL, class, method, escape=FALSE); isStatic <- is.element("static", attr(fcn, "modifiers")); if (isStatic) { staticName <- paste(class, method, sep="$"); name <- staticName; alias <- c(staticName, escapeAlias(methodName)); } else { name <- escapeName(methodName); alias <- escapeAlias(methodName); } # Treat internal and non-internal methods differently if (isCapitalized(class)) { alias <- c(alias, paste(class, method, sep=".")); alias <- c(alias, paste(method, ",", class, "-method", sep="")); } alias <- c(alias, paste(method, class, sep=".")); # Multiple aliases(?) alias <- unique(alias); alias <- paste("\\alias{", alias, "}", sep=""); line <- paste("\\name{", name, "}", sep=""); line <- c(line, alias); line <- paste(line, collapse="\n"); # Treat internal and non-internal methods differently if (isCapitalized(class)) { addKeyword("internal"); } addKeyword("methods"); name <<- methodName; # Filename usage <<- Rdoc$getUsage(method=method, class=class); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocDefault <- function(bfr) { bfr <- getTagValue(bfr); default <- attr(bfr, "value"); objectName <<- default; isDeprecated <<- isObjectDeprecated(objectName); name <- default; name <<- name <- escapeName(name); line <- paste("\\name{", name, "}\n", sep=""); line <- paste(line, "\\alias{", name, ".default}\n", sep=""); line <- paste(line, "\\alias{", name, "}", sep=""); usage <<- Rdoc$getUsage(method=default, class="default"); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocGeneric <- function(bfr) { bfr <- getTagValue(bfr); generic <- attr(bfr, "value"); objectName <<- generic; isDeprecated <<- isObjectDeprecated(objectName); name <- generic; name <<- name <- escapeName(name); line <- paste("\\name{", name, "}\n", sep=""); line <- paste(line, "\\alias{", name, "}\n", sep=""); addKeyword("methods"); usage <<- Rdoc$getUsage(method=generic); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocFunction <- function(bfr) { bfr <- getTagValue(bfr); fcn <- attr(bfr, "value"); objectName <<- fcn; isDeprecated <<- isObjectDeprecated(objectName); name <- fcn; name <<- name <- escapeName(name); line <- paste("\\name{", name, "}\n", sep=""); line <- paste(line, "\\alias{", name, "}\n", sep=""); usage <<- Rdoc$getUsage(method=fcn); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocObject <- function(bfr) { bfr <- getTagValue(bfr); object <- attr(bfr, "value"); objectName <<- object; isDeprecated <<- isObjectDeprecated(objectName); name <- object; name <<- name <- escapeName(name); line <- paste("\\name{", name, "}\n", sep=""); line <- paste(line, "\\alias{", name, "}", sep=""); usage <<- NULL; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocData <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); name <- value; name <<- name <- escapeName(name); line <- paste("\\name{", name, "}\n", sep=""); line <- paste(line, "\\alias{", name, "}\n", sep=""); line <- paste(line, "\\docType{data}\n", sep=""); addKeyword("datasets"); objectName <<- value; usage <<- NULL; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocDocumentation <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); name <- value; name <<- name <- escapeName(name); line <- paste("\\name{", name, "}\n", sep=""); line <- paste(line, "\\alias{", name, "}\n", sep=""); addKeyword("documentation"); hasTitle <- (regexpr("(@|[\\])title", bfr) != -1); if (!hasTitle) line <- paste(line, "\\title{", name, "}\n", sep=""); objectName <<- value; usage <<- NULL; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocAbout <- function(bfr) { # An @RdocAbout does *not* have a value # bfr <- getTagValue(bfr); name <- ". About this package"; name <<- name <- escapeName(name); line <- paste("\\name{", name, "}\n", sep=""); line <- paste(line, "\\alias{", name, "}\n", sep=""); addKeyword("documentation"); line <- paste(line, "\n", sep=""); hasTitle <- (regexpr("(@|[\\])title", bfr) != -1); if (!hasTitle) line <- paste(line, "\\title{About this package}\n", sep=""); objectName <<- name; usage <<- NULL; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagRdocPackage <- function(bfr) { # An @RdocPackage takes the package name as an argument bfr <- getTagValue(bfr); name <- attr(bfr, "value"); name <<- name <- escapeName(name); line <- paste("\\name{", name, "-package}\n", sep=""); line <- paste(line, "\\alias{", name, "-package}\n", sep=""); line <- paste(line, "\\alias{", name, "}\n", sep=""); line <- paste(line, "\\docType{package}\n", sep=""); addKeyword("package"); line <- paste(line, "\n", sep=""); hasTitle <- (regexpr("(@|[\\])title", bfr) != -1); if (!hasTitle) line <- paste(line, "\\title{Package ", name, "}\n", sep=""); name <<- paste(name, "-package", sep=""); objectName <<- name; usage <<- NULL; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagName <- function(bfr) { bfr <- getTagValue(bfr); if (!is.null(name)) { warning("Tag ignored: @RdocDefault is not needed if @RdocClass is specified."); return(bfr); } value <- attr(bfr, "value"); name <- value; name <<- name <- escapeName(name); line <- paste("\\name{", name, "}\n", sep=""); line <- paste(line, "\\alias{", name, "}", sep=""); objectName <<- value; usage <<- Rdoc$getUsage(method=value); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagAlias <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); alias <- value; alias <- escapeAlias(alias); line <- paste("\\alias{", alias, "}", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagAliasMethod <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); method <- value; method <- escapeAlias(method); line <- paste("\\alias{", class, ".", method, "}\n", sep=""); line <- paste(line, "\\alias{", method, ".", class, "}\n", sep=""); line <- paste(line, "\\alias{", method, ",", class, "-method}\n", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagAliasUndocumented <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); alias <- unlist(tools::undoc(package=value)); alias <- sapply(alias, FUN=escapeAlias); lines <- paste("\\alias{", alias, "}", sep=""); lines <- paste(lines, collapse="\n"); rd <<- paste(rd, lines, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagUsage <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); if (nchar(value) == 0L) { # Usage is inferred from the @RdocNnn tag. } else if (nchar(value) > 0L) { # Usage is inferred from the @usage tag. parts <- strsplit(value, split=",", fixed=TRUE)[[1]]; nparts <- length(parts); method <- parts[1L]; if (nparts == 1L) { usage <- Rdoc$getUsage(method=method); } else if (nparts == 2L) { class <- parts[2L]; usage <- Rdoc$getUsage(method=method, class=class); } } usage <- paste(usage, collapse="\n"); line <- usage; rd <<- paste(rd, line, sep=""); bfr; } tagSynopsis <- function(bfr) { usage <- c("", usage, ""); usage <- paste(usage, collapse="\n"); line <- paste("\\usage{", usage, "}", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagKeyword <- function(bfr) { bfr <- getTagValue(bfr); keyword <- attr(bfr, "value"); addKeyword(keyword); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagInclude <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); if (!file.exists(value)) { throw(RdocException("File to be included not found: ", value, source=sourcefile)); } else { include <- readLines(value, warn=FALSE); include <- paste(include, collapse="\n"); include <- gsub("\\%", "\\\\%", include); line <- paste(include, "\n", sep=""); rd <<- paste(rd, line, sep=""); } bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagExamples <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); if (!file.exists(value)) { throw(RdocException("File containing examples to be included not found: ", value, source=sourcefile)); } else { include <- readLines(value, warn=FALSE); include <- paste(include, collapse="\n"); include <- gsub("\\%", "\\\\%", include); line <- paste("\\examples{\n", include, "\n}", sep=""); } rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagVisibility <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); visibility <<- value; if (!is.element(visibility, c("private", "protected", "public"))) throw(RdocException("Unknown type of visibility: ", value, source=sourcefile)); if (visibility == "private") addKeyword("internal"); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagGet <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); if (exists(value)) { line <- as.character(get(value)); } else if (!is.null(getOption(value))) { line <- as.character(getOption(value)); } else { throw(RdocException("R variable does not exist: ", value, source=sourcefile)); } rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagSet <- function(bfr, envir=parent.frame()) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); keyValue <- strsplit(value, "=")[[1]]; assign(keyValue[1], value=keyValue[2], envir=envir); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagAuthor <- function(bfr) { bfrT <- getTagValue(bfr); value <- attr(bfrT, "value"); value <- as.character(value); hasValue <- (nchar(value) > 0L); hasValue <- hasValue && (regexpr("^[ \t]*[\n\r]", value) == -1L); # Does the @author tag has a value? if (hasValue) { # Non-empty @author tag with value, e.g. '@author "HB"' value <- gsub("^[ \t]*['\"]?", "", value); value <- gsub("['\"]?[ \t]*$", "", value); # (i) All authors? if (value == "*") { pkgAuthors <<- authors <- getPackageAuthors(); } else { # (ii) All initials? An initial = 2-5 upper case letters tmp <- unlist(strsplit(value, split=",", fixed=TRUE)) tmp <- gsub("^[ \t]*", "", tmp); tmp <- gsub("[ \t]*$", "", tmp); tmpU <- toupper(tmp); pattern <- sprintf("^[%s]{2,5}$", paste(base::LETTERS, collapse="")); allInitials <- all( (tmpU == tmp) & (regexpr(pattern, tmp) != -1L) ); if (allInitials) { initials <- tmp; # Create all initials of the 'authors' pkgAuthors <<- authors <- getPackageAuthors(); fullnames <- format(authors, include=c("given", "family")); known <- abbreviate(fullnames, minlength=2L); known <- toupper(known); # Check if the initials match idxs <- match(initials, known); unknown <- initials[is.na(idxs)]; if (length(unknown) > 0L) { known <- paste(sQuote(known), sQuote(fullnames), sep="="); throw(RdocException("Rdoc 'author' tag specifies initials (", paste(sQuote(unknown), collapse=", "), ") that are not part of the known ones (", paste(known, collapse=", "), ")", source=sourcefile)); } authors <- authors[idxs]; } else { authors <- as.person(value); } } bfr <- bfrT; } else { # Empty @author tag, i.e. '@author' pkgAuthors <<- authors <- getPackageAuthors(); # If there are creators of the package (which there should be), # use those as the default for an empty '@author' tag. isCreator <- sapply(authors, FUN=function(a) is.element("cre", a$role)); if (any(isCreator)) { authors <- authors[isCreator]; } if (exists("author", mode="character", envir=globalenv())) { if (!authorWarn) { author <- get("author", mode="character", envir=globalenv()); warning("Detected an 'author' character variable in the global environment. Note that, since R.oo 1.13.0, the author for an (empty) Rdoc @author tag is inferred from the 'Authors@R' or 'Author' DESCRIPTION field and no longer take from the global 'author' variable: ", sQuote(author)); authorWarn <<- TRUE; } } } authorsTag <- format(authors, include=c("given", "family")); authorsTag <- paste(authorsTag, collapse=", "); line <- paste("\\author{", authorsTag, "}", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagHowToCite <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); package <- Package(value); howToCite <- getHowToCite(package, newline=NULL); if (is.null(howToCite)) { line <- "\\emph{No citation information available.}\n"; } else { line <- gsub("\n", " ", howToCite); line <- gsub("[ ]+", " ", line); line <- lapply(line, FUN=strwrap, width=85L); line <- lapply(line, FUN=paste, collapse="\n"); line <- unlist(line, use.names=FALSE); line <- paste(line, collapse="\n\n"); line <- paste("\\preformatted{\n", line, "\n}\n", sep=""); # Add the following line to fix a "R CMD check-bug" in LaTeX. # /HB 2004-03-10 line <- paste(line, "\\emph{}\n", sep=""); } rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagSeeclass <- function(bfr) { line <- paste("For more information see \\code{\\link{", class, "}}.", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagSeemethod <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); line <- paste("\\code{\\link[", package, ":", Rdoc$createName(class, value), "]{*", value, "}()}", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagSeeOtherMethods <- function(bfr) { clazz <<- Class$forName(class); method <- gsub(paste("[.]", class, "$", sep=""), "", objectName); classes <- list(getSuperclasses(clazz), getKnownSubclasses(clazz)); for (k in 1:2) { methods <- paste(method, classes[[k]], sep="."); exists <- sapply(methods, FUN=exists, mode="function"); classes[[k]] <- classes[[k]][exists]; methods <- methods[exists]; for (l in seq_along(methods)) { fcn <- get(methods[l], mode="function"); modifiers <- attr(fcn, "modifiers"); isPrivate <- is.element("private", modifiers); isDeprecated <- is.element("deprecated", modifiers); if (isPrivate || isDeprecated) methods[l] <- NA; } classes[[k]] <- classes[[k]][!is.na(methods)]; } for (k in 1:2) { classes[[k]] <- paste("\\code{\\link[", package, ":", Rdoc$createName(classes[[k]], method), "]{", classes[[k]], "}}", sep=""); } line <- "\\cr\\bold{Implementations of this method in}"; line <- paste(line, " i) \\bold{superclasses:} "); line <- paste(line, paste(classes[[1]], collapse=", "), sep=""); line <- paste(line, ", and ii) \\bold{subclasses:} "); line <- paste(line, paste(classes[[2]], collapse=", "), ".", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagSee <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); pkgObject <- strsplit(value, "::", value)[[1]]; fcn <- ""; if (length(pkgObject) == 1) { pkg <- NULL; obj <- pkgObject[1]; if (exists(obj, mode="function")) { expr <- substitute(inherits(fcn, "Class"), list(fcn=as.name(obj))); if (!eval(expr)) fcn <- "()"; } } else { pkg <- pkgObject[1]; obj <- pkgObject[2]; .require <- require; # To please R CMD check if (.require(package=pkg, character.only=TRUE)) { pos <- which(paste("package:", "base", sep="") == search()); if (exists(obj, where=pos, mode="function", inherits=FALSE)) fcn <- "()"; } pkg <- paste("[", pkg, "]", sep=""); } line <- paste("\\code{\\link", pkg, "{", obj, "}}", fcn, sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagClasshierarchy <- function(bfr) { txt <- getRdHierarchy(clazz); subclasses <- getKnownSubclasses(clazz); # If possible, create links to Rd docs for each of the subclasses. links <- c(); for (name in subclasses) { link <- name; if (exists(name, mode="function")) { cls <- get(name, mode="function"); if (inherits(cls, "Class")) { pkg <- getPackage(cls); if (is.null(pkg)) link <- paste("\\link{", link ,"}", sep="") else link <- paste("\\link[", pkg, "]{", link ,"}", sep=""); if (isAbstract(cls)) link <- paste("\\emph{", link, "}", sep=""); } } # link <- paste("\\code{", link ,"}", sep=""); links <- c(links, link); } # for (name in ...) subclasses <- paste(links, collapse=", "); txt <- paste(txt, "\\bold{Directly known subclasses:}\\cr\n", sep=""); txt <- paste(txt, subclasses, sep=""); txt <- paste(txt, "\\cr\n\n", sep=""); txt <- paste(txt, getRdDeclaration(clazz), "\n", sep=""); line <- txt; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagMethods <- function(bfr) { methods <- getRdMethods(clazz, visibility=visibility); line <- methods; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagAllMethods <- function(bfr) { bfr <- getTagValue(bfr); visibilities <- attr(bfr, "value"); # Ad hoc patch for parser /060530. addEnd <- (identical(visibilities, "}")) visibilities <- gsub(" ", "", visibilities); visibilities <- unlist(strsplit(visibilities, split="|", fixed=TRUE)); methods <- getRdMethods(clazz, visibilities=visibilities); line <- paste(methods, "\n\n", sep=""); methods <- Rdoc$methodsInheritedFrom(clazz, visibility, showDeprecated=showDeprecated, sort=sort); line <- paste(line, methods, sep=""); if (addEnd) line <- paste(line, "}", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagTitle <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); title <<- as.character(value); # Check the title for correctness according to http://developer.r-project.org/Rds.html firstLetter <- substring(title, 1,1); if (firstLetter != toupper(firstLetter)) throw(RdocException("Titles shoule be capitalized: ", title, source=sourcefile)); if (regexpr("[.]$", title) != -1) throw(RdocException("Titles should not end with a period: ", title, source=sourcefile)); if (regexpr("[^\\][\\][:letter:]", title) != -1) throw(RdocException("Titles should not contain markup: ", title, source=sourcefile)); if (isDeprecated) title <<- paste("Deprecated: ", title, sep=""); line <- paste("\\title{", title, "}", sep=""); rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagEval <- function(bfr) { bfr <- getTagValue(bfr); value <- attr(bfr, "value"); expr <- as.character(value); result <- eval(parse(text=expr)); line <- result; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tagInheritedmethods <- function(bfr) { methods <- Rdoc$methodsInheritedFrom(clazz, visibility, sort=sort); line <- methods; rd <<- paste(rd, line, sep=""); bfr; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tags <- list( "RdocClass" = tagRdocClass, "RdocGeneric" = tagRdocGeneric, "RdocFunction" = tagRdocFunction, "RdocDefault" = tagRdocDefault, "RdocMethod" = tagRdocMethod, "RdocObject" = tagRdocObject, "RdocData" = tagRdocData, "RdocDocumentation" = tagRdocDocumentation, "RdocAbout" = tagRdocAbout, "RdocPackage" = tagRdocPackage, # "classhierarchy" = tagClasshierarchy, # must be *before* "class". "synopsis" = tagSynopsis, "usage" = tagUsage, "keyword" = tagKeyword, # "Class" = tagRdocClass, "methodname" = tagRdocMethod, "name" = tagName, # "aliasmethod" = tagAliasMethod, # must be *before* "alias". # "aliasundocumented" = tagAliasUndocumented, # not useful. "alias" = tagAlias, "title" = tagTitle, # "class" = tagClass, "include" = tagInclude, "inheritedmethods" = "tagInheritedmethods", "examples" = tagExamples, "visibility" = tagVisibility, "get" = tagGet, "set" = tagSet, "author" = tagAuthor, "howtocite" = tagHowToCite, "seeclass" = tagSeeclass, "seemethod" = tagSeemethod, "seeothermethods" = tagSeeOtherMethods, "see" = tagSee, "methods" = tagMethods, "allmethods" = tagAllMethods, "eval" = tagEval ); names <- names(tags); attr(tags, "beginsWith") <- paste("^@", names, sep=""); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # SETUP # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Set the locale Sys.setlocale(locale=locale); # Make a best guess what the package is that is created by querying # the DESCRIPTION file, which should be in the parent directory of # the getManPath() directory. pkgPath <- dirname(getManPath(this)); pathname <- file.path(pkgPath, "DESCRIPTION"); if (!file.exists(pathname)) { stop("Cannot infer package name. File not found: ", pathname); } pi <- read.dcf(file=pathname); package <- pi[,"Package", drop=TRUE]; if (length(package) == 0L) { throw("Failed to infer package name. No 'Package' was listed in ", sQuote(pathname), "."); } if (length(package) > 1L) { throw("Failed to infer package name. More than one 'Package' were listed in ", sQuote(pathname), ": ", paste(sQuote(package), collapse=", ")); } Rdoc$package <- package; class <- NULL; clazz <- NULL; Rdoc$source <- sourcefile <<- NULL; rds <- list(); for (rdoc in rdocs) { # Remember the name of the source file in case of an error... Rdoc$source <- sourcefile <<- attr(rdoc, "sourcefile"); title <- NULL; objectName <- NULL; isDeprecated <- FALSE; method <- NULL; name <- NULL; usage <- NULL; visibility <- NULL; # ============================================================== # 1. Replace all shorttags # # This can be vectorized since all shorttags are read only # and does not rely on any state of Rdoc etc. # This should speed up the process. # ============================================================== for (kk in seq_along(shorttags)) { replace <- attr(shorttags, "replace")[kk]; # (a) Replace all occurances at the beginning of the lines. pattern <- attr(shorttags, "beginsWith")[kk]; rdoc <- gsub(pattern, replace, rdoc); # (b) Replace all other occurances. ready <- FALSE; while (!ready) { pattern <- attr(shorttags, "contains")[kk]; pos <- regexpr(pattern, rdoc); idx <- (pos != -1L); if (any(idx)) { len <- attr(pos, "match.length")[idx]; pos <- pos[idx]; prefix <- substring(rdoc[idx], first=1L, last=pos); suffix <- substring(rdoc[idx], first=pos+len); rdoc[idx] <- paste(prefix, replace, suffix, sep=""); } else { ready <- TRUE; } } } # for (kk ...) # ============================================================== # 2. Compile the remaining lines # # This can *not* be vectorized since some tags may change the # state of the Rdoc compiler or set a local variable, which # will affect following tags. # ============================================================== # (a) Make on big string of the whole Rdoc comment. # This will simplify handling of line breaks within a tag # argument, e.g. when @title "Bla bla\nbla" exists. rdoc <- paste(rdoc, collapse="\n"); # (b) Get the first occurance of a tag. # A tag begins with a '@', but can not have a letter, a # number or a '.' in front since then it could be a code # fragment refering to a S4 slot. patternL <- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; pattern <- sprintf("[^%s0-9.]@", patternL); pattern2 <- sprintf("[^%s0-9]@", patternL); rd <- ""; while (TRUE) { # (i) It can be that the tag start at position 1... pos <- regexpr("^@", rdoc); # (ii) ...otherwise... if (pos == -1L) { pos <- regexpr(pattern, rdoc); if (pos == -1L) break; # No more tags. Done! # Save everything before the tag... rd <- paste(rd, substring(rdoc, first=1L, last=pos), sep=""); # ...and make the tag be at the first position. rdoc <- substring(rdoc, first=pos+1L); } if (debug) str(rdoc); # (iii) Identify the tag tagName <- NULL; tagFunction <- NULL; for (kk in seq_along(tags)) { patternKK <- attr(tags, "beginsWith")[kk]; pos <- regexpr(patternKK, rdoc); if (pos != -1L) { len <- attr(pos, "match.length"); tagIdx <- kk; tagName <- names(tags)[kk]; if (debug) cat(paste("Found tag: ", tagName, "\n", sep="")); tagFunction <- tags[[kk]]; break; } } # for (kk ...) if (!is.null(tagFunction)) { # Shift the Rdoc buffer rdoc <- substring(rdoc, first=len+1L); if (is.function(tagFunction)) { # Evaluate the tag function in the current environment # so all variables can be shared between tags. # All tag functions must return the resulting buffer! expr <- substitute(tagFunction(rdoc), list(tagFunction=tagFunction, rdoc=rdoc)); rdoc <- eval(expr); } } else { pos <- regexpr(pattern2, substring(rdoc, first=2L)); tagName <- substring(rdoc, first=1L, last=pos); msg <- sprintf("Unknown tag not processed in '%s': '%s'", sourcefile, tagName); warning(msg); rd <- paste(rd, substring(rdoc, first=1L, last=1L), sep=""); rdoc <- substring(rdoc, first=2L); } if (isDeprecated && !showDeprecated) break; } # while(TRUE), i.e. get first tag... if (showDeprecated || !isDeprecated) { # Do not forget to add the rest! rd <- paste(rd, rdoc, sep=""); rdoc <- NULL; # Append all keywords at the end rd <- paste(rd, getRdKeywords(), sep="\n"); # Remove all empty lines rd <- gsub("[ \t]\n", "\n", rd); rd <- gsub("[ \t]\r", "\r", rd); if (is.null(name)) { # @RdocClass, @RdocDefault and/or @RdocMethod was not given. Search for classical \name{...} search <- regexpr("\\name\\{[^\\}]*\\}", rd); if (search == -1L) { throw(RdocException("The resulting Rd text does not have a \\name{} tag: ", substring(rd, first=1L, last=40L), source=sourcefile)); } name <- substring(rd, first=search+5L, last=search+attr(search, "match.length")-2); search <- regexpr("\\name\\{[^\\}]*\\}", substring(rd, first=search+1L)); if (search != -1L) throw(RdocException("The resulting Rd text has more than one \\name{} tag.", source=sourcefile)); } visibility <- "public"; if (is.null(visibility)) { if (is.null(objectName)) { } else if (!exists(objectName)) { # If no object was found, assume that it is a Rdoc comment for # a non-object, i.e. a concept or similar. } else { object <- get(objectName); modifiers <- attr(object, "modifiers"); if (is.element("private", modifiers)) { visibility <- "private"; } else if (is.element("protected", modifiers)) { visibility <- "protected"; } } } attr(rd, "visibility") <- as.character(visibility); attr(rd, "isDeprecated") <- isDeprecated; attr(rd, "name") <- as.character(name); attr(rd, "sourcefile") <- sourcefile; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Check Rd code? # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (check) { if (compareVersion(as.character(getRversion()), "2.10.0") >= 0) { # R v2.10.0 and newer tryCatch({ con <- textConnection(rd); rdParse <- tools::parse_Rd(file=con); }, warning = function(w) { filename <- sprintf("%s.Rd.ERROR", attr(rd, "name")); cat(rd, sep="\n", file=filename); throw(RdocException(sprintf("Syntax error in generated Rd code (see '%s') for Rdoc comment '%s' (in '%s') was detected by tools:parse_Rd(): %s", filename, attr(rd, "name"), attr(rd, "sourcefile"), as.character(w)))); }, finally = { close(con); con <- NULL; }) } else { # R v2.9.2 and before tryCatch({ ns <- getNamespace("tools"); tools_Rd_parse <- get("Rd_parse", mode="function", envir=ns); rdParse <- tools_Rd_parse(text=rd); if (length(rdParse$rest) > 0) { throw(RdocException("Unknown top-level text in generated Rd code for Rdoc comment '", attr(rd, "name"), "' (in '", attr(rd, "sourcefile"), "') (typically due to too many or a missing bracket): ", paste(rdParse$rest, collapse=", ", sep=""))); } }, error = function(e) { throw(RdocException("Syntax error in generated Rd code for Rdoc comment '", attr(rd, "name"), "' (in '", attr(rd, "sourcefile"), "') was detected by tools:Rd_parse(): ", as.character(e))); }) } } # if (check) rds <- c(rds, list(rd)); } else { warning(paste("No Rd file for '", objectName, "' was generated since it was declared deprecated.", sep="")); } # if (!isDeprecated) } # for (rdoc in rdocs) rds; } # compileRdoc() # A local version of the sourceTo() in R.io. sourceTo <- function(..., local=TRUE, envir=parent.frame()) { # Wrap up the arguments to source args <- list(...); if (!is.element("file", names(args))) names(args)[1] <- "file"; # Override any 'local' argument args$local <- local; # Create a call expression to source(..., local=local) expr <- substitute({ do.call(source, args) }, list(args=args)); # Call source() eval(expr, envir=envir); } # sourceTo() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Assert that the manPath exists. createManPath(this); filename <- as.character(filename); if (length(filename) == 1L && !file.exists(filename)) { if (regexpr("\\*", filename) != -1L || regexpr("\\?", filename) != -1L) { # Filename pattern pattern <- filename; # List all files filename <- list.files(); # Match to filename pattern filename <- grep(paste(pattern, "$", sep=""), filename, value=TRUE); # Keep only files filename <- filename[file_test("-f", filename)]; # Keep only newer files? } } # Load the source code in case it contains new stuff. if (source) { lapply(filename, FUN=source); } for (file in filename) { if (verbose) cat("Generating Rd files from source file ", file, "...", sep=""); rdocs <- extractRdocs(file, verbose=verbose, debug=debug); rd <- compileRdoc(rdocs, showDeprecated=showDeprecated, verbose=verbose, debug=debug); writeRd(rd, path=destPath, addTimestamp=addTimestamp, verbose=verbose, debug=debug); if (verbose) cat("\n"); } if (check) { check(this, manPath=destPath, verbose=verbose); } }, static=TRUE) # compile() ###########################################################################/** # @RdocMethod hierarchy # # @title "Gets the class hierarchy" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("hierarchy", "Rdoc", function(this, class, ...) { package <- getPackage(class); s <- paste("Package: ", package, "\\cr\n"); what <- if (inherits(class, "Class")) "Class" else "Interface"; s <- paste(s, "\\bold{", what, " ", getName(class), "}\\cr\n\n", sep=""); indent <- ""; for (extend in rev(getSuperclasses(class))) { link <- sapply(extend, FUN=function(name) { # isAbstract <- FALSE; link <- name; if (exists(name, mode="function")) { cls <- get(name, mode="function"); if (inherits(cls, "Class")) { pkg <- getPackage(cls); if (is.null(pkg)) link <- paste("\\link{", link ,"}", sep="") else link <- paste("\\link[", pkg, "]{", link ,"}", sep=""); # if (isAbstract(cls)) { # link <- paste("\\emph{", link, "}", sep=""); # isAbstract <- TRUE; # } } } paste("\\code{", link ,"}", sep=""); }); if (indent == "") { s <- paste(s, link, "\\cr\n", sep=""); indent <- "~~"; } else { s <- paste(s, "\\code{", indent, "+--}", link, "\\cr\n", sep=""); indent <- paste(indent, "~~~~~", sep=""); } s <- paste(s, "\\code{", indent, "|}\\cr\n", sep=""); } link <- paste("\\code{", getName(class), "}", sep=""); if (isAbstract(class)) link <- paste("\\emph{", link, "}", sep=""); s <- paste(s, "\\code{", indent, "+--}", link, "\\cr\n\n", sep=""); s; }, private=TRUE, static=TRUE); ###########################################################################/** # @RdocMethod declaration # # @title "Gets the class declaration" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("declaration", "Rdoc", function(this, class, ...) { s <- "public"; # visibility(class); if (isAbstract(class)) s <- paste(s, "abstract"); if (isStatic(class)) s <- paste(s, "static"); if (inherits(class, "Class")) s <- paste(s, "class") else throw(getName(class), " is neither a class nor an interface."); s <- paste(s, " \\bold{", getName(class), "}\\cr\n", sep=""); links <- getSuperclasses(class); if (length(links) > 0) { name <- links[1]; link <- name; if (exists(name, mode="function")) { cls <- get(name, mode="function"); if (inherits(cls, "Class")) { pkg <- getPackage(cls); if (is.null(pkg)) link <- paste("\\link{", link ,"}", sep="") else link <- paste("\\link[", pkg, "]{", link ,"}", sep=""); if (isAbstract(cls)) link <- paste("\\emph{", link, "}", sep=""); } } paste("\\code{", link ,"}", sep=""); s <- paste(s, "extends ", link, "\\cr\n", sep=""); } s; }, private=TRUE, static=TRUE); ###########################################################################/** # @RdocMethod methodsInheritedFrom # # @title "Gets all methods inherited from a class in Rd format" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("methodsInheritedFrom", "Rdoc", function(this, class, visibility=c("public", "protected", "private"), showDeprecated=FALSE, inheritedFrom=NULL, sort=TRUE, trial=FALSE, ...) { s <- ""; private <- is.element("private", visibility); # Classes for (extend in getSuperclasses(class)) { # Try to find a Class object with this name. clazz <- NULL; tryCatch({ clazz <- Class$forName(extend); }, error = function(ex) {}) if (is.null(clazz)) { # Use methods() to find methods methods <- methods(class=extend); pattern <- paste("[.]", extend, "$", sep=""); methods <- gsub(pattern, "", methods); } else { # Get all methods of this Class methods <- getMethods(clazz, private=private, deprecated=showDeprecated); methods <- methods[[extend]]; methods <- names(methods); } if (length(methods) > 0) { methods <- paste(methods, collapse=", "); s <- paste(s, sprintf("\\bold{Methods inherited from %s}:\\cr\n", extend)); s <- paste(s, methods, "\n\n", sep=""); } } s; }, private=TRUE, static=TRUE); setMethodS3("getObject", "Rdoc", function(static, name, mode="any", package=static$package, ...) { # Search for object in: # (i) the package names iff found, then # (ii) then the search path. # Try to infer the package's namespace. ns <- NULL; if (is.character(package)) { tryCatch({ ns <- getNamespace(package); }, error = function(ex) {}); } if (is.environment(ns) && exists(name, mode=mode, envir=ns)) { obj <- get(name, mode=mode, envir=ns); } else if (exists(name, mode=mode)) { obj <- get(name, mode=mode); } else { throw("Failed to locate object of mode \"", mode, "\": ", name); } obj; }, private=TRUE, static=TRUE); ###########################################################################/** # @RdocMethod getUsage # # @title "Gets the usage of a method" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{method}{A method name (@character string).} # \item{class}{An optional class name (@character string).} # \item{wrap}{An @integer specifying the maximum number of characters per line. Longer lines will be wrapped with newlines.} # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getUsage", "Rdoc", function(static, method, class=NULL, wrap=90L, indent=2L, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - buildUsage <- function(method, class=NULL, args, valueArg=NULL, wrap=90L, head=NULL, ...) { # Argument 'args': stopifnot(is.list(args)); indentStr <- paste(rep(" ", times=indent), collapse=""); correction <- 0L; if (length(head) == 0L) { if (is.null(class)) { head <- method; # Escape '%*%' to '\%*\%' head <- gsub("%", "\\%", head, fixed=TRUE); # Quote any method name containing '%' if (regexpr("%", head, fixed=TRUE) != -1L) head <- sprintf("`%s`", head); } else { # The effective length of this in the help manual is nchar(method). head <- sprintf("\\method{%s}{%s}", method, class); correction <- nchar(head) - nchar(method); } } correction0 <- correction; lines <- NULL; line <- paste(head, "(", sep=""); if (length(args) == 0L) { line <- paste(line, ") ", sep=""); } while (length(args) > 0L) { subargs <- args[[1L]]; nsubargs <-length(subargs); # Try to keep = together if (nsubargs >= 3L) { # If = fit on a line, then keep the together... if (sum(nchar(subargs[1:3L])) <= wrap) { subargs[3L] <- paste(subargs[1:3], collapse=""); subargs <- subargs[-(1:2)]; } else if (sum(nchar(subargs[1:2L])) <= wrap) { # ...otherwise, at least keep = together, iff possible. subargs[2L] <- paste(subargs[1:2], collapse=""); subargs <- subargs[-1L]; } nsubargs <-length(subargs); } # Remaining arguments args <- args[-1L]; nargs <- length(args); suffix <- if (nargs > 0L) ", " else ") "; # For each subargument for (kk in seq_len(nsubargs)) { subarg <- subargs[kk]; ## str(list(kk=kk, subarg=subarg)); if (kk == nsubargs) { subarg <- paste(subarg, suffix, sep=""); } else { subarg <- paste(subarg, " ", sep=""); } len <- nchar(subarg); # Does argument fit on the same line? if (nchar(line) - correction + len <= wrap) { line <- paste(line, subarg, sep=""); } else { lines <- c(lines, line); line <- paste(indentStr, subarg, sep=""); correction <- 0L; } } # for (kk ...) } # while (length(args) > 0L) # Append a value assignment, i.e. "... <- value"? if (!is.null(valueArg)) { arg <- paste("<- ", valueArg, sep=""); # Does it fit on the same line? if (nchar(line) - correction + nchar(arg) <= wrap) { line <- paste(line, arg, sep=""); } else { lines <- c(lines, line); line <- paste(indentStr, arg, sep=""); } } lines <- c(lines, line); lines <- gsub("[ ]$", "", lines); # Trim trailing space # Sanity check lens <- nchar(lines); lens[1L] <- lens[1L] - correction0; stopifnot(all(lens <= wrap)); ## print(lines); lines; } # buildUsage() if (!is.null(class)) { fcnName <- paste(method, class, sep="."); } else { fcnName <- method; } fcn <- NULL; tryCatch({ fcn <- getObject(static, name=fcnName, mode="function"); }, error = function(ex) { cat("Failed...\n"); print(ex); cat("Failed...done\n"); }); if (!is.function(fcn)) { throw(RdocException("Could not get usage. Function was not found: ", fcnName, "()", source=Rdoc$source)); } isStatic <- is.element("static", attr(fcn, "modifiers")); isConstructor <- inherits(fcn, "Class"); args <- Rdoc$argsToString(fcn, escapeRd=TRUE, collapse=FALSE); # Replacement methods are special isReplacement <- (regexpr("<-$", method) != -1L); if (isReplacement) { method <- gsub("<-$", "", method); nargs <- length(args); valueArg <- args[nargs]; args <- args[-nargs]; } else { valueArg <- NULL; } if (isConstructor) { usage <- buildUsage(method, args=args, valueArg=valueArg, wrap=wrap); } else if (isStatic) { # (a) The S3 method call lines <- buildUsage(method, class=class, args=args, valueArg=valueArg, wrap=wrap); usageM <- paste(lines, collapse="\n"); # (b) The "static" method call, e.g. Class$forName(...) # Adjust line width ('wrap') to fit prefix '## ' as well. lines <- buildUsage(method, class=class, args=args[-1L], valueArg=valueArg, head=paste(class, method, sep="$"), wrap=wrap - 3L); lines <- paste("## ", lines, sep=""); usageS <- paste(lines, collapse="\n"); # (c) Combine usage <- c("## Static method (use this):", usageS, "", "## Don't use the below:", usageM); } else if (!is.null(class)) { usage <- buildUsage(method, class=class, args=args, valueArg=valueArg, wrap=wrap); } else { usage <- buildUsage(method, args=args, valueArg=valueArg, wrap=wrap); } usage; }, private=TRUE, static=TRUE) # getUsage() ###########################################################################/** # @RdocMethod getClassS4Usage # # @title "Gets the usage of a S4 class" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{class}{A class name (@character string).} # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getClassS4Usage", "Rdoc", function(static, class, ...) { if (!inherits(class, "classRepresentation")) throw(InternalErrorException("Wrong usage.")); name <- class@className; usage <- paste("new(", name, ")", sep=""); hasConstructor <- exists(name, mode="function"); if (hasConstructor) { constructor <- get(name, mode="function"); args <- Rdoc$argsToString(constructor, collapse=TRUE); args <- paste(args, collapse=", "); constructorUsage <- paste(name, "(", args, ")", sep=""); usage <- paste(usage, "\n", constructorUsage, sep=""); } usage; }, private=TRUE, static=TRUE); ###########################################################################/** # @RdocMethod argsToString # # @title "Gets the arguments signature of a function" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{fcn}{A @function.} # \item{escapeRd}{If @TRUE, certain Rd markup symbols are escaped.} # \item{collapse}{If @TRUE, each argument is returned as a single string, # otherwise split up into a vector of strings as far as possible.} # \item{...}{Not used.} # } # # \value{ # Returns a @list of @character strings. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("argsToString", "Rdoc", function(static, fcn, escapeRd=FALSE, collapse=TRUE, ...) { a <- args(fcn); # Nothing to do? if (is.null(a)) { return("[primitive function]"); } # Sanity check if (typeof(a) != "closure") { throw("Expected closure but found something else: ", typeof(a)); } args <- formals(a); argsNames <- names(args); res <- list(); for (kk in seq_along(args)) { arg <- args[kk]; argName <- argsNames[kk]; s <- argName; argDefault <- arg[[1L]]; if (!missing(argDefault)) { argDefault <- deparse(argDefault, width.cutoff=20L); argDefault <- trim(argDefault); # Escape '%' (which is a comment in Rd format)? if (escapeRd) { argDefault <- gsub("\\%", "\\\\%", argDefault); } if (collapse) { argDefault <- paste(argDefault, collapse=" "); s <- paste(s, "=", argDefault, sep="", collapse=""); } else { s <- c(s, "=", argDefault); } } res <- c(res, list(s)); } res; }, private=TRUE, static=TRUE) # argsToString() ###########################################################################/** # @RdocMethod getRdTitle # # @title "Extracts the title string of a Rd file" # # \description{ # @get "title" corresponding the the specified method of the specified class. # } # # @synopsis # # \arguments{ # \item{method}{The method to be search for.} # \item{class}{The class the method belongs to.} # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getRdTitle", "Rdoc", function(this, class, method, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tools_fetchRdDB <- get("fetchRdDB", mode="function", envir=getNamespace("tools"), inherits=FALSE); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # e s c a p e N a m e ( ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - escapeName <- function(name) { name <- gsub("\\#", "POUND", name); name <- gsub("\\$", "DOLLAR", name); name <- gsub("\\%", "PERCENT", name); name <- gsub("\\&", "AND", name); name <- gsub("\\~", "TILDE", name); name <- gsub("\\_", "UNDERSCORE", name); name <- gsub("\\^", "POWER", name); name <- gsub("\\\\", "BACKSLASH", name); name <- gsub("\\{", "LCURLY", name); name <- gsub("\\}", "RCURLY", name); name <- gsub("<-", "< -", name); name; } # escapeName() title <- NULL; # Search for the file ..Rd in the man/ directory name <- createName.Rdoc(NULL, getName(class), method, escape=FALSE); name <- escapeName(name); rdName <- Rdoc$escapeRdFilename(name); rdFile <- paste(rdName, "Rd", sep="."); url <- file.path(getManPath(this), rdFile); if (file.exists(url)) { src <- paste(readLines(url, warn=FALSE), collapse="\n"); # Search for \title{...} in the Rd source titlePos <- regexpr("\\title\\{[^\\}]*}", src); if (titlePos == -1) { warning(paste("Could not find a \\title{} definition in the Rd file for ", method, " in ", getName(class), ". Will search in loaded packages.", sep="")); ""; } else { title <- trim(substring(src, first=titlePos+6, last=titlePos+attr(titlePos, "match.length")-2)); } } else { warning(paste("The Rd file for ", method, " in ", getName(class), " could not be found. Will search in loaded packages.", sep="")); } if (is.null(title)) { methodName <- paste(method, ".", getName(class), sep=""); packageName <- Rdoc$getPackageNameOf(methodName, mode="function"); if (length(packageName) == 1) { if (compareVersion(as.character(getRversion()), "2.10.0") >= 0) { # R v2.10.0 and newer path <- system.file("help", package=packageName); filebase <- file.path(path, packageName); tryCatch({ entry <- tools_fetchRdDB(filebase, key=methodName); tags <- lapply(entry, FUN=attr, "Rd_tag"); idx <- which(tags == "\\title"); if (length(idx) > 1) { idx <- idx[1]; } if (length(idx) == 1) { entry <- entry[[idx]]; entry <- entry[[1]]; title <- entry[1]; } }, error = function(ex) { warning(as.character(ex)); }); } else { package <- Package(packageName); tryCatch({ contents <- getContents(package); pos <- which(contents[,"Entry"] == name); if (length(pos) == 0) { warning(paste("Reverted to the CONTENTS file of package '", packageName, "', but found not matching entry: ", name, sep="")); } else if (length(pos) > 2) { warning(paste("Found more than one matching entry in the CONTENTS file of package '", packageName, "'. Using the first one only: ", name, sep="")); pos <- pos[1]; } if (length(pos) != 0) { title <- as.character(contents[pos, "Description"]); attr(title, "package") <- packageName; } }, error=function(ex) { warning(as.character(ex)); }) } } } title; }, private=TRUE, static=TRUE); ###########################################################################/** # @RdocMethod getPackageNameOf # # @title "Gets the package of a method or an object" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{objectName}{An method or object name (@character string).} # \item{mode}{Mode of object (@character string).} # \item{unique}{If @TRUE, only the first matching package is returned if # more than one is found.} # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getPackageNameOf", "Rdoc", function(static, objectName, mode="any", unique=TRUE, ...) { # Search all namespaces that are *attached* pkgs <- grep("^package:", search(), value=TRUE) pkgs <- gsub("^package:", "", pkgs) found <- sapply(pkgs, FUN=function(pkg) { exists(objectName, mode=mode, envir=asNamespace(pkg)) }) package <- names(found)[found] if (length(package) == 1L) return(package) if (length(package) > 1L && unique) { warning("Found more than one occurance of '", objectName, "' among the attached namespaces. Will only return the first one: ", paste(sQuote(package), collapse=", ")) return(package[1L]) } # If not found, then search any other namespace *loaded* pkgs <- setdiff(loadedNamespaces(), pkgs) found <- sapply(pkgs, FUN=function(pkg) { exists(objectName, mode=mode, envir=asNamespace(pkg)) }) package <- names(found)[found] if (length(package) == 1L) return(package) if (length(package) > 1L && unique) { warning("Found more than one occurance of '", objectName, "' among the loaded namespaces. Will only return the first one: ", paste(sQuote(package), collapse=", ")) return(package[1L]) } character(0L) }, private=TRUE, static=TRUE) ###########################################################################/** # @RdocMethod check # # @title "Checks the compiled Rd files" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{manPath}{The path to the Rd files (@character string).} # \item{verbose}{If @TRUE, extra information is outputted.} # \item{...}{Not used.} # } # # \value{ # Returns a printable object, which, if non-empty will show the errors. # } # # \details{ # Internally the \code{tools} package is used. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("check", "Rdoc", function(this, manPath=getManPath(this), verbose=FALSE, ...) { # file paths with trailing '/' are not recognized! /HB 2004-10-13 manPath <- gsub("/$", "", manPath); if (verbose) cat("Checking Rd files in '", manPath, "'...\n", sep=""); if (compareVersion(as.character(getRversion()), "2.10.0") >= 0) { # For R (>= 2.10.0) pathnames <- list.files(pattern="[.]Rd$", path=manPath, full.names=TRUE); res <- NULL; for (kk in seq_along(pathnames)) { pathname <- pathnames[kk]; res <- tools::checkRd(pathname); } } else { # For R (< 2.10.0) tools_check_Rd_files_in_man_dir <- get("check_Rd_files_in_man_dir", mode="function", envir=getNamespace("tools"), inherits=FALSE); res <- tools_check_Rd_files_in_man_dir(manPath); if (length(res$files_with_surely_bad_Rd) > 0) { throw("Syntax error in Rd file(s): ", paste(res$files_with_surely_bad_Rd, collapse=", ")); } if (length(res$files_with_likely_bad_Rd) > 0) { print(res$files_with_likely_bad_Rd); throw("Syntax error in Rd file(s): ", paste(res$files_with_surely_bad_Rd, collapse=", ")); } } if (verbose) cat("Checking Rd files in '", manPath, "'...done\n", sep=""); res; }) ###########################################################################/** # @RdocMethod isVisible # # @title "Checks if a member is visible given its modifiers" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{modifiers}{A @character string of modifiers.} # \item{visibilities}{A @character string of visibility flags.} # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the modifiers are equal or higher than the visibility # flags, otherwise @FALSE. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("isVisible", "Rdoc", function(static, modifiers, visibilities, ...) { if (is.element("deprecated", modifiers) && !is.element("deprecated", visibilities)) return(FALSE); if (is.element("trial", modifiers) && !is.element("trial", visibilities)) return(FALSE); levels <- c("private", "protected", "public"); modifiers <- intersect(modifiers, levels); if (length(modifiers) == 0) return(TRUE); visibilities <- intersect(visibilities, levels); if (length(visibilities) == 0) return(TRUE); modifiers <- factor(modifiers, levels=levels); visibilities <- factor(visibilities, levels=levels); any(as.integer(visibilities) <= as.integer(modifiers)); }, static=TRUE, protected=TRUE) # isVisible() ######################################################################### # HISTORY: # 2014-10-18 # o Now Rdoc$getPackageNameOf() also finds non-exported objects, and # it first searches all attached and then all loaded namespaces. # 2014-04-26 # o Now Rdoc$getRdUsage() escapes '%*%' to '\%*\%'. # 2013-10-07 # o Now Rdoc tag @howToCite does a better job when there are # multiple citations in CITATION. # 2013-06-27 # o Added trial version of Rdoc tag @usage. # 2013-05-30 # o Now Rdoc$compile() infer the package name from the DESCRIPTION # file (instead from the package directory name). # 2013-05-19 # o Now Rdoc$getUsage() inserts line breaks so that any usage line # is at most 90 characters long. # 2013-04-08 # o Now the @RdocData Rdoc tag also adds an \docType{data} Rd tag. # 2013-04-04 # o BUG FIX: In R.oo v1.13.1 a bug was introduced causing @allmethods # to ignore the optional following tag value. # 2013-04-03 # o Now Rdoc$compile() always outputs Rd files with '\n' line breaks # regardless of system. # o Now Rdoc$compile() uses locale "C" (default) to assert that # the same Rd files are generated regardless of system settings. # o Now Rdoc$compile() no longer gives a warning if argument 'filename' # is a vector. It should also handle multiple filenames and # source=TRUE. # 2013-03-25 # o BUG FIX: getTagValue() could read/consume a following '}', which # should not be considered a tag value. # 2013-03-08 # o Added support for @author "John Doe" as well as @author "JD" where # the initials are then inferred from the package's DESCRIPTION file. # 2012-12-28 # o Replaced all data.class(obj) with class(obj)[1]. # 2012-06-11 # o BUG FIX/GENERALIZATION: Rdoc$getKeywords() now uses system # environment variable R_DOC_DIR for locating the internal # KEYWORDS.db. Thanks to Charles Hogg at NIST for suggesting this. # 2012-04-17 # o Now Rdoc$getUsage() searches also the package namespace for # the function definition. This is done, before searching the # global environment. # o Added private static getObject(). # 2011-07-27 # o CLEANUP: Replaced a (!is.null(foo) > 0) with (!is.null(foo)). # 2010-09-22 # o Now Rdoc lines are allowed to start with double ('##') or tripple # ('###') comment characters in addition to single ('#') ones. # 2010-06-04 # o Now argument 'addTimestamp' of Rdoc$compile() default to FALSE. # This way the generate Rd file will remain identical unless there # are real Rdoc/code changes. Not adding timestamps is better when # working with a version control systems. # 2010-06-01 # o BUG FIX: If there are no Rd files, then check() of Rdoc would # throw the error "object 'res' not found". # 2009-10-26 # o BUG FIX: Rdoc$compile() did not work with R v2.10.0 and newer. # 2008-08-11 # o Replace all 'a %in% b' with is.element(a,b) due to weird bug, cf. # my R-devel post 'Argument "nomatch" matched by multiple actual # arguments ... %in% -> match?!?' on March 6, 2008. # 2008-07-30 # o Added shorttags: 'raw'. # 2007-09-17 # o Added 'warn=FALSE' to all readLines(). # 2007-06-09 # o Removed (incorrect) argument name 'list' from all substitute() calls. # 2007-01-06 # o Now getMethodsInheritedFrom() recognizes visiblity private. # 2006-09-12 # o Prepared the Rdoc compiler to no longer generating the \synopsis{} # statement for the @synopsis tag, which was the case for static # methods. I got an early note from Kurt Hornik saying all R base and # recommended package will have \synopsis{} removed in favor of the # \usage{} statement by the release of R v2.4.0. The Rd tag will be # deprecated around R v3.0.0 or so. # 2006-05-29 # o Added protected static method isVisible(). # o Added argument to @allmethods to specify visibility etc. # 2006-04-10 # o Replace the generated Rd comment header to exclude my name and the # date of the R.oo package, e.g. "2001-2006". This was done to help # any diff. # o BUG FIX: Rdoc$compile() did no longer write the name of the source # file in the header. # o BUG FIX: The code for formatting replacement methods contained a bug # that generated an error. # o Replaced "\t" with "\\t" in warning "Could not find a \title{}". # o Added argument 'addTimestamp=TRUE' to Rdoc$compile(). This makes it # possible to turn of the timestamp, because timestamps makes diff, # say the one in Subversion, think there is a real different. # 2006-04-03 # o Now replacement methods are recognized and treated specially, e.g. # \method{[}{MyClass}(i, j) <- value. # 2006-03-14 # o BUG FIX: Compiling Rdoc comments with invalid keyword tags would # generate an internal error. Same for invalid visibility tags etc. # 2006-02-18 # o Now createName() escapes name by default. # 2006-02-03 # o Added new tag RdocPackage. This is to replace the ".About ..." # page, especially since -package now is at the very top of # the package's index page. # o An Rd filename must begin with a letter or a digit. In R v2.2.1 # and before this has not been a problem, but R CMD check in R v2.3.0 # complains (with another error actually). # 2006-01-10 # o Updated the date string in the generated Rd headers. # 2006-01-06 # o Added Rd links to classes listed under "Directly known subclasses:". # 2005-06-17 # o BUG FIX: Used invalid regular expression '\\name{[^\\}]*}' instead # of '\\name\\{[^\\}]*\\}'. Why? The correct string is literally # '\name\{[^\}]\}' (no escape codes). The '\{' and '\}' (no escape) # are to tell regexpr that it should match '{' and '}'; '{' and '}' # are used for different purposes. Simple, ehe. Thanks Lorenz Wernisch, # School of Crystallography, University of London of reporting this. # 2005-06-08 # o BUG FIX: getRdKeywords() gave an error if no keywords are available. # 2005-06-03 # o Added internal addKeyword() to Rdoc$compile(). # o Now an RdocMethod tag will not add keyword 'internal' if the # class starts with a lower case, e.g. 'matrix'. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2005-02-11 # o Made all regular expression patterns strict. # 2005-02-10 # o Rd_parse() in Rdoc$compile() is only called if 'check' is TRUE. # o Making use of tryCatch() only. # 2005-02-09 # o If an error occur in tools:Rd_parse() it is now caught and # a more informative error is given (with filename and Rdoc name). # o By default, now Rdoc$compile() runs Rdoc$check() at the end. # 2005-02-03 # o Added a first simple test for undefined top-level tags in the # generated Rd code. Utilizes tools::Rd_parse(), which might be # renamed etc. according to its help page. # 2005-02-02 # o Added support for options() containing tag variables such as @author. # 2004-10-21 # o Added a local sourceTo() in compile(); will be used in the future. # 2004-10-18 # o Renamed private argsString() to argsToString(). # o BUG FIX: Rdoc tags was not be parsed for deprecated methods. # o Added Rdoc comments to all methods. # 2004-10-13 # o Added check(), which is a wrapper for tools:::check_Rd_files_in_man(). # o setManPath() now calls as.character() too. # o BUG FIX: setNameFormat("method.class") gave an error. # o BUG FIX: getPackageNameOf() now only return names of packages and # not just any environment. # o Changed the default name format to "method.class", which is the # standard used by R. # o Updated tagSeemethod() etc to make use of createName(). # 2004-06-27 # o Added \title{} output for RdocDocumention if missing. Similar to # RdocAbout. # 2004-03-11 # o getRdTitle() is now looking for the title in 1) the Rd file in the # Rdoc$manPath and then in 2) the CONTENTS files of loaded packages. # o Added private static getPackageNameOf(). # o getRdMethods() will now also list methods of the given class that are # defined in *other* (loaded) packages. This is useful when for # instance several packages of the same bundle provides methods to the # same class, but one wants to create a list of *all* methods together. # This will make it possible to have one bundle called say 'aroma' with # packages 'aroma.io', 'aroma.normalize', 'aroma.visualize' and still # list all classes in say package 'aroma'. # 2004-03-10 # o WORK AROUND: Due to a special behavior in LaTeX a verbatim environment # may not exist just before \end{Section} without having a line break # in between. The problem is that R CMD check & Co removes trailing # line breaks. The work around is to add a "\emph{}\n" line to fool it. # For Rdoc this is currently done for @howtocite tags. Another reason # for using Rdoc ;) # 2004-03-03 # o Update class to make use of tryCatch() instead of trycatch(). # This means that R v1.8.1 is now required for R.oo to work correctly. # 2004-03-02 # o BUG FIX: If variable 'author' did not exists and the @author tag is # requested an error was generated, but not the expected RdocException. # Instead a missing variable was the problem. Fixed. # 2003-12-31 # o BUG FIX: For some Rdoc types the \keyword{} statement was placed on # the same line as the previous Rd statement. This sometimes generated # cluttered Rd index files. # 2003-11-26 # o Added the tag @RdocDocumentation for general documentation. # 2003-10-19 # o Now Rdoc tries to create the manPath directory if missing. # o Added createManPath(). # 2003-09-22 # o Added trial version of @seeothermethods. # 2003-09-19 # o Now "Methods inherited from Object:" is also sensitive to the # showDeprecated argument. By default deprecated methods are not shown. # o Renamed all arguments 'deprecated' to 'showDeprecated'. # o Moved createMethods() to Rdoc.DEPRECATED.R. # 2003-07-18 # o Rdoc$compile() generated an InternalException when a class # was not found saying "Not a class". Now it throws an RdocException # and is more specific saying that the class does not exists. # Updated the Rdoc comments saying pointing out that the classes and # methods have to be loaded before calling Rdoc$compile(). # 2003-07-07 # o "BUG FIX": Both @examples and @include does not escape special Rd # characters such as '%' -> '\%'. # o BUG FIX: Forgot to escape '%' in \usage{}, which lead to unbalanced # curly brackets when R CMD check * ran. # 2003-05-03 # o BUG FIX: Misunderstood the usage or \synopsis and \usage. I thought # it was either or, but of course not. # 2003-04-29 # o Rdoc FIX: In the class hierarchy abstract classes was \emph{}'s, but # that does not work if they are linked. # o Now deprecated objects are not generated by default. # 2003-04-28 # o Added getKeywords() and isKeyword(). @keyword is now checking for # existance of keyword. # o Better error message: The name of source where an error occured is # also returned. # 2003-04-27 # o BUG FIX: Tag values that ended in EOF were not recognized. # o BUG FIX: tagSet(), tagVisibility() was mistakenly trying to update Rd. # o BUG FIX: @seemethod did only link to the class, not the method. # 2003-04-26 # o Major internal update: Much cleaner code and all tags do now rely on # function named tag(). # 2003-04-26 # o @RdocClass now also generates \keyword{classes}, because promptClass() # does it. # o Update getUsage() to support static methods by returning a string # of format "Class$method()". # 2003-04-23 # o Added get- and setNameFormat(). Now names of the help files can # be either "method.class" or "class.method". # o Improved the Rdoc comments and added a running example. # 2003-04-13 # o Tags are now ended with a space or a punctuation ( ,;!) but not a # period since it can be used in method names and not a colon since # that can be used as for instance @see base::help. # 2003-03-12 # o Added getManPath() and setManPath(). # o Major update: Now Rdoc$compile() will do most of the work. Now the # Rdoc perl script basically can be removed and all Rdoc to Rd # compilation can be done from within R. # o Now an .usage.Rdoc file is created for each class. # o Added private argsString() and public getUsage(). # o Started to write some Rdoc comments for, yes, the Rdoc class. # 2002-12-08 # o BUG FIX: The generated list of methods in each of the superclasses # showed way too many methods. Error was found in private method # methodsInheritedFrom(). # 2002-10-21 # o Made Rdoc a class under the new R.oo package. # 2002-03-05 # * BUG FIX: Added the argument 'this.class=class' in the new() calls in # both extends() and implements. # 2002-02-27 # * Found a bug in the code for creating .METHODS. It does not # check if the "method" actually is a function. Bug was found in # scanForMethods(). # * buildClass() now also creates methods section (.method.Rdoc). # * Added getTitle() and createMethods(). # 2002-02-26 # * BUG FIX: extends() and implements() did neither work because of # interactions with the package "methods" # * BUG FIX: Due to the new package "methods", my getExtends() did not # work as expected in this class. Now getExtends() is only called if # the object is of class Object. # * Updated to make use of setMethodS3(). # 2001-12-29 # * Symbol names for object does not anymore contain a "$" but a ".". # * Remove require(R.oo). It'll generate a loop in R v 1.4.0. # 2001-08-06 # * Minor bug fix: Rdoc couldn't generate class documentation for classes # in a package that also existed in .GlobalEnv. # * Made Rdoc a true static class. # 2001-07-17 # 2001-07-05 # * buildPackage() now loads the library if it is not loaded. # 2001-07-01 # * Made hierarchy() emphasizes abstract classes, which is more informative. # * When the perl script Rdoc.pl tried to compile this it complained, since # the start and stop tags for Rdoc comments were detected. Made a # workaround that works for now. # 2001-06-29 # * Created! ######################################################################### R.oo/R/Package.R0000755000177400001440000012051312726216524013154 0ustar murdochusers##########################################################################/** # @RdocClass Package # # @title "The Package class provides methods for accessing package information" # # \description{ # @classhierarchy # # Creates a Package that can be thrown and caught. The \code{Package} # class is the root class of all other \code{Package} classes. # } # # @synopsis # # \arguments{ # \item{name}{Name of the package.} # } # # \section{Fields and Methods}{ # @allmethods # } # # \examples{\dontrun{@include "../incl/Package.Rex"}} # # @author # # \keyword{programming} # \keyword{methods} #*/########################################################################### setConstructorS3("Package", function(name=NULL) { libPath <- NULL; version <- NULL; if (!is.null(name)) { tryCatch({ package <- packageDescription(name); version <- as.character(package$Version); libPath <- dirname(system.file(package=name)); }, warning = function(warn) { # installed.packages() may be slow()! packages <- as.data.frame(installed.packages()); idxs <- (packages$Package == name); if(!any(idxs)) { throw("Package is not installed: ", name); } packages <- packages[idxs,,drop=FALSE]; libPath <<- as.character(packages$LibPath); if (length(libPath) > 1) { warning(paste("Multiple installations of package '", name, "' was found. Using the first. Paths to all installations: ", paste(libPath, collapse=", "), sep="")); libPath <<- libPath[1]; } libPath <<- gsub("/$", "", libPath); version <<- as.character(packages$Version[1]); }) } extend(Object(), "Package", .name = name, .version = version, .libPath = libPath, .inBundle = NULL, .bundlePackages = NULL ) }) #########################################################################/** # @RdocMethod as.character # # @title "Gets a string representation of this package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{print(R.oo)} # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("as.character", "Package", function(x, ...) { # To please R CMD check this <- x; s <- paste(class(this)[1L], ": ", getName(this), " v", getVersion(this), sep="") date <- getDate(this) if (!is.na(date)) s <- paste(s, " (", getDate(this), ")", sep="") pos <- getPosition(this) if (pos != -1) s <- paste(s, " is loaded (pos=", pos, ").", sep="") else s <- paste(s, ".") s <- paste(s, " Title: ", getTitle(this), ".", sep="") # Do not call getBundle() here; it can be very slow! # bundle <- getBundle(this); # if (!is.null(bundle)) # s <- paste(s, " It is part of bundle ", bundle, " (", paste(getBundlePackages(this), collapse=", "), ").", sep="") url <- getUrl(this) if (!is.null(url)) s <- paste(s, " The official webpage is ", url, " and the", sep="") else s <- paste(s, " The", sep="") s <- paste(s, " maintainer is ", getMaintainer(this), ".", sep="") s <- paste(s, " The package is installed in ", getPath(this), ".", sep="") license <- getLicense(this) if (!is.null(license)) s <- paste(s, " License: ", license, ".", sep="") s <- paste(s, " Description: ", getDescription(this), sep="") s <- paste(s, " Type showNews(", getName(this), ") for package history, and ?", getName(this), " for help.", sep="") s }) #########################################################################/** # @RdocMethod getName # # @title "Gets the name of this package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getName", "Package", function(this, ...) { this$.name; }) #########################################################################/** # @RdocMethod getContents # # @title "Gets the contents of this package" # # \description{ # @get "title", i.e. the parsed \code{CONTENTS} file. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @data.frame. # } # # @author # # \seealso{ # @see "base::dcf". # @seeclass # } #*/######################################################################### setMethodS3("getContents", "Package", function(this, fields=NULL, ...) { pathname <- system.file("CONTENTS", package=this$.name); if (!file.exists(pathname)) throw("CONTENTS file missing for package '", this$.name, "': ", pathname); # DCF format == Debian Control File format contents <- read.dcf(file=pathname, fields=fields); contents <- as.data.frame(contents); contents; }, protected=TRUE) #########################################################################/** # @RdocMethod showContents # # @title "Show the CONTENTS file of this package" # # \description{ # @get "title". # If the \code{CONTENTS} file does not exist, an exception is thrown. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("showContents", "Package", function(this, ...) { path <- getPath(this); files <- list.files(path=path); file <- files[tolower(files) == "contents"]; if (length(file) == 0) throw("CONTENTS file for package ", getName(this), " does not exist."); pathname <- file.path(path, file); file.show(pathname, ...); }, protected=TRUE) #########################################################################/** # @RdocMethod getDescriptionFile # # @title "Gets the description file of this package" # # \description{ # @get "title", i.e. the parsed \code{DESCRIPTION} file. # } # # @synopsis # # \arguments{ # \item{fields}{A @vector of @character strings of fields to be returned. # If @NULL, all available fields are returned.} # \item{...}{Not used.} # } # # \value{ # Returns named @vector of @character strings. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getDescriptionFile", "Package", function(this, fields=NULL, ...) { unlist(packageDescription(this$.name, fields=fields)); }, protected=TRUE) #########################################################################/** # @RdocMethod showDescriptionFile # # @title "Show the DESCRIPTION file of this package" # # \description{ # @get "title". # If the \code{DESCRIPTION} file does not exist, an exception is thrown. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("showDescriptionFile", "Package", function(this, ...) { path <- getPath(this); files <- list.files(path=path); file <- files[tolower(files) == "description"]; if (length(file) == 0) throw("DESCRIPTION file for package ", getName(this), " does not exist."); pathname <- file.path(path, file); file.show(pathname, ...); }) #########################################################################/** # @RdocMethod getPath # # @title "Gets the library (system) path to this package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getPath", "Package", function(this, ...) { file.path(this$.libPath, getName(this), ""); }) #########################################################################/** # @RdocMethod getVersion # # @title "Gets the version of this package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # @seemethod "isOlderThan". # } #*/######################################################################### setMethodS3("getVersion", "Package", function(this, ...) { this$.version; }) #########################################################################/** # @RdocMethod isOlderThan # # @title "Checks if the package is older than a given version" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{version}{A @character string specifying a version to compare with.} # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the version of the package is less than the # specified version. # } # # @author # # \seealso{ # @seeclass # @seemethod "getVersion". # } #*/######################################################################### setMethodS3("isOlderThan", "Package", function(this, version, ...) { res <- compareVersion(getVersion(this), version); (res < 0); }) #########################################################################/** # @RdocMethod getDataPath # # @title "Gets the path to the data (data/) directory of this package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getDataPath", "Package", function(this, ...) { file.path(this$.libPath, getName(this), "data", ""); }) #########################################################################/** # @RdocMethod getDocPath # # @title "Gets the path to the accompanying documentation (doc/) directory of this package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{ # print(list.files(getDocPath(R.oo))) # explicit call, or # print(list.files(R.oo$docPath)) # as a virtual field # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getDocPath", "Package", function(this, ...) { file.path(this$.libPath, getName(this), "doc", ""); }) #########################################################################/** # @RdocMethod getExamplePath # # @title "Gets the path to the example (R-ex/) directory of this package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getExamplePath", "Package", function(this, ...) { file.path(this$.libPath, getName(this), "R-ex", ""); }) #########################################################################/** # @RdocMethod getDate # # @title "Gets the date when package was build" # # \description{ # Checks if the package is loaded onto the search path or not. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # @TRUE if the packages has been loaded, otherwise @FALSE. # } # # \examples{ # pkg <- Package("base") # print(isLoaded(pkg)) # TRUE # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getDate", "Package", function(this, ...) { getDescriptionFile(this, fields="Date"); }) #########################################################################/** # @RdocMethod getDescription # # @title "Gets the description of the package" # # \description{ # @get "title". Not to be mixed up with @seemethod "getDescriptionFile". # } # # @synopsis # # \arguments{ # \item{replaceNewlines}{If a @character string, all newline characters # are replaced with this string. Otherwise not.} # \item{...}{Not used.} # } # # \value{ # A @character string. # } # # \examples{ # pkg <- Package("base") # print(getDescription(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getDescription", "Package", function(this, replaceNewlines=" ", ...) { value <- getDescriptionFile(this, fields="Description"); if (is.character(replaceNewlines)) value <- gsub("[\r\n]", replaceNewlines, value); value; }) #########################################################################/** # @RdocMethod getPosition # # @title "Gets the search path position of the package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # An @integer. # } # # \examples{ # pkg <- Package("base") # print(getPosition(pkg)) # } # # @author # # \seealso{ # @seemethod "getEnvironment". # @see "base::search". # @seeclass # } #*/######################################################################### setMethodS3("getPosition", "Package", function(this, ...) { queries <- paste(sep="", "^package:", getName(this), "$"); res <- c(); for (query in queries) { pos <- which(regexpr(query, search()) != -1); if (length(pos) == 0) pos <- -1; res <- c(res, pos); } res; }) #########################################################################/** # @RdocMethod getEnvironment # # @title "Gets the environment of a loaded package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @environment, or @NULL if the package was not loaded. # } # # @author # # \seealso{ # @seemethod "getPosition". # @seeclass # } #*/######################################################################### setMethodS3("getEnvironment", "Package", function(this, ...) { pos.to.env(getPosition(this)); }) #########################################################################/** # @RdocMethod isLoaded # # @title "Checks if the package is installed on the search path or not" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # @TRUE if the packages has been loaded, otherwise @FALSE. # } # # \examples{ # pkg <- Package("base") # print(isLoaded(pkg)) # TRUE # } # # @author # # \seealso{ # @seemethod "load". # @see "base::search". # @seeclass # } #*/######################################################################### setMethodS3("isLoaded", "Package", function(this, ...) { (getPosition(this) != -1); }) #########################################################################/** # @RdocMethod load # # @title "Loads a package" # # \description{ # @get "title". This is an alternative way to use \code{library()} to # load a package. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # @TRUE if the packages is loaded, otherwise @FALSE. # } # # \examples{ # pkg <- Package("base") # print(load(pkg)) # } # # @author # # \seealso{ # @seemethod "unload". # @seemethod "isLoaded". # @see "base::search". # @seeclass # } #*/######################################################################### setMethodS3("load", "Package", function(this, ...) { .library <- library # To please R CMD check .library(package=getName(this), character.only=TRUE) isLoaded(this) }) #########################################################################/** # @RdocMethod unload # # @title "Unloads a package" # # \description{ # @get "title". This is an alternative way to use \code{detach()} to # unload a package. # If the package is not loaded, it will quietly return. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # \examples{\dontrun{ # @include "../incl/Package.unload.Rex" # }} # # @author # # \seealso{ # @seemethod "load". # @seemethod "isLoaded". # @see "base::search". # @seeclass # } #*/######################################################################### setMethodS3("unload", "Package", function(this, ...) { name <- paste("package:", getName(this), sep=""); pos <- which(name == search()); if (length(pos) == 1L) detach(pos=pos); }) #########################################################################/** # @RdocMethod ll # # @title "Generates a list of informative properties of all members of the package" # # \description{ # @get "title". # # If the package is not loaded, it will be loaded, the members will be # retrieved and then the package will be unloaded again. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @data.frame. # } # # \details{ # Note the difference from the default definition of \code{ll()} as # inherited from the @Object class. Here \code{ll()} has been # redefined to list the members of the package, i.e. the members in # the environment on search path that belongs to the package, whereas # the original usage was to list the members of the Object. However, # since the internal members of Package object is not of interest we # decided on this definition instead. # } # # \examples{ # \dontrun{ll(R.oo)} # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("ll", "Package", function(this, envir=pos.to.env(getPosition(this)), ...) { isLoaded <- isLoaded(this); if (!isLoaded) load(this); ll <- ll(..., envir=envir); if (!isLoaded) unload(this); ll; }) #########################################################################/** # @RdocMethod getClasses # # @title "Gets all classes of a package" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character @vector of class names. # } # # \examples{ # pkg <- Package("R.oo") # print(getClasses(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getClasses", "Package", function(this, ...) { pkgname <- getName(this) ns <- getNamespace(pkgname) names <- ls(envir=ns, all.names=FALSE) classes <- c() for (name in names) { object <- .getFunctionByName(name, where=c("ns", "search"), envir=ns, class="Class", mustExist=FALSE) if (inherits(object, "Class")) classes <- c(classes, name) } classes }, protected=TRUE, dontWarn="base") #########################################################################/** # @RdocMethod getUrl # # @title "Gets the URL of this package" # # \description{ # @get "title" as specified by the \code{DESCRIPTION} file. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{ # pkg <- Package("R.oo") # print(getUrl(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getUrl", "Package", function(this, ...) { getDescriptionFile(this, fields="URL"); }) #########################################################################/** # @RdocMethod getContribUrl # # @title "Gets the URL(s) from where this package can be installed" # # \description{ # @get "title" by first looking for comma or semicolon separated URLs # at the optional \code{ContribURL} line in the \code{DESCRIPTION} file # of the package. If no such line exists, \code{getUrl()} is used. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a vector of @character strings. # } # # \examples{ # pkg <- Package("R.oo") # print(getContribUrl(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getContribUrl", "Package", function(this, ...) { urls <- getDescriptionFile(this, fields="ContribURL"); if (is.null(urls) || is.na(urls)) { urls <- getDescriptionFile(this, fields="URL"); if (is.null(urls) || is.na(urls)) { return(NA_character_) } } urls <- strsplit(urls, "[,;]")[[1]]; urls <- gsub("^[ \t]*", "", urls); urls <- gsub("[ \t]*$", "", urls); urls; }, private=TRUE) #########################################################################/** # @RdocMethod getDevelUrl # # @title "Gets the URL(s) from where the developers version of this package can be installed" # # \description{ # @get "title" by looking for comma or semicolon separated URLs # at the optional \code{DevelURL} line in the \code{DESCRIPTION} file # of the package. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a vector of @character strings. # } # # \examples{ # pkg <- Package("R.oo") # print(getDevelUrl(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getDevelUrl", "Package", function(this, ...) { urls <- getDescriptionFile(this, fields="DevelURL"); if (is.null(urls) || is.na(urls)) { return(NA_character_) } urls <- strsplit(urls, "[,;]")[[1]]; urls <- gsub("^[ \t]*", "", urls); urls <- gsub("[ \t]*$", "", urls); urls; }, private=TRUE) #########################################################################/** # @RdocMethod getMaintainer # # @title "Gets the Maintainer of this package" # # \description{ # @get "title" as specified by the \code{DESCRIPTION} file. # } # # @synopsis # # \arguments{ # \item{as}{A @character string specifying the return format.} # \item{include}{A @character @vector specifying which person fields # to include if returning a @character string.} # \item{...}{Optional arguments passed to @see "utils::format.person".} # } # # \value{ # Returns a @character string or a @see "utils::person" object. # } # # \examples{ # pkg <- Package("R.oo") # print(getMaintainer(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getMaintainer", "Package", function(this, as=c("character", "person"), include=c("given", "family"), ...) { # Argument 'as': as <- match.arg(as); persons <- getDescriptionFile(this, fields=c("Authors@R", "Maintainer")); persons <- persons[!is.na(persons)]; if (length(persons) == 0L) { return(NA_character_) } persons <- persons[1L]; key <- names(persons)[1L]; # Parse? if (key == "Authors@R") { personsP <- eval(parse(text=persons)); # Find creators isCreator <- sapply(personsP, FUN=function(p) is.element("cre", p$role)); if (any(isCreator)) { personsP <- personsP[isCreator]; } persons <- format(personsP, include=include, ...); } else { personsP <- NULL; } if (as == "character") { return(persons); } if (is.null(personsP)) { personsP <- as.person(persons); } personsP; }) #########################################################################/** # @RdocMethod getAuthor # # @title "Gets the Author of this package" # # \description{ # @get "title" as specified by the \code{DESCRIPTION} file. # } # # @synopsis # # \arguments{ # \item{as}{A @character string specifying the return format.} # \item{include}{A @character @vector specifying which person fields # to include if returning a @character string.} # \item{...}{Optional arguments passed to @see "utils::format.person".} # } # # \value{ # Returns a @character string or a @see "utils::person" object. # } # # \examples{ # pkg <- Package("R.oo") # print(getAuthor(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getAuthor", "Package", function(this, as=c("character", "person"), include=c("given", "family"), ...) { # Argument 'as': as <- match.arg(as); persons <- getDescriptionFile(this, fields=c("Authors@R", "Author")); persons <- persons[!is.na(persons)]; if (length(persons) == 0L) { return(NA_character_) } persons <- persons[1L]; key <- names(persons)[1L]; # Parse? if (key == "Authors@R") { personsP <- eval(parse(text=persons)); persons <- format(personsP, include=include, ...); } else { personsP <- NULL; } if (as == "character") { return(persons); } if (is.null(personsP)) { personsP <- as.person(persons); } personsP; }) #########################################################################/** # @RdocMethod getTitle # # @title "Gets the Title of this package" # # \description{ # @get "title" as specified by the \code{DESCRIPTION} file. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{ # pkg <- Package("R.oo") # print(getTitle(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getTitle", "Package", function(this, ...) { getDescriptionFile(this, fields="Title"); }) #########################################################################/** # @RdocMethod getLicense # # @title "Gets the License of this package" # # \description{ # @get "title" as specified by the \code{DESCRIPTION} file. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{ # pkg <- Package("R.oo") # print(getLicense(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getLicense", "Package", function(this, ...) { getDescriptionFile(this, fields="License"); }) #########################################################################/** # @RdocMethod getBundle # # @title "Gets the Bundle that this package might belong to" # # \description{ # @get "title" as specified by the \code{DESCRIPTION} file. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # If the package is part of a bundle, the name of the bundle is returned. # Otherwise, @NULL is returned. # } # # \details{ # The first call to this method is normally slow because all installed # packages are scanned. The result of this first call is cached and # used as the return value for all subsequent calls, which are then much # faster. # } # # \examples{ # pkg <- Package("R.oo") # print(getBundle(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getBundle", "Package", function(this, ...) { if (is.null(this$.inBundle)) { # installed.packages() may be slow()! pkgs <- installed.packages(); if (is.element("Bundle", colnames(pkgs))) { names <- pkgs[,"Package"]; bundle <- pkgs[names == getName(this), "Bundle"]; } else { bundle <- NA; } this$.inBundle <- bundle; } if (is.na(this$.inBundle)) { NULL } else { this$.inBundle; } }, protected=TRUE) #########################################################################/** # @RdocMethod getBundlePackages # # @title "Gets the names of the other packages that is in the same bundle as this package" # # \description{ # @get "title" as specified by the \code{DESCRIPTION} file. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character @vector of package names or @NULL. # } # # \details{ # The first call to this method is normally slow because all installed # packages are scanned. The result of this first call is cached and # used as the return value for all subsequent calls, which are then much # faster. # } # # \examples{ # pkg <- Package("R.oo") # print(getBundle(pkg)) # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getBundlePackages", "Package", function(this, ...) { bundle <- getBundle(this); if (is.null(bundle)) return(NULL); if (is.null(this$.bundlePackages)) { pkgs <- installed.packages(); bundles <- pkgs[,"Bundle"]; incl <- !is.na(bundles) & (bundles == bundle); this$.bundlePackages <- pkgs[incl, "Package"]; } this$.bundlePackages; }, protected=TRUE) #########################################################################/** # @RdocMethod getChangeLog # @aliasmethod getNews # @aliasmethod getHistory # # @title "Gets the change log of this package" # # \description{ # @get "title", that is, (by default) the \code{NEWS} (then the # \code{HISTORY} and \code{ChangeLog}) file, which should is expected to # be located in the root directory of the package, # i.e. @seemethod "getPath". # } # # @synopsis # # \arguments{ # \item{filenames}{A @character @vector of (non-case sensitive) filenames # to be searched for.} # \item{newline}{The @character string to collapse lines in the file.} # \item{...}{Not used.} # } # # \value{ # Returns the complete contents of the change log file as a # @character string. If not found, @NULL is returned. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getChangeLog", "Package", function(this, filenames=c("NEWS", "HISTORY", "ChangeLog"), newline="\n", ...) { # Argument 'filenames': filenames <- as.character(filenames); filenames <- tolower(filenames); path <- getPath(this); files <- list.files(path=path); # Find change log files idx <- match(filenames, tolower(files)); idx <- idx[!is.na(idx)]; files <- files[idx]; if (length(files) == 0) return(NULL); # First file file <- files[1]; pathname <- file.path(path, file); lines <- readLines(pathname); lines <- paste(lines, collapse=newline); lines; }) setMethodS3("getHistory", "Package", function(this, ...) { getChangeLog(this, ...); }) setMethodS3("getNews", "Package", function(this, ...) { getChangeLog(this, ...); }) #########################################################################/** # @RdocMethod showChangeLog # @aliasmethod showHistory # @aliasmethod showNews # # @title "Show the change log of this package" # # \description{ # @get "title". # If the change log file does not exist, an exception is thrown. # } # # @synopsis # # \arguments{ # \item{filenames}{A @character @vector of (non-case sensitive) filenames # to be searched for.} # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # @seemethod "getChangeLog". # @seeclass # } #*/######################################################################### setMethodS3("showChangeLog", "Package", function(this, filenames=c("NEWS", "HISTORY", "ChangeLog"), ...) { # Argument 'filenames': filenames <- as.character(filenames); filenames <- tolower(filenames); path <- getPath(this); files <- list.files(path=path); # Find change log files idx <- match(filenames, tolower(files)); idx <- idx[!is.na(idx)]; files <- files[idx]; if (length(files) == 0) return(NULL); # First file file <- files[1]; if (length(file) == 0) throw("NEWS/HISTORY/ChangeLog file for package ", getName(this), " does not exist."); pathname <- file.path(path, file); file.show(pathname, ...); }) setMethodS3("showHistory", "Package", function(this, ...) { showChangeLog(this, ...); }) setMethodS3("showNews", "Package", function(this, ...) { showChangeLog(this, ...); }) #########################################################################/** # @RdocMethod getHowToCite # # @title "Gets the citation of this package" # # \description{ # @get "title". # If text file \code{HOWTOCITE} exists in package root directory, # then its contents is retrieved, otherwise @see "utils::citation" # for the package is retrieved. # } # # @synopsis # # \arguments{ # \item{newline}{The @character string to collapse lines in the file.} # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("getHowToCite", "Package", function(this, newline="\n", ...) { if (file.exists(pathname <- file.path(getPath(this), "HOWTOCITE"))) { lines <- readLines(pathname); } else { db <- citation(package=getName(this)); lines <- format(db, style="textVersion"); } lines <- paste(lines, collapse=newline); lines; }, protected=TRUE) #########################################################################/** # @RdocMethod showHowToCite # # @title "Show the HOWTOCITE file of this package" # # \description{ # @get "title". See also @seemethod "getHowToCite". # If the \code{HOWTOCITE} file does not exist, an exception is thrown. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("showHowToCite", "Package", function(this, ...) { path <- getPath(this); files <- list.files(path=path); file <- files[tolower(files) == "howtocite"]; if (length(file) == 0) throw("HOWTOCITE file for package ", getName(this), " does not exist."); pathname <- file.path(path, file); file.show(pathname); }, protected=TRUE) #########################################################################/** # @RdocMethod startupMessage # # @title "Generates a 'package successfully loaded' package startup message" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Additional arguments passed to # @see "R.methodsS3::pkgStartupMessage".} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # @seeclass # } #*/######################################################################### setMethodS3("startupMessage", "Package", function(this, ...) { date <- getDate(this) if (is.na(date)) { msg <- sprintf("%s v%s successfully loaded. See ?%s for help.", getName(this), getVersion(this), getName(this)) } else { msg <- sprintf("%s v%s (%s) successfully loaded. See ?%s for help.", getName(this), getVersion(this), date, getName(this)) } pkgStartupMessage(msg, ...) }, protected=TRUE) ############################################################################ # HISTORY: # 2015-01-05 # o CLEANUP: Defunct update() for Package. # 2013-09-25 # o CLEANUP: Deprecated update() for Package. # 2013-08-29 # o Now startupMessage() for Package utiliizes new pkgStartupMessage() # of R.methodsS3, which acknowledge library(..., quietly=TRUE). # 2013-08-23 # o CLEANUP: Made several Package methods protected, i.e. they will # not show up in listings/help by default. # o Now getHowToCite() for Package utilizes utils::citation(), if # package don't contain a HOWTOCITE file. It is recommended to # write packages with CITATION instead of HOWTOCITE. # 2013-03-08 # o Now getAuthor() for Package uses the 'Authors@R' field of DESCRIPTION # and if not found then the 'Author' field. In addition, using argument # 'as="person"' with parse and return the authors list as 'person' object. # 2012-12-28 # o Replaced all data.class(obj) with class(obj)[1]. # 2012-12-19 # o Added startupMessage() for Package. # 2012-09-10 # o BUG FIX: getContribUrl() and getDevelUrl() would give an error if # corresponding fields did not exists in the DESCRIPTION file. Now # they return NAs just as getUrl(). # 2012-03-08 # o Now package no longer warnings about renaming existing functions # getMethods() and getClasses() of 'base' to default methods during # installation, iff R.methodsS3 (>= 1.2.3). # 2011-12-23 # o Now Package() loads the 'utils' package, if needed. # 2010-11-01 # o CLEANUP/FIX: Dropped package.description() from getDescriptionFile() # for Package, which was used for pre-R v1.9.0 compatibility reasons. # 2010-04-13 # o BUG FIX: Package(pkg) would throw "Error in Package(pkgname) : object # 'package' not found", if 'pkg' is installed in multiple libraries. # o LANGUAGE FIX: Warning message of Package() said "too" instead of "to". # 2009-11-19 # o Added isOlderThan() for Package. # 2008-10-09 # BUG FIX: getBundle() of Package gave "Error in getBundle.Package(pkg) : # subscript out of bounds" starting with R v2.10.0. # 2008-08-11 # o Replace all 'a %in% b' with is.element(a,b) due to weird bug, cf. # my R-devel post 'Argument "nomatch" matched by multiple actual # arguments ... %in% -> match?!?' on March 6, 2008. # 2008-05-08 # o Added getNews() and showNews(). NEWS files are now detected (first). # 2007-06-09 # o BUG FIX: Queried non-existing object 'error' instead of 'ex' in # the exception handling of update() of the Package class. # o Removed (incorrect) argument name 'list' from all substitute() calls. # 2007-06-01 # o Removed already deprecated getData() because there might be a name # clash with the 'nlme' package. # 2006-07-13 # o Now update() returns invisibly. # o BUG FIX: update(R.oo) would throw an error and package was detached. # This was because it used trycatch() of R.oo(!). Now, tryCatch() is # used instead. However, it was also that the automatic reloading of # a package that was going to be updated failed for non-CRAN packages, # because missing 'add=TRUE' on second on.exit(). # o Added Note to do "showChangeLog()..." for package history. # 2006-03-14 # o showHistory() was calling itself. # 2006-02-08 # o Added getChangeLog() and showChangeLog(), which search for the ChangeLog # file and then the HISTORY file. get- and showHistory() are now just # wrappers for these new methods. # 2005-06-14 # o Added argument 'replaceNewline' to getDescription(). # o Now as.character() of Package reports the title, the license, and the # description, but no longer if the package is part of a bundle. The # latter was too slow since it had to scan all installed packages. # 2005-05-02 # o Added getDevelUrl(). # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2005-02-10 # o Added getDescription() to get the 'Descreption' field of DESCRIPTION. # o Renamed get- & showDescription() to get- & showDescriptionFile(). # o Making use of tryCatch() only. # 2004-10-21 # o Added getEnvironment(). # 2004-10-18 # o Added an Rdoc alias for getData(). # 2004-10-13 # o Change the example of Package's unload() to use package 'boot' # instead of obsolete 'ts'. # 2004-06-27 # o Substantially decresed the time required for creating a Package object; # packageDescription() is tried first and then if it generates a warning # (==not found), installed.packages() is used, which used to slow down # the constructor. # o Now getBundle() and getBundlePackages() cache the result so that only # the first call is slow. # o Now file.path() is used where ever applicable. Note: for directories # add "" to assure that an "/" is appended at the end. # 2004-04-21 # o Fix deprecated warning for package.description() by minor internal # updates. # o Added argument 'fields' to getDescription(). # 2004-03-11 # o Remove argument 'reload' from update() since the package has to be # unloaded anyway before installing a new version. Thus, library() is # always called afterwards. # o Added getContents() and showContents(). # 2004-03-02 # o BUG FIX: Package class - from R v1.8.1 we noted that R CMD check made # installed.packages() return multiple matches of the same package. This # might have been a problem before too, but R CMD check never complained. # 2003-12-31 # o Added showDescription(), getHistory(), showHistory(), getHowToCite() # and showHowToCite(). # 2003-12-16 # o update() does now also reload the updated package by default. # 2003-05-04 # o BUG FIX: update() of Package did not work. Did by mistake add a package # argument to update.packages() too. That argument is only used in # install.packages though. # 2003-04-29 # o Added argument force=FALSE to update(). # 2003-04-24 # o BUG FIX: getContribUrl() did not do getUrl() if no ContribURL existed. # 2003-04-23 # o update() now tries all URLs and return TRUE of FALSE. # o Update getContribUrl() to be able to return more than one url. # 2003-04-13 # o Added ll() for convience. # o Added unload(), update() and getDocPath(). # o Wrote Rdoc comments for all methods. # 2003-01-18 # o Replaced all occurences of getClass() with data.class(). Will change # the use of getClass() in the future to return a Class object. # 2003-01-17 # o Added getUrl(), getMaintainer(), getAuthor(), getTitle(), getLicense() # and getBundle(). Made the output from as.character() more informative. # 2002-10-22 # o Added load(). # 2002-10-21 # o Created. ############################################################################ R.oo/R/020.makeObjectFinalizer,private.R0000644000177400001440000002434512726216524017503 0ustar murdochusers###########################################################################/** # @RdocFunction .makeObjectFinalizer # # @title "Creates a standalone finalizer function for Object" # # \description{ # @get "title", which assumes only that the \pkg{base} package is available. # } # # @synopsis # # \arguments{ # \item{this}{The @Object to be finalized.} # \item{reloadRoo}{If @TRUE, the finalizer will try to temporary # reload the \pkg{R.oo} package if not loaded.} # } # # \value{ # Returns a @function that can be passed to @see "base::reg.finalizer". # } # # \details{ # The created finalizer is reentrant. # This is always the case when the \pkg{R.oo} package is already # loaded when the finalizer is called. # It is also always the case on R v2.15.2 Patched r61487 and beyond. # In other cases, the finalizer inspects the call stack # (via @see "sys.calls") to check whether @see "base::parse" # has been called or not. If it is on the call stack, it indicates # that @see "base::parse" triggered the garbage collection, and # the \pkg{R.oo} package will \emph{not} be reloaded in order to # avoid risking @see "base::parse" being called again. # } # # @keyword internal #*/########################################################################### .makeObjectFinalizer <- function(this, reloadRoo=TRUE) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getObjectInfo <- function(this) { env <- attr(this, ".env"); if (is.null(env)) return(NA_character_); # base::environmentName() was added to R v2.5.0 if (exists("environmentName", mode="function", envir=getNamespace("base"), inherits=FALSE)) { name <- environmentName(env); } else { name <- ""; } if (name == "") { # Cannot assume 'utils' is loaded name <- utils::capture.output(print.default(env)); name <- name[1L]; # Just in case name <- gsub("[<]*environment:[ ]*([^>]*)[>]", "\\1", name); } className <- class(this)[1L]; name <- paste(className, ": ", name, sep=""); # More debug information if (className == "Package") { name <- sprintf("%s {.name='%s'}", name, env$.name); } name; } # getObjectInfo() isLibraryReentrant <- function() { getRversion2 <- function() { rVer <- R.version[c("major", "minor", "status", "svn rev")]; names(rVer)[3:4] <- c("patched", "rev"); rVer$patched <- ifelse(identical(rVer$patched, "Patched"), 1L, 0L); rVer$rev <- ifelse(is.null(rVer$rev), 0L, rVer$rev); rVer <- lapply(rVer, FUN=as.numeric); rVer; } # getRversion2() rVer <- getRversion2(); if (rVer$major >= 3) return(TRUE); if (rVer$major < 2) return(FALSE); if (rVer$minor >= 15.3) return(TRUE); if (rVer$minor < 15.2) return(FALSE); if (rVer$patched < 1) return(FALSE); if (rVer$rev < 61487) return(FALSE); TRUE; } # isLibraryReentrant() isParseCalled <- function() { calls <- sys.calls(); if (length(calls) == 0L) return(FALSE); for (kk in seq_along(calls)) { call <- calls[[kk]]; name <- call[[1L]]; if (!is.symbol(name)) next; if (name == "do.call") { name <- call[[2L]]; if (!is.symbol(name)) next; name <- as.character(name); } if (name == "parse") { return(TRUE); } } # for (kk ...) FALSE; } # isParseCalled() isLibraryActive <- function() { # Just in case the below won't work one day due to R updates... tryCatch({ # Identify the environment/frame of interest by making sure # it at least contains all the arguments of source(). argsToFind <- names(formals(base::library)); # Scan the call frames/environments backwards... srcfileList <- list(); for (ff in sys.nframe():0) { env <- sys.frame(ff); # Does the environment look like a library() environment? exist <- sapply(argsToFind, FUN=exists, envir=env, inherits=FALSE); if (!all(exist)) { # Nope, then skip to the next one next; } return(TRUE); } # for (ff ...) }, error = function() {}); FALSE; } # isLibraryActive() isRooLoading <- function() { for (n in sys.nframe():1) { env <- sys.frame(n); if (exists("__NameSpacesLoading__", envir=env, inherits=FALSE)) { pkgs <- get("__NameSpacesLoading__", envir=env, inherits=FALSE); if (is.element("R.oo", pkgs)) return(TRUE); } } # for (n ...) FALSE; } # isRooLoading() isRooLoaded <- function() { is.element("R.oo", loadedNamespaces()); } # isRooLoaded() # NOTE: The finalizer() depends on the 'this' object. # /HB 2011-04-02 # Note, R.oo might be detached when this is called! If so, reload # it, this will be our best chance to run the correct finalizer(), # which might be in a subclass of a different package that is still # loaded. finalizer <- function(env) { debug <- FALSE; if (debug) message(sprintf("finalizer(): reloadRoo=%s", reloadRoo)); if (debug) message(paste(capture.output(print(sessionInfo())), collapse="\n")) # Classes for which it is known that finalizer() does nothing if (is.element(class(this)[1L], c("Object", "Class", "Package"))) { return(); } # Do nothing if R.oo is being loaded if (isRooLoading()) return(); # Is R.oo::finalize() available? if (isRooLoaded()) { if (debug) message(sprintf("finalizer(): Call finalize()...")); R.oo::finalize(this); if (debug) message(sprintf("finalizer(): Call finalize()...done")); return(); } # Nothing to do? if (!reloadRoo) return(); warning(sprintf("Object was not be finalize():d properly because the R.oo package was not loaded: %s", getObjectInfo(this))); return(); # Skip the finalizer()? genv <- globalenv(); if (exists("...R.oo::skipFinalizer", envir=genv, inherits=FALSE)) { if (debug) message(sprintf("Skipping finalizer().")); return(); } # Skip because library() is active? if (isLibraryActive()) { warning(sprintf("Detected finalization of Object while library() is working on attaching a package and the R.oo package is not loaded. This is most likely due to a *temporary* Object allocated in .onLoad()/.onAttach(), which is not allowed. Finalization of Object will *not* be skipped: %s", getObjectInfo(this))); return(); } # Check if base::library() is reentrant... if (!isLibraryReentrant()) { # If not, check if base::parse() triggered the garbage collection # and/or has been called, because then we must not call library(), # because it will in turn call parse() potentially causing R to # crash. if (isParseCalled()) { warning("Object may not be finalize():d properly because the R.oo package was not loaded and will not be reloaded, because if done it may crash R (running version of R is prior to R v2.15.2 Patched r61487 and the garbage collection was triggered by base::parse()): ", getObjectInfo(this)); return(); } } warnMsg <- ""; # (1) Load the 'R.oo' package if (debug) message(sprintf("finalizer(): Reloaded R.oo...")); suppressMessages({ warnMsg <- suppressWarnings({ loadNamespace("R.oo"); }); }); if (debug) message(sprintf("finalizer(): Reloading R.oo...done")); if (is.character(warnMsg)) { warnMsg <- sprintf(" (with warning %s)", warnMsg); } else { warnMsg <- ""; } # For unknown reasons R.oo might not have been loaded. if (!isRooLoaded()) { warning(sprintf("Object may not be finalize():d properly because the R.oo package failed to reload%s: %s", warnMsg, getObjectInfo(this))); return(); } # Make sure to unload R.oo at the end on.exit(unloadNamespace("R.oo")); if (debug) message(sprintf("finalizer(): Call finalize()...")); R.oo::finalize(this); if (debug) message(sprintf("finalizer(): Call finalize()...done")); # NOTE! Before unloading R.oo again, we have to make sure the Object:s # allocated by R.oo itself (e.g. an Package object), will not reload # R.oo again when being garbage collected, resulting in an endless # loop. We do this by creating a dummy finalize() function, detach # R.oo, call garbage collect to clean out all R.oo's objects, and # then remove the dummy finalize() function. # (2) Put a dummy finalize() function on the search path. if (!exists("...R.oo::skipFinalizer", envir=genv, inherits=FALSE)) { assign("...R.oo::skipFinalizer", TRUE, envir=genv, inherits=FALSE); on.exit({ rm(list="...R.oo::skipFinalizer", envir=genv, inherits=FALSE); }, add=TRUE) } # (4) Force all R.oo's Object:s to be finalize():ed. if (debug) message(sprintf("finalizer(): Calling base::gc()")); base::gc(); if (debug) message(sprintf("finalizer(): done")); } # finalizer() return(finalizer); } # .makeObjectFinalizer() ############################################################################ # HISTORY: # 2014-02-21 # o Now .makeObjectFinalizer() returns a finalizer that only loads the # R.oo package (it used to attach it). # o Now calling base::gc() explicitly. # 2013-10-13 # o ROBUSTNESS: Now Object finalizers will only try to re-attach the # 'R.oo' package if library() is currently attaching a package. This # can occur if a temporary Object is allocated in .onAttach(). # o Now warnings generated by the finalizer function returned by # .makeObjectFinalizer() is more informative on Package objects. # 2013-09-20 # o BUG FIX: The finalizer returned by .makeObjectFinalizer() assumed # that the 'utils' is attached while calling capture.output(), which # under certain conditions could generate 'Error in getObjectInfo(this) : # could not find function "capture.output"'. # 2013-01-08 # o ROBUSTNESS: Now .makeObjectFinalizer() returns a finalizer that is # reentrant, i.e. it will only try to reload R.oo on R versions where # library() is reentrant or when the garbage collector was not triggered # by base::parse(), otherwise it will not finalize the Object. # o CLEANUP: Added internal .makeObjectFinalizer(). ############################################################################ R.oo/R/dimension.default.R0000755000177400001440000000273212726216524015233 0ustar murdochusers###########################################################################/** # @RdocDefault dimension # # @title "Gets the dimension of the object" # # \description{ # Gets the dimension of the object similar to what \code{dim()} does, # but instead of @NULL it will return the length of a vector. # If a function is passed, @NULL is returned. # } # # @synopsis # # \arguments{ # \item{object}{The object for which the dimension should be obtained.} # \item{...}{Not used.} # } # # \value{ # Returns an @integer @vector or @NULL. # } # # \examples{ # dimension(matrix(1:100, ncol=10)) # 10 10 # dimension(1:14) # 14 # dimension(data.frame(a=1:10, b=10:1)) # 10 2 # dimension(print) # NULL # } # # @author # # \seealso{ # @see "ll.default". # @see "base::dim" and @see "base::length". # } # # @keyword attribute # @keyword utilities # @keyword internal #*/########################################################################### setMethodS3("dimension", "default", function(object, ...) { if (is.function(object)) return(NULL); size <- dim(object); if (is.null(size)) size <- length(object); as.integer(size); }) ############################################################################ # HISTORY: # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2002-10-17 # o Created to be used by ll(). ############################################################################ R.oo/R/extend.default.R0000755000177400001440000000364012726216524014534 0ustar murdochusers###########################################################################/** # @RdocDefault extend # # @title "Extends a object" # # \description{ # via a mechanism known as "parasitic inheritance". # Simply speaking this method "extends" the class of an object. What is actually # happening is that it creates an instance of class name \code{...className}, # by taking another object and add \code{...className} to the class # list and also add all the named values in @... as attributes. # # The method should be used by the constructor of a class and nowhere else. # } # # @synopsis # # \arguments{ # \item{this}{Object to be extended.} # \item{...className}{The name of new class.} # \item{...}{Attribute fields of the new class.} # } # # \value{ # Returns an object of class \code{...className}. # } # # @author # # @examples "../incl/extend.default.Rex" # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("extend", "default", function(this, ...className, ...) { # Add class '...className' to the class vector class(this) <- unique(c(...className, class(this))); # Add attributes args <- list(...); names <- names(args); for (kk in seq_along(args)) { name <- names[kk]; if (name == "class") throw("Trying to set class attribute: ", as.character(this)); arg <- args[[kk]]; attr(this, name) <- arg; } # Return modified object this; }, conflict="quiet") ###################################################################### # HISTORY: # 2006-02-09 # o Using 'conflict="quiet"' when creating extend.default() to avoid # the warning that the method already exists. One less warning. # 2005-06-14 # o This will generate a warning that "Method already existed and was # overwritten", but this is ok. # 2005-06-08 # o Created. ###################################################################### R.oo/R/Exception.R0000755000177400001440000004365412726216524013571 0ustar murdochusers###########################################################################/** # @RdocClass Exception # # \title{The Exception class to be thrown and caught} # # \description{ # @classhierarchy # # Creates an Exception that can be thrown and caught. The \code{Exception} # class is the root class of all other \code{Exception} classes. # } # # @synopsis # # \arguments{ # \item{...}{One or several strings, which will be concatenated and contain # informative message about the exception.} # \item{sep}{The string to used for concatenating several strings.} # \item{collapse}{The string to used collapse vectors together.} # } # # \section{Fields and Methods}{ # @allmethods # } # # @examples "../incl/Exception.Rex" # # @author # # \seealso{ # See also \code{\link[base:conditions]{tryCatch}()} (and @see "base::try"). # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setConstructorS3("Exception", function(..., sep="", collapse=", ") { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sys.functions <- function(parents) { functions <- list(); for (kk in seq_along(parents)) { parent <- parents[kk]; functions[[kk]] <- sys.function(which=kk); } functions; } # sys.functions() fcnPathname <- function(call) { res <- attr(call, "srcref"); if (is.null(res)) return(""); res <- attr(res, "srcfile"); res$filename; } # fcnPathname() fcnName <- function(call) { code <- deparse(call[1]); # code <- grep("^function\\(", code, value=TRUE); if (length(code) == 0) return(""); code <- code[1]; code <- gsub("\\(.*", "", code); code; } # fcnName() fcnBody <- function(fcn) { paste(deparse(fcn), collapse="\n"); } # fcnBody() # "Each [...] function evaluation has a tuple, # (call, function definition, evaluation environment), # coupled to it, which can be retrieved via sys.{call,function,frame}()." # Source: help("sys.parent", package="base") calls <- sys.calls(); parents <- sys.parents(); functions <- sys.functions(parents); stackTrace <- list(); for (kk in seq_along(calls)) { call <- calls[[kk]]; fcn <- functions[[kk]]; name <- fcnName(call); body <- fcnBody(fcn); envir <- environment(fcn); envirName <- environmentName(envir); pathname <- fcnPathname(call); trace <- list( call=call, name=name, body=body, envir=envirName, pathname=pathname ); stackTrace[[kk]] <- trace; } # for (kk ...) rm(list=c("calls", "parents", "functions")); # The new class is Exception, but for convenience it should also # derive from 'try-error', which is used by try() etc. extend(Object(), c("Exception", "simpleError", "error", "condition", "try-error"), .msg = paste(..., sep=sep, collapse=collapse), .when = Sys.time(), .stackTrace = stackTrace ) }) ###########################################################################/** # @RdocMethod as.character # # \title{Gets a character string representing of the Exception} # # \description{ # @get "title". # By default the format is: "[\{POSIX date string\}] \{class name\}: \{msg\}". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("as.character", "Exception", function(x, ...) { # To please R CMD check this <- x; paste("[", getWhen(this), "] ", class(this)[1], ": ", getMessage(this), sep=""); }) ###########################################################################/** # @RdocMethod print # # \title{Prints the Exception} # # \description{ # @get "title". By default the \code{as.character()} representation plus # the stack trace is printed. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{Returns nothing.} # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seemethod "as.character". # @seemethod "getStackTrace". # @seemethod "printStackTrace". # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("print", "Exception", function(x, ...) { cat(getStackTraceString(x, ...)); }) ###########################################################################/** # @RdocMethod getWhen # # \title{Gets the time when the Exception was created} # # \description{ # Gets the time, as a POSIX object, when the Exception was created. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a POSIX time object. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getWhen", "Exception", function(this, ...) { this$.when; }) ###########################################################################/** # @RdocMethod getMessage # # @title "Gets the message of the Exception" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getMessage", "Exception", function(this, ...) { this$.msg; }) ###########################################################################/** # @RdocMethod throw # # \title{Throws an Exception that can be caught} # # \description{ # Throws an Exception that can be caught by \code{tryCatch()}. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # See also \code{\link[base:conditions]{tryCatch}()}. # This method overrides (and is fully backward compatible with) the one # defined in the \pkg{R.methodsS3} package. # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("throw", "Exception", function(this, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Record this Exception # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Exception$.lastException <- this; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Signal the exception as a condition # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - signalCondition(this); # Question: Are there ways to catch the above signals, and then via # some revoking mechanism continue below?!? /HB 2012-03-05 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # If not caught by any handlers, output message containing the stack trace # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Output an error message containing the stacktrace msg <- getStackTraceString(this, ...); cat(msg, file=stderr()); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # ...and *abort* # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Alt 1: Abort the current evaluation, but unfortunately abort() # is not guaranteed to not be "caught", cf. help("abort"). # abort(); # Alt 2: An alternative is to call stop() again, which will resignal # a condition and then abort. The resignalled condition should not # really be caught by anything, because if so, it would have been # caught by the above signalling. This is based on the assumption # that it is not possible to continue after the above signal, # iff it is caught. /HB 2012-03-05 cond <- simpleCondition(getMessage(this)); class(cond) <- "condition"; stop(cond); }, overwrite=TRUE, conflict="quiet") ###########################################################################/** # @RdocMethod getLastException # # \title{Static method to get the last Exception thrown} # # \description{ # Static method to get the last Exception instanciated. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns an @see "Exception" object. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # \seealso{ # @seeclass # See also \code{\link[base:conditions]{tryCatch}()}. # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getLastException", "Exception", function(this, ...) { Exception$.lastException; }, static=TRUE); ###########################################################################/** # @RdocMethod getStackTrace # # \title{Gets the stack trace saved when the exception was created} # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @list containing the stack trace. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # \seealso{ # @seemethod "printStackTrace". # \code{\link[utils:debugger]{dump.frames}()}. # \code{\link[base:conditions]{tryCatch}()}. # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getStackTrace", "Exception", function(this, cleanup=getOption("R.oo::Exception/getStackTrace/args/cleanup", TRUE), ...) { stackTrace <- this$.stackTrace; names(stackTrace) <- seq_along(stackTrace); # Remove "uninformative" steps, e.g. tryCatch() if (cleanup) { # (a) Drop anything before doTryCatch() names <- sapply(stackTrace, FUN=function(x) x$name); idxs <- which(is.element(names, c("doTryCatch"))); if (length(idxs) > 0) { idx <- idxs[length(idxs)]; keep <- seq(from=idx+1L, to=length(stackTrace)); stackTrace <- stackTrace[keep]; } # (b) Drop anything after throw() names <- sapply(stackTrace, FUN=function(x) x$name); idxs <- which(is.element(names, "throw")); if (length(idxs) > 0) { idx <- idxs[1L]; keep <- seq_len(idx-1L); stackTrace <- stackTrace[keep]; } } stackTrace <- rev(stackTrace); stackTrace; }) ###########################################################################/** # @RdocMethod getCalls # @aliasmethod getCall # # \title{Gets the active calls saved when the exception was created} # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns an unnamed @list with @language elements. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # \seealso{ # @seemethod "getStackTrace". # \code{\link[utils:debugger]{sys.calls}()}. # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getCalls", "Exception", function(this, ...) { stackTrace <- getStackTrace(this, ...); calls <- lapply(stackTrace, FUN=function(x) x$call); calls; }) setMethodS3("getCall", "Exception", function(x, which=1L, ...) { # To please R CMD check (R >= 2.14.0) this <- x; calls <- getCalls(this, ...); if (length(calls) == 0) { return(NULL); } calls[[which]]; }) ###########################################################################/** # @RdocMethod getStackTraceString # # \title{Gets the stack trace as a string} # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \seealso{ # @seemethod "getStackTrace". # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getStackTraceString", "Exception", function(this, ..., details=TRUE) { head <- sprintf("%s\n", as.character(this)); stackTrace <- getStackTrace(this, ...); if (length(stackTrace) == 0) { return(head); } calls <- sapply(stackTrace, FUN=function(trace) trace$call); res <- character(length=length(calls)); for (kk in seq_along(calls)) { call <- calls[[kk]]; rows <- deparse(call); if (details) { prefix1 <- sprintf(" at #%02d. ", as.integer(names(calls)[kk])); } else { prefix1 <- " at "; } prefixT <- paste(rep(" ", times=nchar(prefix1)), collapse=""); prefix <- rep(prefixT, times=length(rows)); prefix[1] <- prefix1; rows <- sprintf("%s%s", prefix, rows); res[kk] <- paste(rows, collapse="\n"); } # for (kk ...) if (details) { locs <- sapply(stackTrace, FUN=function(trace) { name <- trace$name; envir <- trace$envir; s <- sprintf("%s()", name); if (envir == "") { s <- sprintf("%s is local of the calling function", s); } else { s <- sprintf("%s is in environment '%s'", s, envir); } s; }); res <- sprintf("%s\n - %s", res, locs); pathnames <- sapply(stackTrace, FUN=function(trace) { trace$pathname; }); pathnamesT <- sprintf("\n - originating from '%s'", pathnames); pathnamesT[nchar(pathnames) == 0] <- ""; res <- sprintf("%s%s", res, pathnamesT); res <- sprintf("%s\n", res); } # if (details) res <- paste(res, collapse="\n"); if (details) { res <- sprintf("%s\n%s\n", head, res); } else { res <- sprintf("%s%s\n", head, res); } res; }, private=TRUE) ###########################################################################/** # @RdocMethod printStackTrace # # \title{Prints the stack trace saved when the exception was created} # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # \seealso{ # @seemethod "getStackTrace". # \code{\link[base:conditions]{tryCatch}()}. # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("printStackTrace", "Exception", function(this, ...) { cat(getStackTraceString(this, ...)); }) ############################################################################ # HISTORY: # 2012-10-14 # o Now throw() for Exception outputs the error message both above and # below the stack trace, which is particularly useful when the stack # trace is long. # 2012-09-14 # o ROBUSTNESS/BUG FIX: The Exception constructor could generate warning # 'In if (regexpr("^function\\(", code) != -1) return("") : the # condition has length > 1 and only the first element will be used' # occuring in its local fcnName() function. Now code no longer assumes # that 'code' is of length 1. # 2012-09-10 # o Updated throw() for Exception to "abort" after signalling the condition # by calling stop() with an empty condition. This is not perfect, # because it outputs an "Error:" message at the end, but it's better # than nothing. # 2012-06-17 # o BUG FIX/GENERALIZATION: throw() for Exception would give an error on # R < 2.14.0, where no generic getCall() exists. Now it works for # all versions of R. # 2012-03-18 # o Now it is possible to set the default value of argument 'cleanup' # of getStackTrace() for Exception via an option. # 2012-03-08 # o Now throw() for Exception utilizes abort(). # o Now Exception stores much more information about the stacktrace. # 2012-03-07 # o Added getCalls() and getCall() for Exception. Now Exception() # records the active calls, i.e. sys.calls(). getCalls() takes care # of the "cleanup" and "parsing". # 2012-02-29 # o Now throw() of Exception utilizes new abort(). # o CLEANUP: Restructured the code of throw() for Exception. # 2011-07-10 # o Changed first argument of getCall() to 'x', because that is what # the new getCall() method of 'stats' in R v2.14.0 uses. # 2005-02-20 # o Updated broken link to tryCatch(). # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2005-02-10 # o Moved showAndWait() from Exception to simpleError. # 2004-10-18 # o Added more Rdoc comments. # 2004-03-02 # o The Exception class now inherits from the simpleError, error and # condition classes. # o The throw() method of Exception does now make use of the new (R v1.8.0) # signalCondition() method. # 2003-12-16 # o Now throw() includes the complete stacktrace when generating an internal # error signal. # 2003-04-13 # o Wrote Rdoc comments that were missing and updated some others. # 2003-03-23 # o Added showAndAsk(), which will, if tcltk is installed, display a dialog # box with the error message. If tcltk is not installed, The message will # be printed on the command line and a prompt requesting the user to press # enter will be shown. showAndAsk() will give an error if run in a non- # interactive mode. # 2003-01-19 # o Added stacktrace information to *each* Exception object. This is created # when the object is created. # 2003-01-18 # o Replaced all occurences of getClass() with data.class(). Will change # the use of getClass() in the future to return a Class object. # 2002-10-17 # o Made getLastException() a static method of Exception. # o Created from previous ideas in R.oo. ############################################################################ R.oo/R/hashCode.R0000755000177400001440000000512012726216524013333 0ustar murdochusers###########################################################################/** # @RdocDefault hashCode # # @title "Gets an integer hashcoded for R objects" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{object}{A @vector or @list of \R objects.} # \item{...}{Not used.} # } # # \value{ # Returns a @vector of @integer's. # } # # \details{ # A @character string is converted into a hashcode following Java # conventions by # \code{s[1]*31^(n-1) + s[2]*31^(n-2) + ... + s[n]} # using integer arithmetic, where \code{s[i]} is the \code{i}:th character # of the string, \code{n} is the length of the string. The hash value of # the empty string is zero. # # For all other objects, by default \code{as.integer()} is called. # } # # @author # # @keyword programming # @keyword methods # @keyword internal #*/########################################################################### setMethodS3("hashCode", "default", function(object, ...) { asInt.Java <- function(x) { Integer.MIN.VALUE <- -2147483648; Integer.MAX.VALUE <- 2147483647; Integer.RANGE <- Integer.MAX.VALUE-Integer.MIN.VALUE + 1; x <- (x-Integer.MIN.VALUE) %% Integer.RANGE + Integer.MIN.VALUE; as.integer(x); } hashCode <- c(); for (obj in object) { if (is.character(obj)) { # The hashcode for a character string is computed as # # s[1]*31^(n-1) + s[2]*31^(n-2) + ... + s[n] # # using int arithmetic, where s[i] is the i:th character of the # string, n is the length of the string. The hash value of the # empty string is zero. s <- obj; n <- nchar(s); if (n == 0) { hashCode <- c(hashCode, as.integer(0)); } else { s <- unlist(strsplit(as.character(s), NULL)); s <- charToInt(s); hashC <- 0; for (k in 1:n) hashC <- hashC + s[k]*31^(n-k); # Convert into range of Java int. hashCode <- c(hashCode, asInt.Java(hashC)); } } else { hashCode <- c(hashCode, as.integer(obj)); } } hashCode; }) # hashCode.default() ############################################################################ # HISTORY: # 2013-08-23 # o CLEANUP: Hiding hashCode() from help indices. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2003-10-18 # o Added Rdoc comments. # 2002-10-15 # o Currently character string are treated specially and all other objects # are just returned using as.integer(). # o Extracted the code from old String.R in R.oo. ############################################################################ R.oo/R/999.DEPRECATED.R0000644000177400001440000000730312726216524013550 0ustar murdochusers## covr: skip=all ###########################################################################/** # @set class=Object # @RdocMethod gc # # @title "Clear cached fields and calls the garbage collector" # # \description{ # @get "title". Cached fields are set to @NULL when cleared. # # \emph{This method is deprecated. # Please use \code{clearCache(..., gc=TRUE)} instead.} # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @examples "../incl/gc.Object.Rex" # # @author # # \seealso{ # To clear the fields without calling the garbage collector, # see @seemethod "clearCache". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("gc", "Object", function(this, ...) { .Deprecated(msg="Use clearCache(..., gc=TRUE) instead."); clearCache(this, gc=TRUE); }, deprecated=TRUE) ###########################################################################/** # @set class=Object # @RdocMethod registerFinalizer # # @title "Registers a finalizer hook for the object [DEFUNCT]" # # \description{ # @get "title". # The finalizer hook calls @seemethod "finalize" on the @see Object when # it is garbage collected. # This method is only intended to be called inside the constructor, if # at all. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # @author # # \seealso{ # Internally, @see "base::reg.finalizer" is used. # @seeclass # } # # @keyword programming # @keyword methods # @keyword internal #*/########################################################################### setMethodS3("registerFinalizer", "Object", function(this, ...) { .Defunct("registerFinalizer() for Object is deprecated."); }, protected=TRUE, deprecated=TRUE) # registerFinalizer() #########################################################################/** # @set class=Package # @RdocMethod update # # @title "Updates the package is a newer version is available" # # \description{ # \emph{This method is defunct. Use @see "utils::update.packages" instead.} # } # # @synopsis # # \arguments{ # \item{contribUrl}{The URL from where the package can be installed and # updated. By default the URL according to the DESCRIPTION is assumed. # If the URL is missing, CRAN is assumed.} # \item{force}{If @TRUE, the package will reinstalled even if it is # up to date according to the version number.} # \item{verbose}{If @TRUE, more detailed information is returned.} # \item{...}{Not used.} # } # # \value{ # Returns (invisibly) @TRUE if the package was updated, otherwise @FALSE. # } # # @author # # \seealso{ # @see "utils::update.packages". # @seeclass # } # # @keyword internal #*/######################################################################### setMethodS3("update", "Package", function(object, contribUrl=c(getContribUrl(object), getDevelUrl(object)), force=FALSE, reload=TRUE, verbose=TRUE, ...) { .Defunct(msg=sprintf("update() for Package is defunct. Use update.packages(\"%s\") instead."), getName(object)); }, protected=TRUE, deprecated=TRUE) ############################################################################ # HISTORY: # 2015-01-05 # o CLEANUP: Defunct update() for Package. # 2013-09-25 # o CLEANUP: Deprecated update() for Package. # 2014-02-22 # o DEPRECATED: Deprecated gc() for Object. Use clearCache(..., gc=TRUE) # instead. # 2014-01-05 # o CLEANUP: Defunct registerFinalizer() for Object. # o Created. ############################################################################ R.oo/R/getConstructorS3.R0000644000177400001440000000220712726216524015050 0ustar murdochusers###########################################################################/** # @RdocDefault getConstructorS3 # # @title "Get a constructor method" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{name}{The name of the constructor function.} # \item{...}{Not used.} # } # # \seealso{ # @see "setConstructorS3". # @see "R.methodsS3::getMethodS3". # @see "R.methodsS3::isGenericS3". # } # # @author # # @keyword "programming" # @keyword "methods" #*/########################################################################### setMethodS3("getConstructorS3", "default", function(name, ...) { # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (!exists(name, mode="function")) { throw("No such function found: ", name); } fcn <- get(name, mode="function"); if (isGenericS3(fcn)) { throw("The function found is an S3 generic function: ", name); } fcn; }) ############################################################################ # HISTORY: # 2008-05-08 # o Added getConstructorS3(). ############################################################################ R.oo/R/060.Class.R0000755000177400001440000013446012763175003013175 0ustar murdochusers###########################################################################/** # @RdocClass Class # # @title "The Class class describes an Object class" # # \description{ # @classhierarchy # # @get "title". # First of all, this class is most commonly used \emph{internally} and # neither the end user nor the programmer need to no about the class Class. # } # # @synopsis # # \arguments{ # \item{name}{Name of the class.} # \item{constructor}{Constructor (@function) of any Object class.} # } # # \section{Fields and Methods}{ # @allmethods # } # # \details{ # The class Class describes the Object class or one of its subclasses. # All classes and constructors created by \code{setConstructorS3()} will # be of class Class. Its methods provide ways of accessing static fields # and static methods. Its \emph{print()} method will print detailed # information about the class and its fields and methods. # } # # @author # # @keyword programming # @keyword methods #*/########################################################################### setConstructorS3("Class", Class) # Class() ###########################################################################/** # @RdocMethod as.character # # @title "Returns a short string describing the class" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{ # print(as.character(Object)) # # # gives: "Class Object: no fields, 8 methods (no inherited)" # } # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("as.character", "Class", function(x, ...) { # To please R CMD check this <- x; if (is.null(getStaticInstance(this))) return(as.character.Object(this)); fields <- getFields(this); nbrOfFields <- length(fields); methods <- getMethods(this, unique=TRUE); count <- unlist(lapply(methods, FUN=length)); names(count) <- names(methods); nbrOfMethods <- sum(count); count <- count[-1L]; s <- paste(class(this)[1L], " ", getName(this), " has ", nbrOfFields, " field" , if (nbrOfFields != 1L) "s", " and ", nbrOfMethods, " method", if (nbrOfMethods != 1L) "s", sep=""); if (length(count) > 0L) { isAre <- c("is", "are")[1L + (count != 1L)]; isAre[1L] <- paste(isAre[1L], "implemented in"); isAre[-1L] <- "in"; s <- paste(sep="", s, " of which ", paste(paste(count, isAre, names(count)), collapse=", "), "."); } else { s <- paste(s, ".", sep=""); } s; }) # as.character() ###########################################################################/** # @RdocMethod print # # @title "Prints detailed information about the class and its fields and methods" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Arguments passed to @seemethod "getDetails".} # } # # \value{ # Returns nothing. # } # # \examples{ # print(Object) # } # # @author # # \seealso{ # @seemethod "getDetails" # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("print", "Class", function(x, ...) { cat(getDetails(x, ...)); }) # print() ###########################################################################/** # @RdocMethod getName # # @title "Gets the name of the class" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{ # print(getName(Object)) # "Object" # print(getName(Class)) # "Class" # } # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getName", "Class", function(this, ...) { static <- getStaticInstance(this); class(static)[1L]; }) # getName() ###########################################################################/** # @RdocMethod getSuperclasses # # @title "Gets the super classes of this class" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @vector of @character strings. # } # # \examples{ # print(getSuperclasses(RccViolationException)) # \dontrun{ # returns # [1] "Exception" "try-error" "Object" # } # } # # @author # # \seealso{ # @see "base::class". # @seemethod "getKnownSubclasses". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getSuperclasses", "Class", function(this, ...) { class(getStaticInstance(this))[-1L]; }) # getSuperclasses() ###########################################################################/** # @RdocMethod getKnownSubclasses # # @title "Gets all subclasses that are currently loaded" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @vector of @character strings. # } # # \examples{ # \dontrun{ # # Due to a bug in R CMD check (R v1.7.1) the MicroarrayData$read() call # # below will call getKnownSubclasses(), which will generate # # "Error in exists(objectName, mode = "function") : # # [2003-07-07 23:32:41] Exception: F used instead of FALSE" # # Note that the example still work, just not in R CMD check # # print(getKnownSubclasses(Exception)) # } # \dontrun{ # returns # [1] "Exception" "try-error" "Object" # } # } # # @author # # \seealso{ # @seemethod "getSuperclasses". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getKnownSubclasses", "Class", function(this, sort=TRUE, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getKnownSubclassesInEnvironment <- function(name, envir, ...) { # Get all objects objectNames <- ls(envir=envir); # Exclude itself (to avoid recursive calls) objectNames <- setdiff(objectNames, name); # Nothing to do? if (length(objectNames) == 0L) return(NULL); # Keep only functions that are Class objects keep <- suppressWarnings({ sapply(objectNames, FUN=function(objectName) { expr <- substitute({ tryCatch({ is.function(x) && inherits(x, "Class") }, error=function(ex) FALSE) }, list(x=as.name(objectName))) eval(expr, envir=envir) }) }) objectNames <- objectNames[keep]; # Nothing to do? if (length(objectNames) == 0L) return(NULL); classes <- NULL; for (objectName in objectNames) { clazz <- get(objectName, mode="function", envir=envir, inherits=FALSE); # Get all its super classes... extends <- getSuperclasses(clazz); # Does it extend this class? if (is.element(name, extends)) { classes <- c(classes, getName(clazz)); } } # for (objectName ...) classes; } # getKnownSubclassesInEnvironment() name <- getName(this); classes <- c(); ## # (a) Search loaded namespaces ## for (ns in loadedNamespaces()) { ## envir <- getNamespace(ns); ## classesT <- getKnownSubclassesInEnvironment(name, envir=envir); ## classes <- c(classes, classesT); ## } # (a) Search attached search paths for (pos in seq_along(search())) { envir <- as.environment(pos); classesT <- getKnownSubclassesInEnvironment(name, envir=envir); classes <- c(classes, classesT); } # Drop duplicates classes <- unique(classes); if (sort && length(classes) > 1L) classes <- sort(classes); classes; }) ###########################################################################/** # @RdocMethod newInstance # # @title "Creates a new instance of this class" # # \description{ # @get "title". # Important: It should always be possible to create a new Object by # calling the constructor without arguments. # This method is simply calling the constructor method of the class. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a reference to an @see "Object". # } # # \examples{ # obj <- newInstance(Object, NA) # # # equivalent to # # obj <- Object(NA) # } # # @author # # \seealso{ # @see "newInstance.Object". # @see "newInstance.BasicObject". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("newInstance", "Class", function(this, ...) { this(...); }) # newInstance() ###########################################################################/** # @RdocMethod isAbstract # # @title "Checks if a class is abstract or not" # # \description{ # @get "title". A class is abstract if it has abstract methods. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the class is abstract, otherwise @FALSE. # } # # \examples{ # if (isAbstract(RccViolationException)) # throw("The class RccViolationException should NOT be abstract.") # } # # @author # # \seealso{ # @see "base::class". # @see "setConstructorS3". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("isAbstract", "Class", function(this, ...) { methods <- getMethods(this); methods <- unlist(methods); methods <- methods[nchar(methods) > 0L]; for (method in methods) { mtd <- .getS3Method(method, envir=environment(this)); if (is.element("abstract", attr(mtd, "modifiers"))) return(TRUE); } FALSE; }) ###########################################################################/** # @RdocMethod isStatic # # @title "Checks if a class is static or not" # # \description{ # @get "title". A class is static if it has static methods. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the class is static, otherwise @FALSE. # } # # \examples{ # if (!isStatic(RccViolationException)) # throw("RccViolationException should be static because Exception is.") # } # # @author # # \seealso{ # @see "setConstructorS3". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("isStatic", "Class", function(this, ...) { methods <- getMethods(this); methods <- unlist(methods); methods <- methods[nchar(methods) > 0L]; for (method in methods) { mtd <- .getS3Method(method, envir=environment(this)); if (is.element("static", attr(mtd, "modifiers"))) return(TRUE); } FALSE; }) ###########################################################################/** # @RdocMethod isPrivate # # @title "Checks if a class is defined private or not" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the class is private, otherwise @FALSE. # } # # \examples{ # if (isPrivate(RccViolationException)) # throw("The class RccViolationException should NOT be private.") # } # # @author # # \seealso{ # @see "base::class". # @see "setConstructorS3". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("isPrivate", "Class", function(this, ...) { is.element("private", attr(this, "modifiers")); }) ###########################################################################/** # @RdocMethod isProtected # # @title "Checks if a class is defined protected or not" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the class is protected, otherwise @FALSE. # } # # \examples{ # if (isProtected(RccViolationException)) # throw("The class RccViolationException should NOT be protected.") # } # # @author # # \seealso{ # @see "base::class". # @see "setConstructorS3". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("isProtected", "Class", function(this, ...) { is.element("protected", attr(this, "modifiers")); }) ###########################################################################/** # @RdocMethod isPublic # # @title "Checks if a class is defined public or not" # # \description{ # @get "title". A class is public if it is neither private nor protected. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the class is public, otherwise @FALSE. # } # # \examples{ # if (!isPublic(RccViolationException)) # throw("The class RccViolationException should be public.") # } # # @author # # \seealso{ # @see "base::class". # @see "setConstructorS3". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("isPublic", "Class", function(this, ...) { !isPrivate(this) && !isProtected(this); }) ###########################################################################/** # @RdocMethod isDeprecated # # @title "Checks if a class is deprecated or not" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the class is deprecated, otherwise @FALSE. # } # # @author # # \seealso{ # @see "base::class". # @see "setConstructorS3". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("isDeprecated", "Class", function(this, ...) { is.element("deprecated", attr(this, "modifiers")); }) ###########################################################################/** # @RdocMethod forName # # @title "Gets a Class object by a name of a class" # # \description{ # @get "title". If no such class exists and exception is thrown. # } # # @synopsis # # \arguments{ # \item{...}{Optional arguments passed to internal lookup function.} # } # # \value{ # Returns a @see "Class". # } # # \examples{ # print(Class$forName("Exception")) # } # # @author # # \seealso{ # @see "base::class". # @see "setConstructorS3". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("forName", "Class", function(static, name, ...) { .getClassByName(name, ..., mustExist=TRUE); }, static=TRUE) # forName() ###########################################################################/** # @RdocMethod getPackage # # @title "Gets the package to which the class belongs" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @see "Package". # } # # \examples{ # print(getPackage(Object)) # } # # @author # # \seealso{ # @see "Package". # @see "base::class". # @see "setConstructorS3". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getPackage", "Class", function(this, ...) { name <- getName(this); pkgName <- NULL; # (a) Search name spaces envirLast <- NULL; envir <- environment(this); while (!identical(envir, globalenv()) && !identical(envir, envirLast)) { envirLast <- envir; if (exists(name, mode="function", envir=envir, inherits=FALSE)) { res <- get(name, mode="function", envir=envir, inherits=FALSE); if (inherits(res, "Class")) { pkgName <- environmentName(envir); pkgName <- gsub("^package:", "", pkgName); return(pkgName); } } # Next envir <- parent.env(envir); } # while (...) # (b) Search attached ("loaded") packages packages <- search(); for (pos in seq_along(packages)) { envir <- pos.to.env(pos); if (exists(name, mode="function", envir=envir, inherits=FALSE)) { res <- get(name, mode="function", envir=envir, inherits=FALSE); if (inherits(res, "Class")) { pkgName <- environmentName(envir); pkgName <- gsub("^package:", "", pkgName); return(pkgName); } } } # for (pos ...) NULL; }) ###########################################################################/** # @RdocMethod getStaticInstance # # @title "Gets the static instance of this class" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a reference to an @see "Object". # } # # \examples{ # obj <- getStaticInstance(Object) # } # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getStaticInstance", "Class", function(this, ...) { # First, make sure you have a reference to the actual Class object. if (!is.function(this)) { this <- .getClassByName(class(this)[1L], envir=environment(this)); } # If the static instance of this class is missing create one. envir <- attr(this, ".env"); static <- get(".staticInstance", envir=envir); if (is.null(static)) { if (!exists(".isCreatingStaticInstance", envir=envir, inherits=FALSE)) { assign(".isCreatingStaticInstance", TRUE, envir=envir, inherits=FALSE); on.exit({ rm(list=".isCreatingStaticInstance", envir=envir); }, add=TRUE); constructor <- this; static <- constructor(); # Set the environment of the static instance to be the same # as the constructor function, i.e. the Class. environment(static) <- environment(this); assign(".staticInstance", static, envir=envir); } else { # Otherwise, just create a dummy instance in case any code is trying # to access it. static <- Object(); # Set the environment of the static instance to be the same # as the constructor function, i.e. the Class. environment(static) <- environment(this); } } else { # BACKWARD PATCH: In case an old static object has been loaded # then it may not have the proper environment set. environment(static) <- environment(this); } static; }) # getStaticInstance() ###########################################################################/** # @RdocMethod isBeingCreated # # @title "Checks if a class is currently being initiated initiated" # # \description{ # @get "title". # When extending a class for the first time, which is # typically done in a constructor, a static instance of the class is # created by calling the constructor without parameters. # This method provides a way to detect that second call inside the # constructor. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if a static instance exists, otherwise @FALSE. # } # # @examples "../incl/isBeingCreated.Class.Rex" # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("isBeingCreated", "Class", function(this, ...) { # First, make sure you have a reference to the actual Class object. if (!is.function(this)) { this <- get(class(this)[1L], mode="function") if (!inherits(this, "Class")) throw("Not a Class object: ", class(this)[1L]); } # If the static instance of this class is missing create one. envir <- attr(this, ".env"); staticInstance <- get(".staticInstance", envir=envir); if (!is.null(staticInstance)) return(FALSE); if (!exists(".isCreatingStaticInstance", envir=envir, inherits=FALSE)) return(FALSE); get(".isCreatingStaticInstance", envir=envir, inherits=FALSE); }) ###########################################################################/** # @RdocMethod getFields # # @title "Returns the field names of a class" # # \description{ # @get "title". # } # # \arguments{ # \item{private}{If @TRUE, private fields will also be returned, # otherwise only public fields are returned.} # \item{...}{Not used.} # } # # @synopsis # # \value{ # Returns a @character @vector of field names. # } # # \examples{ # print(getFields(Exception)) # } # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getFields", "Class", function(this, private=FALSE, ...) { static <- getStaticInstance(this); if (inherits(static, "Class")) { # Do not do a recursive call! class(static) <- setdiff(class(static), "Class") } getFields(static, private=private); }) # getFields() ###########################################################################/** # @RdocMethod getMethods # # @title "Returns the method names of class and its super classes" # # \description{ # @get "title" as a list. # } # # @synopsis # # \arguments{ # \item{private}{If @TRUE, private methods are also returned, # otherwise only public ones are returned.} # \item{deprecated}{If @TRUE, deprecated methods are also returned.} # \item{unqiue}{If @TRUE, only methods that are not implemented # in one of the subclasses are returned for each class.} # \item{...}{Not used.} # } # # \value{ # Returns a named @list of named @character strings. # } # # \examples{ # names <- getMethods(Exception) # print(names) # } # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getMethods", "Class", function(this, private=FALSE, deprecated=TRUE, unique=TRUE, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - findS3MethodsByEnvironment <- function(classNames, envir, exclMods=NULL, res=list()) { # Get all objects names <- ls(envir=envir, all.names=private); # 1. Keep only names with a . (period), because the others cannot # be methods of an S3 class. names <- grep("\\.", names, value=TRUE); # 2. For each class find the methods belong to that class. for (className in classNames) { pattern <- paste("\\.", className, "$", sep=""); namesT <- grep(pattern, names, value=TRUE); # Nothing todo? if (length(namesT) == 0L) next; # For all methods identified, see which are functions isFunction <- sapply(namesT, FUN=exists, mode="function", envir=envir); isFunction <- unlist(isFunction, use.names=FALSE); namesT <- namesT[isFunction]; names(namesT) <- gsub(pattern, "", namesT); # Nothing todo? if (length(namesT) == 0L) next; # Keep only non-private methods? if (!is.null(exclMods)) { keep <- sapply(namesT, FUN=function(name) { fcn <- get(name, mode="function", envir=envir); modifiers <- attr(fcn, "modifiers"); !any(is.element(exclMods, modifiers)); }); namesT <- namesT[keep]; } # Nothing todo? if (length(namesT) == 0L) next; namesT <- c(res[[className]], namesT); # Drop duplicates dups <- duplicated(namesT); namesT <- namesT[!dups]; res[[className]] <- namesT; } # for (className) res; } # findS3MethodsByEnvironment() findS3Methods <- function(classNames, where=c("ns", "search")[-1L], envir=NULL, exclMods=NULL) { res <- list(); # Nothing todo? if (length(classNames) == 0L) return(res); if (!is.null(envir)) { res <- findS3MethodsByEnvironment(classNames, envir=envir, exclMods=exclMods, res=res); } ## # (a) Search loaded namespaces ## if (is.element("ns", where)) { ## for (ns in loadedNamespaces()) { ## envir <- getNamespace(ns); ## res <- findS3MethodsByEnvironment(classNames, envir=envir, exclMods=exclMods, res=res); ## } ## } # (a) Search attached search paths if (is.element("search", where)) { for (pos in seq_along(search())) { envir <- as.environment(pos); res <- findS3MethodsByEnvironment(classNames, envir=envir, exclMods=exclMods, res=res); } } res; } # findS3Methods() # Argument 'private': private <- as.logical(private); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Find all related S3 classes # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Exclude methods with certain modifiers? exclMods <- NULL; if (!private) { exclMods <- c(exclMods, "private"); } if (!deprecated) { exclMods <- c(exclMods, "deprecated"); } # Scan for such methods static <- getStaticInstance(this); classNames <- class(static); envir <- environment(static); result <- findS3Methods(classNames, envir=envir, exclMods=exclMods); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Cleanup # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Keep only unique method names, regardless of Class? nClasses <- length(result); if (unique && nClasses >= 2L) { names <- lapply(result, FUN=names); for (kk in seq_len(nClasses-1L)) { # Nothing todo? if (length(names[[kk]]) == 0L) next; for (ll in (kk+1L):nClasses) { # Nothing todo? if (length(names[[ll]]) == 0L) next; uniqueNames <- setdiff(names[[ll]], names[[kk]]); unique <- match(uniqueNames, names[[ll]]); result[[ll]] <- result[[ll]][unique]; names[[ll]] <- names[[ll]][unique]; } # for (ll ...) } # for (kk ...) } } # if (unique) # Remove classes with no methods if (nClasses > 0L) { result <- result[sapply(result, FUN=function(x) (length(x) > 0L))]; } result; }, protected=TRUE, dontWarn="base") # getMethods() ###########################################################################/** # @RdocMethod argsToString # # @title "Gets the arguments of a function as a character string" # # \description{ # Gets the arguments (with default values) of a function as a character # string, which can be used for debugging purposes etc. # Used by: classinfo(). # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{ # Class$argsToString(plot); # } # # \seealso{ # @seeclass # } # # @author # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("argsToString", "Class", function(this, fcn, ...) { a <- args(fcn); if (is.null(a)) return("[primitive function]"); if (typeof(a) != "closure") throw("Expected closure but found something else."); args <- formals(a); argsNames <- names(args); res <- list(); for (kk in seq_along(args)) { arg <- args[kk]; argName <- argsNames[kk]; s <- argName; argDefault <- arg[[1L]]; if (!missing(argDefault)) { if (is.character(argDefault)) { s <- paste(s, "=", "\"", argDefault, "\"", sep="", collapse=""); } else if (is.null(argDefault)) { s <- paste(s, "=NULL", sep="", collapse=""); } else if (is.language(argDefault)) { argDefault <- as.character(arg[1L]); s <- paste(s, "=", argDefault, sep="", collapse=""); } else { s <- paste(s, "=", argDefault, sep="", collapse=""); } } res <- c(res, list(s)); } res; }, private=TRUE, static=TRUE) # argsToString ###########################################################################/** # @RdocMethod getDetails # # @title "Lists the fields and methods of a class" # # \description{ # @get "title" (or an object). # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns an invisible @character string of the class information. # } # # \examples{ # getDetails(Exception) # } # # @author # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getDetails", "Class", function(this, private=FALSE, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # The class name # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class <- getName(this); s <- class; # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # The super classes # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - superclasses <- getSuperclasses(this); if (length(superclasses) > 0L) { s <- paste(s, " extends ", paste(superclasses, collapse=", "), " {", sep=""); } s <- paste(s, "\n", sep=""); indent <- 2L; indentStr <- paste(rep(" ", length.out=indent), collapse=""); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # The fields # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fields <- getFields(this, private=private); if (length(fields) > 0L) { modifiers <- rep("public", length.out=length(fields)); isPrivate <- (regexpr("^\\.", fields) != -1L); modifiers[isPrivate] <- "private"; for (kk in seq_along(fields)) { s <- paste(s, indentStr, modifiers[kk], " ", fields[kk], "\n", sep=""); } } ## formalsToString <- function(methodName, isConstructor=FALSE) { ## args <- argsToString(Class, method, argOffset); ## s <- paste(sep="", s, methodName, "(", args, ")\n"); ## } ## formalsToString(...) methodsPerClass <- getMethods(this, private=private); if (length(methodsPerClass) > 0L) { envir <- environment(this); for (methods in methodsPerClass) { if (length(methods) > 0L) { methodNames <- names(methods); modifiers <- rep("public", length.out=length(methodNames)); isPrivate <- (regexpr("^\\.", methodNames) != -1L); modifiers[isPrivate] <- "private"; for (kk in seq_along(methodNames)) { fcn <- .getS3Method(methods[kk], envir=envir, mustExist=TRUE); fcnModifiers <- attr(fcn, "modifiers"); if (is.element("protected", fcnModifiers)) { modifiers[kk] <- "protected"; } else if (is.element("private", fcnModifiers)) { modifiers[kk] <- "private"; } if (is.element("public", fcnModifiers) || private == TRUE) { if (is.element("abstract", fcnModifiers)) modifiers[kk] <- paste(modifiers[kk], " ", "abstract", sep=""); if (is.element("static", fcnModifiers)) modifiers[kk] <- paste(modifiers[kk], " ", "static", sep=""); s <- paste(s, indentStr, modifiers[kk], " ", methodNames[kk], "(", sep=""); args <- paste(argsToString(Class, fcn)[-1L], collapse=", "); s <- paste(s, args, ")\n", sep=""); } } } } } s <- paste(s, "}\n", sep=""); invisible(s); }, private=TRUE); # getDetails() ###########################################################################/** # @RdocMethod $ # @aliasmethod [[ # # @title "Makes the fields and methods of an Class accessable via the \$ and the [[ operator" # # \usage{ # \method{$}{Class}(this, name) # \method{[[}{Class}(this, name, exact=TRUE) # } # # \description{ # Makes the fields and methods of an Class accessable via the \code{$} # operator. This method is never called explicitly, but through an indirect # usage of the \code{$} operator, e.g. \code{obj$name} or # \code{obj$getValue()}. # # \enumerate{ # \item This method will first search for a \code{get()} method, # e.g. if name has the value \code{"age"}, a \code{getAge()} will be # looked for. If such a method exists it will be called with the Class # as the first and only argument, e.g. \code{getAge(this)}. # A \code{get()} is only looked for if \code{} is not a # private field. A private field is a name \emph{beginning} with a # \code{.} (period). The rational for this naming convention is to be # consistent with how \code{\link[base]{ls}()} works, which will not list # such members by default. # # \item If no such method exists, first then, this method will look a # field in the Class can has the name \code{name}. # # \item If such neither exists, a method with name \code{name} will be # searched for and returned. # # \item If no fields or methods are found at all, @NULL is returned. # } # } # # \arguments{ # \item{name}{The name of the field or method to be accessed.} # \item{...}{Not used.} # } # # \value{ # Returns the value of a field or a method (@function). # If no such field or method exists, @NULL is returned. # } # # \examples{\dontrun{For a complete example see help(Class).}} # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("$", "Class", function(this, name) { .subset2Internal(this, name=name, exact=TRUE) }) setMethodS3("[[", "Class", function(this, name, exact=TRUE) { .subset2Internal(this, name=name, exact=exact) }) setMethodS3(".subset2Internal", "Class", function(this, name, exact=TRUE, ...) { if (is.function(this)) { static <- getStaticInstance(this) } else { static <- this; } firstChar <- substr(name, start=1L, stop=1L); isPrivate <- identical(firstChar, "."); # Do not try to access private fields using a get() method, # because such a functionality means that the user *expects* that # there actually is a field called '.', which he or she # should not do since it is a private field! if (!isPrivate && is.null(attr(static, "disableGetMethods"))) { # 1. Is it a get() method? capitalizedName <- name; substr(capitalizedName, start=1L, stop=1L) <- toupper(firstChar); getMethodNames <- paste("get", capitalizedName, ".", class(static), sep=""); envir <- environment(static); for (getMethodName in getMethodNames) { fcn <- .getS3Method(getMethodName, envir=envir, mustExist=FALSE); if (!is.null(fcn)) { ref <- static; attr(ref, "disableGetMethods") <- TRUE; return(fcn(ref)); } } } # 2. Is it a field? envir <- attr(static, ".env"); # For static method calls, e.g. Class$load, 'static' has no # environment assigned and therefore, for now, no static # fields. if (!is.null(envir) && exists(name, envir=envir, inherits=FALSE)) { return(get(name, envir=envir, inherits=FALSE)); } # 3. Is it an attribute field (slot)? if (is.element(name, names(attributes(static)))) { return(attr(static, name)); } # 4. Is it a static S3 method? envir <- environment(static); methodNames <- paste(name, class(static), sep="."); for (methodName in methodNames) { mtd <- .getS3Method(methodName, envir=envir, mustExist=FALSE); if (!is.null(mtd)) { # Using explicit UseMethod() code code <- sprintf("function(...) \"%s\"(static, ...)", name); expr <- base::parse(text=code); fcn <- eval(expr); # Set the environment of the static function to inherit from the # environment of the static instance/object, which in turn is the # same as the environment of the Class/constructor. envT <- environment(static); # BACKWARD COMPATIBILTY/ROBUSTNESS: In case an old static object # has been loaded, make sure to not crash, i.e. behave as before. if (!is.null(envT)) { env <- new.env(parent=envT); env$static <- static; environment(fcn) <- env; } return(fcn); } } NULL; }, private=TRUE) # .subset2Internal() ###########################################################################/** # @RdocMethod $<- # @aliasmethod [[<- # # @title "Makes the fields and methods of an Class assignable via the \$<- and the [[<- operator" # # \usage{ # \method{$}{Class}(this, name) <- value # \method{[[}{Class}(this, name) <- value # } # # \description{ # Makes the fields and methods of an Class assignable via the \code{$<-} # operator. This method is never called explicitly, but through an indirect # usage of the \code{$<-} operator, e.g. \code{obj$name <- "foo"}. # # \enumerate{ # \item This method will first search for a \preformatted{set()} # method, e.g. if name has the value \code{"age"}, a \code{setAge()} will # be looked for. If such a method exists it will be called with the Class # as the first argument and \code{value} as the second, e.g. # \code{setAge(this, value)}. # A \code{get()} is only looked for if \code{} is not a # private field. A private field is a name \emph{beginning} with a # \code{.} (period). The rational for this naming convention is to be # consistent with how \code{\link[base]{ls}()} works, which will not # list such members by default. # # \item If no such method exists it will assign the \code{value} to a # (existing or a non-existing) field named \code{name}. # } # # Because any \preformatted{set()} is called first, it is possible # to \emph{encapsulate} (hide away) fields with certain names or to put # restrictions to what values can be assigned to them. # } # # \arguments{ # \item{name}{The name of the \preformatted{set()} method or the # name of the field to be assigned the new value.} # \item{value}{The value to be assigned.} # \item{...}{Not used.} # } # # \value{ # Returns itself, i.e. \code{this}, as all \code{$<-} methods must do. # } # # \examples{\dontrun{For a complete example see help(Class).}} # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("$<-", "Class", function(this, name, value) { if (is.function(this)) static <- getStaticInstance(this) else static <- this; firstChar <- substr(name, start=1L, stop=1L); isPrivate <- identical(firstChar, "."); # Do not try to access private fields using a set() method, # because such a functionality means that the user *expects* that # there actually is a field called '.', which he or she # should not do since it is a private field! if (!isPrivate && is.null(attr(static, "disableSetMethods"))) { # 1. Is it a set() method? capitalizedName <- name; substr(capitalizedName,start=1L, stop=1L) <- toupper(firstChar); setMethodNames <- paste("set", capitalizedName, ".", class(static), sep=""); envir <- environment(static); for (setMethodName in setMethodNames) { mtd <- .getS3Method(setMethodName, envir=envir, mustExist=FALSE); if (!is.null(mtd)) { ref <- static; attr(ref, "disableSetMethods") <- TRUE; mtd(ref, value); return(this); } } } # 3. Is it an attribute field (slot)? if (is.element(name, names(attributes(static)))) { attr(static, name) <- value; return(this); } # 4. Otherwise, assign the value to an (existing or non-existing) field. assign(name, value, envir=attr(static, ".env")); invisible(this); }) # $<-() setMethodS3("[[<-", "Class", function(this, name, value) { do.call(`$<-`, list(this, name, value)) }) # "[[<-"() setMethodS3(".DollarNames", "Class", .DollarNames.Object, appendVarArgs=FALSE, private=TRUE) ############################################################################ # HISTORY: # 2015-01-27 # o BUG FIX: getKnownSubclasses() could throw an error if one of the # objects "scanned" for being a function and of class Class would # thrown an error from just looking at it. See R-devel thread # 'Inspect a "delayed" assigned whose value throws an error?' # on 2015-01-26 for details. # 2014-01-05 # o CLEANUP: Now static method Class$forName() utilizes .getClassByName(). # 2013-08-20 # o Now getPackage() for Object first searches the namesspace of the # Class object and then the attached ("loaded") packages. # 2012-12-28 # o Replaced all data.class(obj) with class(obj)[1]. # 2012-12-27 # o GENERALIZATION: Now getMethods() for Class also search the loaded # namespace, i.e. it works also when the package is not attached. # o ROBUSTNESS/BUG FIX: getMethods() for Class would give an error if # there are no methods for the queries class. # o ROBUSTNESS/BUG FIX: In the rare case where getStaticInstance() for # Class failed to setup a static instance, the temporary state set # internally would not be unset. # 2012-11-29 # o getKnownSubclasses() for Class is now faster (and yday's update # introduced a bug causing it to use huge amounts of memory. # 2012-11-28 # o UNDO: getMethods() and getKnownSubclasses() for Class does not # search loaded namespaces. # 2012-11-23 # o Updated "$"() for Class to return static methods that also work # when they are only access via an imported namespace and not an # attach package. # o Now getStaticInstance() for Class sets the environment for the # returned Object to that of the Class. # o Now getMethods() and getKnownSubclasses() for Class also search # loaded namespaces. # 2012-10-14 # o Now $(...) calls the generic function as # (, ...). Also, the body of the # function $ explicitly shows the name of the # generic function called. # 2012-03-08 # o Now package no longer warnings about renaming existing functions # getMethods() and getClasses() of 'base' to default methods during # installation, iff R.methodsS3 (>= 1.2.3). # 2012-02-29 # o CLEANUP: Dropped an .Internal() call in getMethods() for Class objects. # 2011-02-01 # o ROBUSTNESS: Now using 'inherits' (not 'inherit') in all calls to # get() and exists(). # 2007-06-09 # o Removed internal function formalsToString() of getDetails() for class # Class, because it was never used. # 2007-01-05 # o BUG FIX: getMethods(..., private=FALSE) would return private methods, # and private=TRUE would remove them. It should be the otherway around. # o BUG FIX: getMethods() for Class would sometimes give error message: # "Error in result[[k]] : subscript out of bounds". This in turn would # cause Rdoc to fail. # 2006-05-30 # o Added isBeingCreated() to Class. This was done after a request from # Omar Lakkis, University of Sussex. # 2006-04-01 # o Added argument 'envir' to all exists() and get() calls in the search # function getKnownSubclasses() (and inherits=FALSE). This will improve # speed a bit. # 2005-06-14 # o BUG FIX: getDetails() would list private and protected methods as # public. # o Now print() passes '...' to getDetails(), that is, now # print(Class, private=TRUE) will work too. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-06-28 # o Improvement: Added mode="function" to the get() statement in the # getStaticInstance() method. Also, added an assert statement that the # retrieved object then is a Class object. # 2003-10-29 # o BUG FIX: Last night I introduced a tiny tiny bug in the code for # retrieving static fields. # 2003-10-28 # o BUG FIX: "$<-.Class" was broken. It returned its static object instead # of itself (="this"). # o BUG FIX: The way "$.Class" and "$<-.Class" was check if an attribute # with the same name as argument 'name' exists was not done correctly. # Now it gets the list of names of the attributes and compares to that. # 2003-09-18 # o BUG FIX: getMethods() was not sensitive to 'deprecated=TRUE'. # 2003-05-14 # o Slight improvement in the generation of get and set, by # using substr()<-. # 2003-05-03 # o BUG FIX: Forgot to define forName() static. # 2003-04-29 # o Added isDeprecated(). # 2003-04-13 # o Added missing Rdoc comments. # o BUG FIX: getStaticInstance() did not recover correctly if static # instance was missing. # 2003-04-12 # o Minor detail: Declared the private method argsToString() to be static. # 2003-01-18 # o Replaced all occurences of getClass() with data.class(). Will change # the use of getClass() in the future to return a Class object. # 2002-11-07 # o Now $() and $<-() also gets and sets attribute values too, # respectively. # o BUG FIX: $<-() was returning this instead of static, which meant that # it was not possible to change values of static fields. # 2002-11-04 # o BUG FIX: getDetails() would not add a newline after the class name if # the class did not have a superclass, i.e. for root class Object. # o Updated getFields() to call getFields() instead of getFields.Object(). # 2002-10-24 # o Update getMethods() to also support private methods, i.e. looking at # the modifiers attribute also. # 2002-10-21 # o Added getDetails(). # 2002-10-20 # o Updated the Rdoc comments. # 2002-10-17 # o Created from R.oo Class.R and experiences from that project. ############################################################################ R.oo/R/objectSize.default.R0000644000177400001440000000202012726216524015332 0ustar murdochusers###########################################################################/** # @RdocDefault objectSize # # @title "Gets the size of the object in bytes" # # \description{ # @get "title". # This method is just a wrapper for @see "utils::object.size". # } # # @synopsis # # \arguments{ # \item{...}{Arguments passed to @see "utils::object.size".} # } # # \value{ # Returns an @integer. # } # # @author # # \seealso{ # Internally @see "utils::object.size". # } # # \keyword{attribute} # \keyword{utilities} #*/########################################################################### setMethodS3("objectSize", "default", function(...) { args <- list(...) args$.scannedEnvs <- NULL ## Used by objectSize() for environment do.call(object.size, args=args) }) ############################################################################ # HISTORY: # 2005-03-23 # o Created for completeness. Now objectSize() can be used for all kind # of objects. ############################################################################ R.oo/R/typeOfClass.R0000755000177400001440000000276612726216524014066 0ustar murdochusers###########################################################################/** # @RdocDefault typeOfClass # # @title "Gets the type of a class (S3 or S4)" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{object}{The object to be checks.} # \item{...}{Not used.} # } # # \value{ # Returns a @character string \code{"S3"}, \code{"S3-Object"} or \code{"S4"}, # or @NA if neither. # } # # @author # # \keyword{character} #*/########################################################################### setMethodS3("typeOfClass", "default", function(object, ...) { if (is.null(object)) return(NA_character_); if (inherits(object, "classRepresentation")) return("S4"); if (is.character(object)) { if (isClass(object)) { if (inherits(object, "oldClass")) return("S3"); return("S4"); } # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (!exists(object, mode="function")) return(NA_character_); object <- get(object, mode="function"); } if (is.function(object) && inherits(object, "Class")) return("S3-Object"); return(NA_character_); }) ############################################################################ # 2013-10-08 # o Now returning NA_character_ instead of NA. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. ############################################################################ R.oo/R/050.Object.R0000755000177400001440000021606012763175003013332 0ustar murdochusers###########################################################################/** # @RdocClass Object # # @title "The root class that every class must inherit from" # # \description{ # R.oo\cr # \bold{Class Object}\cr # # public class \bold{Object}\cr # # \code{Object} is the root class of all other classes. All classes # \emph{must} extends this class, directly or indirectly, which means # that they all will inherit the methods in this class. # } # # @synopsis # # \arguments{ # \item{core}{The core value of each \emph{reference} referering to the # Object. By default, this is just the smallest possible \R object, but # there are situations where it is useful to have another kind of core, # which is the case with the Class class. # \emph{Note that this value belongs to the reference variable # and not to the Object, which means it can not be referenced.}} # \item{finalize}{If @TRUE, method @seemethod "finalize" will # be called on this Object when it is garbage collected.} # } # # \section{Fields and Methods}{ # @allmethods # } # # \section{Defining static fields}{ # To define a static field of an Object class, use a private field # \code{<.field>} and then create a virtual field \code{} by # defining methods \code{get()} and \code{set()}. # These methods should retrieve and assign the value of the field # \code{<.field>} of the \emph{static} instance of the class. The # second example below shows how to do this. The example modifies # also the static field already in the constructor, which is something # that otherwise may be tricky. # } # # \examples{ # @include "../incl/Person.Rex" # # @include "../incl/StaticFields.Rex" # } # # @author # # \references{ # [1] @include "../incl/BengtssonH_2003.bib.Rdoc" \cr # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setConstructorS3("Object", Object); ###########################################################################/** # @RdocMethod as.character # # @title "Gets a character string representing the object" # # \description{ # @get "title". In the class Object, # this method simply returns the class name and the hashCode() value # of the object. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string representation of the Object. By default it # is "\{class name\}: \{hash code\}". # } # # \examples{ # obj <- Object() # as.character(obj) # "Object: 0x000000000ab6a7a8" # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("as.character", "Object", function(x, ...) { # To please R CMD check this <- x; addr <- getInternalAddress(this, format="hexstring"); paste(class(this)[1], ": ", addr, sep=""); }) # as.character() ###########################################################################/** # @RdocMethod getInstantiationTime # # @title "Gets the time when the object was instantiated" # # \description{ # @get "title" (created) as a POSIXt object. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a POSIXt object, which extends class POSIXct. # } # # \details{ # The instantiation time stamp is set when the object is created, and # only of option \code{"R.oo::BasicObject/instantiationTime"} is @TRUE. # } # # \examples{ # oopts <- options("R.oo::Object/instantiationTime"=TRUE) # obj <- Object() # print(getInstantiationTime(obj)) # options(oopts) # } # # \seealso{ # For more about time formats and POSIX see @see "base::DateTimeClasses". # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("getInstantiationTime", "Object", function(this, ...) { time <- attr(this, "...instantiationTime"); if (!is.null(time)) return(time); # Backward compatibility (due to a SPELLING ERROR in an earlier version) time <- attr(this, "...instanciationTime"); NULL; }) ###########################################################################/** # @RdocMethod clone # # @title "Clones an Object" # # \description{ # Creates an identical copy of the object and returns a reference to the # new object. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # A reference to the new object. # } # # \examples{ # o1 <- Object() # o2 <- clone(o1) # # print(equals(o1, o2)) # } # # \details{ # Please note that no constructors are called during the creation of the # clone and neither is any static class code called. # } # # \seealso{ # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("clone", "Object", function(this, ...) { # Copy the reference. clone <- this # Create a new environment, i.e. a new Object. clone.env <- new.env() attr(clone, ".env") <- clone.env # Copy all variables in the environment. this.env <- attr(this, ".env"); fields <- getFields(this, private=TRUE); for (field in fields) { value <- get(field, envir=this.env, inherits=FALSE); # The following line must be included to do nothing, but the effect # is that it fools the lazy evaluation (?) to create a true copy of # the object. If this is not done, it won't be a true clone even if # the value is assigned to another environment. Example: # b <- clone(a) # b$matrix[1,1] <- 2 # will otherwise also change a$matrix[1,1]. /HB 021023 attr(value, "R.oo::.clone.Object") <- NULL; assign(field, value, envir=clone.env); } clone; }) ###########################################################################/** # @RdocMethod equals # # @title "Compares an object with another" # # \description{ # @get "title" and returns @TRUE if they are equal. # The equal property must be # # 1) \emph{reflexive}, i.e. \code{equals(o1,o1)} should be @TRUE. # # 2) \emph{symmetric}, i.e. \code{equals(o1,o2)} is @TRUE if and only # if \code{equals(o2,o1)} is @TRUE. # # 3) \emph{transitive}, i.e. \code{equals(o1,o2)} is @TRUE and # \code{equals(o2,o3)} is @TRUE, then \code{equals(o1,o3)} should # be @TRUE. # # 5) \emph{consistent}, i.e. \code{equals(o1,o2)} should return the same # result on multiple invocations as long as nothing has changed. # # 6) \code{equals(o1,}@NULL\code{)} should return @FALSE, unless # \code{o1} is also @NULL. # # By default, the method returns @TRUE if and only if the two # references compared refer to the same @Object, i.e. # \code{( !is.null(obj) && (hashCode(this) == hashCode(obj)) )}. # } # # @synopsis # # \arguments{ # \item{other}{The other object this @Object should be compared to.} # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the Object's are equal, otherwise @FALSE. # } # # \examples{ # o1 <- Object() # o2 <- clone(o1) # equals(o1, o1) # TRUE # equals(o1, o2) # FALSE # } # # \seealso{ # @seemethod "hashCode". # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("equals", "Object", function(this, other, ...) { ( !is.null(other) && (hashCode(this) == hashCode(other)) ); }) ###########################################################################/** # @RdocMethod finalize # # @title "Finalizer methods called when object is clean out" # # \description{ # Finalizer methods are called just the moment before the object is # about to be deleted by the garbage collector. # # \bold{If creating a custom \code{finalize()} method for a subclass # in a package, then it needs to be exported in the NAMESPACE of # that package. If not, it will not be found nor called and # there will be no error message.} # # \bold{A finalizer method should never be called explicitly!} # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # @examples "../incl/Object.finalize.Rex" # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("finalize", "Object", function(this, ...) { }) ###########################################################################/** # @RdocMethod hashCode # # @title "Gets a hash code for the Object" # # \description{ # @get "title". This makes it possible to put any @Object in a hash table. # # The hash code returned must: # # 1) be \emph{consistent}, i.e. \code{hashCode(obj)} should return the same # value on multiple invocations as long as nothing has changed. # # 2) tell same same thing as \code{equals()}, if \code{equals(o1,o2)} is # @TRUE, then \code{hashCode(o1) == hashCode(o2)} should also be # @TRUE. # # Note that if \code{equals(o1,o2)} is @FALSE, \code{hashCode(o1)} # \code{hashCode(o2)} may be \emph{either} equal or non-equal. # # By default, the method returns the internal memory address where the # Object is located. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @double. # } # # \examples{ # obj <- Object() # hashCode(obj) # 26979608 # } # # @author # # \seealso{ # @seemethod "equals" # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("hashCode", "Object", function(this, ...) { getInternalAddress(this, format="numeric"); }) # hashCode() ###########################################################################/** # @RdocMethod getInternalAddress # # @title "Gets the memory location where the Object resides" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{format}{A @character string specifying what format to return.} # \item{...}{Not used.} # } # # \value{ # The address is returned as a @numeric integer if # \code{format == "numeric"}, and as a @character string if # \code{format == "hexstring"}. # } # # \examples{ # obj <- Object() # getInternalAddress(obj, format="numeric") # 179742632 # getInternalAddress(obj, format="hexstring") # "0x000000000ab6a7a8" # } # # @author # # \seealso{ # \code{\link[=getName.environment]{getName()}}. # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("getInternalAddress", "Object", function(this, format=c("numeric", "hexstring"), ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - hexStringToDouble <- function(hex) { hexDigits <- unlist(strsplit("0123456789ABCDEF", "")); digits16 <- unlist(strsplit(toupper(hex), "")); digits10 <- match(digits16, hexDigits) - 1; bases10 <- rev(16^(seq_along(digits10)-1)); sum(digits10 * bases10); } hexStringToInt <- function(hex) { as.integer(hexStringToDouble(hex)); } # Argument 'format': format <- match.arg(format); pointer <- getName(attr(this, ".env")); if (format == "numeric") { pointer <- gsub("0x", "", pointer); pointer <- hexStringToDouble(pointer); } pointer; }, private=TRUE) # getInternalAddress() ###########################################################################/** # @RdocMethod print # # @title "Prints an Object" # # \description{ # For all objects of class @see "Object", this method will print the # value of \code{as.character()} of the object. Note that this function is # not called if the argument is not an object of class @Object. # } # # @synopsis # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @see "base::print.default" # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("print", "Object", function(x, ...) { print(as.character(x)); }) # print() ########################################################################/** # @RdocMethod attachLocally # # @title "Attaches an Object locally to an environment" # # @synopsis # # \description{ # @get "title". By default, the fields of the Object are attached to # the parent frame, that is, the calling environment. # } # # \arguments{ # \item{private}{If @TRUE, private fields are included, otherwise not. # This is only effective if \code{fields==NULL}.} # \item{fields}{A @character @vector specifying elements to be copied. # If @NULL, all elements are considered.} # \item{excludeFields}{A @character @vector specifying elements not to # be copied. This has higher priority than \code{fields}.} # \item{overwrite}{If @FALSE, fields that already exists will not be # copied.} # \item{envir}{The @environment where fields are copied to.} # \item{...}{Not used.} # } # # \value{ # Returns (invisibly) a @character @vector of the fields copied. # } # # @examples "../incl/attachLocally.Object.Rex" # # @author # # \seealso{ # @seemethod attach # @seeclass # } # # @keyword "utilities" # @keyword "programming" #*/######################################################################### setMethodS3("attachLocally", "Object", function(this, private=FALSE, fields=NULL, excludeFields=NULL, overwrite=TRUE, envir=parent.frame(), ...) { if (is.null(fields)) { fields <- getFields(this, private=private); } fields <- setdiff(fields, excludeFields); attachedFields <- c(); for (field in fields) { if (overwrite || !hasField(this, field)) { assign(field, this[[field]], envir=envir); attachedFields <- c(attachedFields, field); } } invisible(attachedFields); }) ###########################################################################/** # @RdocMethod attach # # @title "Attaches an Object to the R search path" # # \description{ # Attach the members of an Object to the \R search path. # # If trying to attach the same Object twice without detaching it inbetween, # a @warning will be generated and nothing will be done. # } # # @synopsis # # \arguments{ # \item{private}{If @TRUE, private fields will also be attached, # otherwise not.} # \item{pos}{The position at in search path where the Object should be # inserted.} # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the @Object was attached, otherwise @FALSE. # } # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @seemethod "detach" and @see "base::attach", @see "base::detach". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("attach", "Object", function(this, private=FALSE, pos=2, ...) { # To please R CMD check attachX <- base::attach; attachName <- as.character.Object(this); if (is.element(attachName, search())) { warning(paste("Object is already attached:", attachName)); return(invisible(FALSE)); } envir <- attr(this, ".env"); attachX(list(), name=attachName, pos=pos); members <- ls(envir=envir, all.names=private); for (member in members) { assign(member, get(member, envir=envir), pos=pos); } return(invisible(TRUE)); }) # attach() ###########################################################################/** # @RdocMethod detach # # @title "Detach an Object from the R search path" # # \description{ # Detach, from the \R search path, an Object that has previously been # attached. If the Object was not attached, a @warning will be generated # and nothing will be done. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the Object was detached, otherwise @FALSE. # } # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @seemethod "attach" and @see "base::attach", @see "base::detach". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("detach", "Object", function(this, ...) { attachName <- as.character.Object(this); if (!is.element(attachName, search())) { warning(paste("Object is not attached:", attachName)); return(invisible(FALSE)); } pos <- which(search() == attachName); if (length(pos) == 1L) detach(pos=pos); return(invisible(TRUE)); }) # detach() ###########################################################################/** # @RdocMethod save # # @title "Saves an Object to a file or a connection" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{file}{Filename or @connection to which the Object should be saved. # If @NULL, the Object will be save to a file named # "\{class name\}.\{memory location\}.RData", e.g. "Object.26979608.RData".} # \item{path}{The path where the file should be saved.} # \item{compress}{If @TRUE, the file is compressed to, otherwise not.} # \item{...}{Other arguments accepted by \code{save()} in the base package.} # \item{safe}{If @TRUE and \code{file} is a file, then, in order to lower # the risk for incomplete files, the object is first written to a # temporary file, which is then renamed to the final name.} # } # # \value{ # Returns nothing. # } # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @seemethod "load" and @see "base::save", @see "base::load". # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{IO} #*/########################################################################### setMethodS3("save", "Object", function(this, file=NULL, path=NULL, compress=TRUE, ..., safe=TRUE) { if (is.null(file)) { file <- sprintf("%s.%d.RData", class(this)[1], getInternalAddress(this, format="numeric")); } # Saving to a file? saveToFile <- (!inherits(file, "connection")); if (saveToFile) { if (!is.null(path) && path != "") { # 1. Remove any '/' or '\' at the end of the path string. path <- gsub("[/\\]*$", "", path); # 2. Add a '/' to the end. if (regexpr("/$", path) == -1) path <- paste(path, "/", sep=""); # 3. Paste the path and the file together. file <- as.character(file); file <- paste(path, file, sep=""); } } # Write to a temporary file? if (safe && saveToFile) { # Final pathname pathname <- file; # Temporary pathname pathnameT <- sprintf("%s.tmp", pathname); if (file.exists(pathnameT)) { throw("Cannot save to file. Temporary file already exists: ", pathnameT); } # Write to a temporary file file <- pathnameT; on.exit({ if (!is.null(pathnameT) && file.exists(pathnameT)) { file.remove(pathnameT); } }, add=TRUE); } # For some unknown reason is save.default() adding the variables # 'exp', 'object', 'row' and 'value' to environment of this object. # /HB 031020 saveLoadReference <- this; res <- base::save(saveLoadReference, file=file, ..., compress=compress); # Rename temporary file? if (safe && saveToFile) { file.rename(pathnameT, pathname); if (!file.exists(pathname) || file.exists(pathnameT)) { throw("Failed to rename temporary file: ", pathnameT, " -> ", pathname); } pathnameT <- NULL; file <- pathname; } invisible(res); }) # save() ###########################################################################/** # @RdocMethod load # # @title "Static method to load an Object from a file or a connection" # # \description{ # @get "title", which previously have been saved using \code{save()} of # class Object. # } # # @synopsis # # \arguments{ # \item{file}{Filename or @connection from where to read the Object.} # \item{path}{The path where the file exists.} # \item{...}{Not used.} # } # # \value{ # Returns a reference to the loaded Object. # } # # \details{ # Please note that no constructors are called when an Object is loaded # and neither is any static class code called. # } # # \section{Type control}{ # Typically this static method is called as \code{$load(...)} # where \code{} is any Object class. When an Object has been # loaded, it is verified that it inherits from \code{}. If it # does not, an exception is thrown. Thus, \code{Object$load(...)} will # load any Object, but \code{MyClass$load(...)} will only load an Object # that inherits from MyClass. If loaded object is not of correct class, # an exception is thrown. # } # # \section{Troubleshooting}{ # Due to a bug, likely in \R itself, one can not specify the \code{file} # argument by its name, i.e. \code{Object$load(file="foo.RData")} will # not work, but \code{Object$load("foo.RData")} work just fine. # } # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @seemethod "save" and # @see "base::save", @see "base::load". # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{IO} #*/########################################################################### setMethodS3("load", "Object", function(static, file, path=NULL, ...) { if (!inherits(file, "connection")) { if (!is.null(path) && path != "") { # 1. Remove any '/' or '\' at the end of the path string. path <- gsub("[/\\]*$", "", path); # 2. Add a '/' to the end. if (regexpr("/$", path) == -1) path <- paste(path, "/", sep=""); # 3. Paste the path and the file together. file <- as.character(file); file <- paste(path, file, sep=""); } } # load.default() recognized gzip'ed files too. saveLoadReference <- NULL; # To please R CMD check R v2.6.0 vars <- load.default(file=file); if (!is.element("saveLoadReference", vars)) throw("The file does not contain an R.oo Object: ", file); object <- saveLoadReference; # Assert that the loaded object inherits from the same class as the # static object used to call this method. if (!inherits(object, class(static)[1])) { throw("Loaded an Object from file, but it does not inherit from ", class(static)[1], " as expected: ", paste(class(object), collapse=", ")); } object; }, static=TRUE) # load() ###########################################################################/** # @RdocMethod objectSize # # @title "Gets the size of the Object in bytes" # # \description{ # @get "title" by summing the sizes of all its # members. For this reason, the size of memory the Object actually # allocates might vary slighty. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns an @integer specifying the size of the object in number of bytes. # } # # \examples{ # obj <- Object() # obj$x <- 1:100 # obj$y <- 100:1 # objectSize(obj) # 856 # } # # @author # # \seealso{ # To clear fields that are declared \code{cached}, # see @seemethod "clearCache". # @see "utils::object.size". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("objectSize", "Object", function(this, ...) { envir <- attr(this, ".env"); members <- ls(envir=envir, all.names=TRUE); totalSize <- 0; for (member in members) { size <- eval(substitute(object.size(member), list(member=as.name(member))), envir=envir); totalSize <- totalSize + size; } totalSize; }) # objectSize() ###########################################################################/** # @RdocMethod getStaticInstance # # @title "Gets the static instance of this objects class" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a reference to an @Object. # } # # \examples{ # ex <- Exception("Oops!") # obj <- getStaticInstance(ex) # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("getStaticInstance", "Object", function(this, ...) { className <- class(this)[1L]; # WAS: clazz <- get(className); # (a) Search namespace of package specified by internal field # '...package' of the Object environment. This field is # set by the constructor. Since it was introduced in # R.oo v1.14.0, it is not guaranteed to exist. envir <- getEnvironment(this); package <- envir$...package; if (!is.null(package)) { ## As long as package supports R (< 2.14.0) if (!exists("requireNamespace", envir=baseenv(), inherits=TRUE)) { requireNamespace <- function(package, quietly=TRUE, ...) { tryCatch({ suppressPackageStartupMessages({ loadNamespace(package, ...) }) TRUE }, error = function(ex) FALSE) } } # Check if namespace can be retrieved. This may not possible if # for instance an Object is loaded from disk and the package name # has changed since it was last saved. if (requireNamespace(package, quietly=TRUE)) { ns <- getNamespace(package); clazz <- .getClassByName(className, where="ns", envir=ns, mustExist=FALSE); if (!is.null(clazz)) { static <- getStaticInstance(clazz); return(static); } } } # (b) Search all loaded namespaces clazz <- .getClassByName(className, where=c("ns*", "search"), mustExist=FALSE); if (!is.null(clazz)) { static <- getStaticInstance(clazz); return(static); } # (c) Search parent environment clazz <- .getClassByName(className, where="ns", envir=parent.frame(2L), mustExist=FALSE); if (!is.null(clazz)) { static <- getStaticInstance(clazz); return(static); } stop("Cannot get static instance. Failed to locate Class object for class '", className, "'."); }, protected=TRUE) # getStaticInstance() ###########################################################################/** # @RdocMethod getFields # @aliasmethod names # # @title "Returns the field names of an Object" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{private}{If @TRUE, private fields will also be returned, # otherwise only public fields are returned.} # \item{...}{Not used.} # } # # \value{ # Returns a @character @vector of field names. # } # # \examples{ # obj <- Object() # obj$x <- 1:100 # obj$y <- 100:1 # getFields(obj) # # \dontrun{ # gives: # # [1] "x" "y" # } # } # # @author # # \seealso{ # To check if a field exists or not, see @seemethod "hasField". # For more extensive information about the fields in an Object see # @seemethod "ll". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("getFields", "Object", function(this, private=FALSE, ...) { envir <- attr(this, ".env"); ls(envir=envir, all.names=private); }) # getFields() setMethodS3("names", "Object", function(x, ...) { getFields(x, ...); }, private=TRUE) # names() ###########################################################################/** # @RdocMethod hasField # # @title "Checks if a field exists or not" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{field}{@vector of fields to be checked if they exists or not.} # \item{...}{Not used.} # } # # \value{ # Returns a @logical @vector indicating for each field if it exists or not. # } # # \examples{ # obj <- Object() # obj$x <- 1:100 # obj$y <- 100:1 # hasField(obj, c("x", "a", "b", "y")) # # \dontrun{ # gives: # # [1] TRUE FALSE FALSE TRUE # } # } # # @author # # \seealso{ # To get the fields of an Object, see @seemethod "getFields". # For more extensive information about the fields in an Object see # @seemethod "ll". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("hasField", "Object", function(this, field, ...) { !is.na(match(field, getFields(this, private=TRUE))); }) # hasField() ###########################################################################/** # @RdocMethod ll # # @title "Generates a list of informative properties of all members of an Object" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Any arguments accepted by the underlying function \code{ll()}.} # } # # \value{ # Returns a @data.frame containing information about all the members. # } # # \examples{ # obj <- Object() # obj$x <- 1:100 # obj$y <- 100:1 # ll(obj) # # \dontrun{ # gives: # # member data.class dimension objectSize # 1 x numeric 100 424 # 2 y numeric 100 424 # } # } # # @author # # \seealso{ # @see "ll.default". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("ll", "Object", function(this, ...) { ll(..., envir=attr(this, ".env")); }) # ll() ###########################################################################/** # @RdocMethod staticCode # # @title "Method that will be call each time a new instance of a class is created" # # \description{ # @get "title". # # By extending this method it is possible to have static code that is called # each time a new instance of a class is created. # } # # @synopsis # # \arguments{ # \item{static}{The static instance of this class.} # \item{...}{Not used.} # } # # \value{ # Returns nothing. # } # # \details{ # The method \code{extend()} in the Object class will call this method just # before returning and it will pass the static instance of the class as a # reference. Note that method should never be called explicitly. # # Any value returned by this method will be ignored. # } # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("staticCode", "Object", function(static, ...) { # Note that this code will never be called when a "pure" # Object is created, but for instances of all other # class staticCode() will be called. }, private=TRUE) ###########################################################################/** # @RdocMethod extend # # @title "Extends another class" # # \description{ # via a mechanism known as "parasitic inheritance". # Simply speaking this method "extends another class". What is actually # happening is that it creates an instance of class name \code{...className}, # by taking another Object instance and add \code{...className} to the class # list and also add all the named values in @... as fields to the # new instance. # # The method should be used by the constructor of a class and nowhere else. # } # # @synopsis # # \arguments{ # \item{...className}{The name of new class.} # \item{...}{Named values representing the fields of the new instance.} # \item{...fields}{An optional named @list of fields. This makes it possible # to specify a set of fields using a @list object.} # \item{...envir}{An @environment.} # \item{...finalize}{ # A @logical controlling whether method @seemethod "finalize" should # be called on the @see Object when it is garbage collected or not. # If @TRUE, it will be called. If @FALSE, it will not be called. # If @NA, it will be called according to argument \code{finalize} # of the @see Object constructor. # } # } # # \value{ # Returns an Object of class \code{className}. # } # # \details{ # The reason for the strange name of argument \code{"...className"} is that # if one tries to set a field with a name that is a prefix of the name of # this arguments and one at the same time does not specify the name of this # argument one would run into strange errors. For instance, try # \code{extend(Object(), "MyClass", ...c=0)}. # } # # \section{Field modifiers}{ # It is possible to specify modifiers to some of the fields. Currently it # is only the \code{cached} modifier that is recognized. A field that is # cached will be assigned @NULL when @seemethod "clearCache" # (or @seemethod "gc") is called. To specify a modifier, append a comma # separated list of modifiers followed by a colon, e.g. "cached:foo". # } # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### if (is.element("R.oo", search())) { rm(list="extend", pos="R.oo"); # To avoid warning about renaming existing extend() } setMethodS3("extend", "Object", function(this, ...className, ..., ...fields=NULL, ...envir=parent.frame(), ...finalize=NA) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - parseModifiers <- function(args, ...) { names <- names(args); pattern <- "([abcdefghijklmnopqrstuvwxyz ]*):(.*)$"; modifiers <- rep("", length(names)); idx <- grep(pattern, names); modifiers[idx] <- gsub(pattern, "\\1", names[idx]); modifiers <- strsplit(modifiers, split=" "); modifiers <- lapply(modifiers, gsub, pattern=" *", replacement=""); # Get the real names names[idx] <- gsub("[abcdefghijklmnopqrstuvwxyz ]*:", "", names[idx]); names(args) <- names; # Set modifier attributes mods <- list(); for (type in c("cached")) { mods[[type]] <- names[modifiers == type]; } attr(args, "modifiers") <- mods; args; } # parseModifiers() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Main # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # The environment of 'this' Object this.env <- attr(this, ".env"); fields <- c(list(...), ...fields); # Identify and renamed fields that have modifiers in their names fields <- parseModifiers(fields); names <- names(fields); for (ii in seq_along(fields)) { name <- names[ii]; if (is.null(name) || nchar(name) == 0) { callNames <- names(sys.call()); callNames <- callNames[nchar(callNames) > 0]; matchNames <- paste("^", callNames, sep=""); for (jj in seq_along(matchNames)) { if (regexpr(matchNames[jj], "...className") != -1) { className <- sys.call()[[3]]; throw("Could not set field of class (probably called ", className, ") because the field name is a prefix to the argument name ", "\"...className\": ", callNames[jj]); } } # for (jj ...) throw("Missing name of field #", ii, " in class definition: ", ...className); } assign(name, fields[[ii]], envir=this.env); } # for (ii ...) # Set class class(this) <- unique(c(...className, class(this))); # Should the Object be finalized? finalize <- TRUE; if (exists("...finalize", envir=this.env, inherits=FALSE)) { finalize <- get("...finalize", finalize, envir=this.env, inherits=FALSE); finalize <- isTRUE(finalize); } # Override by extend(..., ...finalize=TRUE/FALSE)? if (!is.na(...finalize)) finalize <- isTRUE(...finalize); if (finalize) { # Note, we have to re-register the finalizer here and not in Object(), # because here the reference variable 'this' will have the correct # class attribute, which it does not in Object(). finalizer <- .makeObjectFinalizer(this, reloadRoo=TRUE); onexit <- getOption("R.oo::Object/finalizeOnExit", FALSE); reg.finalizer(this.env, finalizer, onexit=onexit); } # extend(..., ...finalize=FALSE) should always remove any # previously registered finalizers. if (!is.na(...finalize) && !isTRUE(...finalize)) { # Unregister finalizer (by registering a dummy one) reg.finalizer(this.env, f=function(...) {}); } # Finally, create the static instance? if (!is.element("Class", ...className)) { static <- getStaticInstance(this, envir=...envir); if (!is.null(static)) { staticCode(static); } } # Record field modifiers # Get the field modifiers (always a list) modifiers <- attr(fields, "modifiers"); # Append already existing modifiers? if (exists("...modifiers", envir=this.env, inherits=FALSE)) { modifiersT <- get("...modifiers", envir=this.env, inherits=FALSE); for (key in names(modifiersT)) { modifiers[[key]] <- c(modifiers[[key]], modifiersT[[key]]); } } # Drop duplicated modifier entries and sort modifiers <- lapply(modifiers, FUN=function(mods) { sort(unique(mods)); }); # Record modifiers assign("...modifiers", modifiers, envir=this.env); this; }) # extend() ###########################################################################/** # @RdocMethod $ # @aliasmethod [[ # # @title "Makes the fields and methods of an Object accessable via the \$ and the [[ operator" # # \description{ # Makes the fields and methods of an Object accessable via the \code{$} # operator. This method is never called explicitly, but through an indirect # usage of the \code{$} operator, e.g. \code{obj$name} or # \code{obj$getValue()}. # # 1) This method will first search for a \code{get()} method, e.g. if # name has the value \code{"age"}, a \code{getAge()} will be looked for. # If such a method exists it will be called with the Object as the first # and only argument, e.g. \code{getAge(this)}. # # A \code{get()} is only looked for if \code{} is not a private # field. A private field is a name \emph{beginning} with a \code{.} # (period). The rational for this naming convention is to be consistent # with how @see "base::ls" works, which will not list such members # by default. # # 2) If no such method exists, first then, this method will look a field in # the Object can has the name \code{name}. # # 3) If such neither exists, a method with name \code{name} will be # searched for and returned. # # 4) Otherwise, a static field will be looked for. # # 5) If no fields or methods are found at all, @NULL is returned. # } # # \usage{ # \method{$}{Object}(this, name) # \method{[[}{Object}(this, name, exact=TRUE) # } # # \arguments{ # \item{name}{The name of the field or method to be accessed.} # } # # \value{ # Returns the value of a field or a method (@function). # If no such field or method exists, @NULL is returned. # } # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("$", "Object", function(this, name) { .subset2Internal(this, name=name, exact=TRUE) }) setMethodS3("[[", "Object", function(this, name, exact=TRUE) { .subset2Internal(this, name=name, exact=exact) }) setMethodS3(".subset2Internal", "Object", function(this, name, exact=TRUE, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .getStaticInstance <- function(this, static=NULL) { if (!is.null(static)) return(static); getStaticInstance(this); } # .getStaticInstance() memberAccessorOrder <- attr(this, ".memberAccessorOrder"); if (is.null(memberAccessorOrder)) { memberAccessorOrder <- c(1L, 2L, 3L, 4L, 5L); } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # (a) Check if there is a cache lookup available. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - envir <- attr(this, ".env"); cacheName <- paste("...$.lookup", name, sep="."); if (!is.null(envir) && exists(cacheName, envir=envir, inherits=FALSE)) { envirCache <- envir; lookup <- get(cacheName, envir=envirCache, inherits=FALSE); if (identical(attr(lookup, "memberAccessorOrder"), memberAccessorOrder)) { if (lookup == 1L) { # Still to be figured out how to do! /HB 2003-01-18 # memberAccessorOrder <- attr(lookup, "possibilities"); } else if (lookup == 2L) { envir2 <- envir; return( get(name, envir=envir2) ); } else if (lookup == 3L) { return( attr(this, name) ); } else if (lookup == 4L) { fcn <- attr(lookup, "fcn"); if (!is.null(fcn)) { return(fcn); } # Backward compatibility for Object:s saved with R.oo < 1.10.0, # which used deprecated attr(lookup, "method"). The below code # will NULL the 'lookup' and force an updated. } else if (lookup == 5L) { return( get(name, envir=attr(lookup, "static.envir")) ); } } # if (identical(attr(lookup, ...))) lookup <- NULL; } else { lookup <- NULL; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # (b) Otherwise search # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static <- NULL; for (memberAccessor in memberAccessorOrder) { if (memberAccessor == 1L) { if (is.null(attr(this, "disableGetMethods"))) { firstChar <- substr(name, start=1L, stop=1L); # Do not try to access private fields using a get() method, # because such a functionality means that the user *expects* that # there actually is a field called '.', which he or she # should not do since it is a private field! # Is it a private field? if (!identical(firstChar, ".")) { # Field names can not contain spaces... if (regexpr(" ", name) == -1L) { # 1. Is there a get() method? capitalizedName <- name; substr(capitalizedName, start=1L, stop=1L) <- toupper(firstChar); getMethodNames <- paste("get", capitalizedName, ".", class(this), sep=""); static <- .getStaticInstance(this, static=static); envirS <- environment(static); for (getMethodName in getMethodNames) { method <- .getS3Method(getMethodName, envir=envirS, mustExist=FALSE); if (!is.null(method)) { ref <- this; attr(ref, "disableGetMethods") <- TRUE; # For caching purposes, if the field is trying to be # accessed, we do not want to call get() again! If # is not a virtual field, the it has to be a real field, an # attribute, a static field etc. We do not know in advance, # but we know it is nothing we already tried, hence lookup <- memberAccessor; attr(lookup, "memberAccessorOrder") <- memberAccessorOrder; pos <- which(memberAccessorOrder == memberAccessor); attr(lookup, "possibilities") <- memberAccessorOrder[-(1:pos)]; assign(cacheName, lookup, envir=envir); return(method(ref)); } } # for (...) } # if ("no space in the name") } # if ("is private field") } # if (is.null(attr(this, "disableGetMethods"))) } else if (memberAccessor == 2L) { # 2. Is it a field? # For static method calls, e.g. Object$load, 'this' has no # environment assigned and therefore, for now, no static # fields. if (!is.null(envir) && exists(name, envir=envir, inherits=FALSE)) { lookup <- memberAccessor; attr(lookup, "memberAccessorOrder") <- memberAccessorOrder; assign(cacheName, lookup, envir=envir); envirStatic <- envir; return(get(name, envir=envirStatic, inherits=FALSE)); } } else if (memberAccessor == 3L) { # 3. Is it an attribute field (slot)? if (is.element(name, names(attributes(this)))) { lookup <- memberAccessor; attr(lookup, "memberAccessorOrder") <- memberAccessorOrder; assign(cacheName, lookup, envir=envir); return(attr(this, name)); } } else if (memberAccessor == 4L) { # 4. Is it a static S3 method? static <- .getStaticInstance(this, static=static); envirS <- environment(static); methodNames <- paste(name, class(this), sep="."); for (methodName in methodNames) { method <- .getS3Method(methodName, envir=envirS, mustExist=FALSE); if (!is.null(method)) { # Using explicit UseMethod() code code <- sprintf("function(...) \"%s\"(this, ...)", name); fcn <- eval(base::parse(text=code)); ## environment(fcn) <- environment(method); lookup <- memberAccessor; attr(lookup, "memberAccessorOrder") <- memberAccessorOrder; attr(lookup, "fcn") <- fcn; assign(cacheName, lookup, envir=envir); return(fcn); } } } else if (memberAccessor == 5L) { # 5. Finally, if nothing is found, it might be that it is a static field static <- .getStaticInstance(this, static=static); static.envir <- attr(static, ".env"); # For static method calls, e.g. Object$load, 'this' has no # environment assigned and therefore, for now, no static # fields. if (!is.null(static.envir) && exists(name, envir=static.envir, inherits=FALSE)) { lookup <- memberAccessor; attr(lookup, "memberAccessorOrder") <- memberAccessorOrder; attr(lookup, "static.envir") <- static.envir; assign(cacheName, lookup, envir=envir); return(get(name, envir=static.envir, inherits=FALSE)); } } } # for (memberAccessor in memberAccessorOrder) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # (c) If not found, return NULL. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lookup <- -1L; attr(lookup, "memberAccessorOrder") <- memberAccessorOrder; assign(cacheName, lookup, envir=envir); NULL; }, private=TRUE) # .subset2Internal() ###########################################################################/** # @RdocMethod $<- # @aliasmethod [[<- # # @title "Makes the fields and methods of an Object assignable via the \$<- and the [[<- operator" # # \description{ # Makes the fields and methods of an Object assignable via the \code{$<-} # operator. This method is never called explicitly, but through an indirect # usage of the \code{$<-} operator, e.g. \code{obj$name <- "foo"}. # # 1) This method will first search for a \code{set()} method, e.g. if # name has the value \code{"age"}, a \code{setAge()} will be looked for. # If such a method exists it will be called with the Object as the first # argument and \code{value} as the second, e.g. \code{setAge(this, value)}. # # A \code{set()} is only looked for if \code{} is a non-private # field. A private field is a name \emph{beginning} with a \code{.} (period). # The rational for this naming convention is to be consistent # with how @see "base::ls" works, which will not list such members # by default. # Moreover, excluding private fields for the search of a \code{set()} # will decrease the overhead for such field. # # 2) If no such method exists the \code{value} will be assigned to an # existing field named \code{name}, if such exists. # # 3) Otherwise, the value will be assigned to a static field, # if such exists. # # 4) In all other case, the value is assigned to a new field. # # Because any \code{set()} is called first, it is possible to # \emph{encapsulate} (hide away) fields with certain names or to put # restrictions to what values can be assigned to them. # } # # \usage{ # \method{$}{Object}(this, name) <- value # \method{[[}{Object}(this, name) <- value # } # # \arguments{ # \item{name}{The name of the \code{set()} method or the name of # the field to be assigned the new value.} # \item{value}{The value to be assigned.} # } # # \value{ # Returns itself, i.e. \code{this}, as all \code{$<-} methods must do. # } # # \examples{\dontrun{For a complete example see help(Object).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("$<-", "Object", function(this, name, value) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .getStaticInstance <- function(this, static=NULL) { if (!is.null(static)) return(static); getStaticInstance(this); } # .getStaticInstance() memberAccessorOrder <- attr(this, ".memberAccessorOrder"); if (is.null(memberAccessorOrder)) { memberAccessorOrder <- c(1,2,3,4,5); } static <- NULL; for (memberAccessor in memberAccessorOrder) { if (memberAccessor == 1) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Search for a set() method # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (is.null(attr(this, "disableSetMethods"))) { firstChar <- substr(name, 1,1); # Do not try to access private fields using a set() method, # because such a functionality means that the user *expects* that # there actually is a field called '.', which he or she # should not do since it is a private field! # Is it a private field? if (!identical(firstChar, ".")) { # Field names can not contain spaces... if (regexpr(" ", name) == -1) { # 1. Is it a set() method? capitalizedName <- name; substr(capitalizedName,1,1) <- toupper(firstChar); setMethodNames <- paste("set", capitalizedName, ".", class(this), sep=""); static <- .getStaticInstance(this, static=static); envirS <- environment(static); for (setMethodName in setMethodNames) { method <- .getS3Method(setMethodName, envir=envirS, mustExist=FALSE); if (!is.null(method)) { ref <- this; attr(ref, "disableSetMethods") <- TRUE; method(ref, value); return(invisible(this)); } } } # if ("no space in the name") } # if ("is private field") } # if (is.null(attr(this, "disableSetMethods"))) } else if (memberAccessor == 2) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Search for a field # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # 2. If there exists a field, assign the value to that field. envir <- attr(this, ".env"); if (exists(name, envir=envir, inherits=FALSE)) { assign(name, value, envir=envir); return(invisible(this)); } } else if (memberAccessor == 3) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Search for a attribute. /Should this be removed? # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # 3. If there exists an attribute field, assign the value to that field. if (is.element(name, names(attributes(this)))) { attr(this, name) <- value; return(invisible(this)); } } else if (memberAccessor == 4) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Search for a static field # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # 4. If not, it might be that it is a static field static <- .getStaticInstance(this, static=static); static.envir <- attr(static, ".env"); # For static method calls, e.g. Object$load, 'this' has no # environment assigned and therefore, for now, no static # fields. if (!is.null(static.envir) && exists(name, envir=static.envir, inherits=FALSE)) { assign(name, value, envir=static.envir); return(invisible(this)); } } else if (memberAccessor == 5) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Create a new field # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # 5. Otherwise, assign the value to a new field. assign(name, value, envir=envir); return(invisible(this)); } } # for (memberAccessor in memberAccessorOrder) invisible(this); }) # $<-() setMethodS3("[[<-", "Object", function(this, name, value) { UseMethod("$<-"); # "$<-"(this, name, value); }) # "[[<-"() ###########################################################################/** # @RdocMethod isReferable # # @title "Checks if the object is referable or not" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @logical value, which by default is @TRUE for all @Object's. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("isReferable", "Object", function(this, ...) { TRUE; }, private=TRUE) # isReferable() ###########################################################################/** # @RdocMethod novirtual # # @title "Returns a reference to the same Object with virtual fields turned off" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns an @Object. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("novirtual", "Object", function(this, ...) { attr(this, "disableGetMethods") <- TRUE; attr(this, "disableSetMethods") <- TRUE; this; }, private=TRUE) setMethodS3("callSuperMethodS3", "default", function(this, methodName, ..., nbrOfClassesAbove=1) { if (nbrOfClassesAbove < 0) { throw("Argument 'nbrOfClassesAbove' is negative."); } classes <- class(this); nbrOfClassesAbove <- min(nbrOfClassesAbove, length(classes)) classes <- classes[-seq_len(nbrOfClassesAbove)]; if (length(classes) == 0) { methods <- methodName; } else { methods <- c(paste(methodName, classes, sep="."), methodName); } availableMethods <- c(methods(methodName), methodName); for (method in methods) { if (is.element(method, availableMethods)) { # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (exists(method, mode="function")) { return(do.call(method, args=list(this, ...))) } } } throw("No applicable methods '", methodName, "' available among the superclasses: ", classes); }, private=TRUE) ###########################################################################/** # @RdocMethod newInstance # # @title "Creates a new instance of the same class as this object" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Arguments passed to the constructor of the corresponding # @see "Object" class.} # } # # \value{ # Returns a reference to an instance of @see "Object" or a subclass thereof. # } # # @author # # \seealso{ # @see "newInstance.Class". # @see "newInstance.BasicObject". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("newInstance", "Object", function(this, ...) { # Creates a new instance of the same class clazz <- Class$forName(class(this)[1]); newInstance(clazz, ...); }, private=TRUE) ###########################################################################/** # @RdocMethod getEnvironment # # @title "Gets the environment of this object" # # \description{ # @get "title". # This is the environment where the members of the Object are stored. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns an @environment. # } # # \examples{ # ll(R.oo) # ll(envir=getEnvironment(R.oo)) # } # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getEnvironment", "Object", function(fun, ...) { # To please R CMD check this <- fun; attr(this, ".env"); }, protected=TRUE) ###########################################################################/** # @RdocMethod clearLookupCache # # @title "Clear internal fields used for faster lookup" # # \description{ # @get "title" by removing these fields. # This method is called whenever @seemethod "gc" is called on the # object. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns itself (invisible). # } # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("clearLookupCache", "Object", function(this, ...) { env <- this$.env; names <- ls(envir=env, pattern="^...\\$.lookup", all.names=TRUE); rm(list=names, envir=env); invisible(this); }, protected=TRUE) ###########################################################################/** # @RdocMethod clearCache # # @title "Clear fields that are defined to have cached values" # # \description{ # @get "title" by assigning @NULL to these fields. # } # # @synopsis # # \arguments{ # \item{recursive}{If @TRUE, the same method is called also on all # fields that are @see "Object":s. Circular dependencies can exists.} # \item{gc}{If @TRUE, the garbage collector is called, otherwise not.} # \item{...}{Not used.} # } # # \value{ # Returns itself (invisible). # } # # @examples "../incl/gc.clearCache.Rex" # # @author # # \seealso{ # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("clearCache", "Object", function(this, recursive=TRUE, gc=FALSE, ...) { env <- attr(this, ".env"); fields <- getFieldModifier(this, "cached"); for (field in fields) { # Or remove them? assign(field, NULL, envir=env); } this <- clearLookupCache(this); if (recursive) { # Make sure that this object has not already been called # earlier in the same clear-cache request. if (!exists("...clearCache", envir=env, inherits=FALSE)) { assign("...clearCache", TRUE, envir=env); on.exit(rm(list="...clearCache", envir=env)); fields <- getFields(this, private=TRUE); for (field in fields) { object <- get(field, envir=env, inherits=FALSE); if (inherits(object, "Object")) { clearCache(object, recursive=TRUE, gc=FALSE); } } } } # Run the garbage collector? if (gc) base::gc(); invisible(this); }) ###########################################################################/** # @RdocMethod getFieldModifiers # @aliasmethod getFieldModifier # # @title "Gets all types of field modifiers" # # \description{ # @get "title", if any. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a named @list. # } # # @author # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("getFieldModifiers", "Object", function(this, ...) { env <- attr(this, ".env"); if (!exists("...modifiers", envir=env, inherits=FALSE)) { return(list()); } get("...modifiers", envir=env, inherits=FALSE); }, protected=TRUE) setMethodS3("getFieldModifier", "Object", function(this, name, ...) { getFieldModifiers(this, ...)[[name]]; }, protected=TRUE) setMethodS3(".DollarNames", "Object", function(x, pattern="") { ns <- getNamespace("utils") if (exists("findMatches", mode="function", envir=ns)) { findMatches <- get("findMatches", mode="function", envir=ns) } else { findMatches <- function(pattern, values) { grep(pattern, values, value=TRUE) } } findMatches(pattern, names(x)) }, appendVarArgs=FALSE, private=TRUE) ############################################################################ # HISTORY: # 2015-01-15 # o Now getStaticInstance() for Object also searches the parent environment. # 2014-02-22 # o DEPRECATED: Deprecated gc() for Object. Use clearCache(..., gc=TRUE) # instead. # 2014-02-21 # o CLEANUP: extend() passed a stray argument to one of the exists(), # which had no effect. # 2014-01-05 # o CLEANUP: Defunct registerFinalizer() for Object. # o Added argument 'gc=FALSE' to clearCache(). # 2013-10-13 # o Now extend() for Object only registers a finalizer if attribute # 'finalize' is TRUE. # 2013-09-25 # o CLEANUP: Deprecated registerFinalizer() for Object, which is # not used. # 2013-08-20 # o Updated getStaticInstance() for Object to search more locations. # 2013-01-08 # o BUG FIX: The hexadecimal string returned by as.character() for Object # would contain the decimal value and not the hexadecimal one. # o Added argument 'format' to getInternalAddress() for Object. # 2012-12-18 # o R CMD check for R devel no longer gives a NOTE about attach(). # 2012-11-28 # o BUG FIX: extend() for Object dropped already existing field modifiers. # 2012-11-23 # o GENERALIZATION: Now getStaticInstance(), "$"(), and "$<-"() for Object # finds static instances also in loaded namespaces (without the # corresponding packages having to be loaded). # 2012-11-07 # o BUG FIX: obj$(...) would throw an error iff the Object 'obj' # was saved/instanciated by R.oo (< 1.10.0). Code is now backward # compatible with this case. # 2012-10-14 # o Now $(...) calls (, ...). # 2012-06-22 # o Added an Rdoc paragraph to finalize() that custom finalize() methods # must be exported. # 2012-03-06 # o Now the defintion of extend() for Object no longer generates a warning # about renaming existing extend(). # 2012-02-29 # o Now gc() for Object no longer pass '...' to clearCache(), instead # the defaults of clearCache() is used. # 2011-04-03 # o Added option "R.oo::Object/finalizeOnExit". # o Added argument 'recursive' to clearCache() for recursively traversing # all elements are clearing the cache of all detected Object:s. # 2011-04-02 # o Added protected getFieldModifiers() and getFieldModifier(). # o Added clearLookupCache() for clearing internal objects stored in # the Object and that are used for faster field lookups. # o Now finalizers for Object:s are registered to be called also when # R is quit. Previously, they were only executed when an Object # was cleaned up by the garbage collector. # o CLEANUP: Dropped deprecated getInstanciationTime(). # 2011-03-11 # o Added explicit 'onexit=FALSE' to all reg.finalizer():s so it is clear # that they are not finalized when quitting R. # Why? Because in the future we may want to change this to onexit=TRUE, # but for now I don't fully understand the implications of doing so, # e.g. at what stage of the quitting process is the finalizer called # and what environments/objects/packages are available at that time? # 2011-02-01 # o ROBUSTNESS: Now using 'inherits' (not 'inherit') in all calls to # get() and exists(). # 2009-10-30 # o ROBUSTIFICATION: Added argument 'safe=TRUE' to save() of Object. # 2009-10-27 # o Removed a stray print() statement in attachLocally() for Object:s. # 2009-07-07 # o Added Rdoc comments to registerFinalizer() and added it to the package. # 2009-06-11 # o Added registerFinalizer() for Object. # 2008-05-28 # o SPELL CORRECTION: Used '...instanciation' instead of 'instantiation'. # 2008-03-25 # o BUG FIX: getInternalAddress() would return NA. Now it uses the new # getName() for environments. # 2008-01-10 # o Made the registered finalizer calling finalize() more error prone. # 2007-08-29 # o BUG FIX: If Object:s are garbage collected after R.oo has been detached, # the error 'Error in function (env) : could not find function "finalize"' # would be thrown, because the registered finalizer hook tries to call # the generic function finalize() in R.oo. We solve this by trying to # reload R.oo (and the unload it again). Special care was taken so that # Object:s allocated by R.oo itself won't cause an endless loop. # 2007-06-09 # o Added "declaration" of '.R.oo.getInternalAddress.pointer'. # o Added "declaration" of 'saveLoadReference'. # o Removed (incorrect) argument name 'list' from all substitute() calls. # 2006-10-03 # o Updated as.character() to display hexadecimal addresses longer than # 2^32 bytes. # o BUG FIX: Since getInternalAddress() coerced the address to an integer, # addresses about 2^32 bytes = 4GB got address NA. Now # getInternalAddress() and the default hashCode() return a double. # 2006-08-11 # o Added support for specifying field modifiers in the name of the fields, # e.g. "cached:foo" is specifies that the field "foo" is a cached field. # Currently the only supported modifier is "cached". The modifiers are # stored in the private list "...modifiers" in all created objects. # o Added argument ...fields so that it is possible to specify fields also # via named list object. # o Added clearCache() which assigns NULL to all fields that have modifier # "cached". The gc() method is just a conveniency method for calling # clearCache() and global gc() afterwards. # 2006-06-14 # o Added getEnvironment(). # 2006-05-15 # o Added private newInstance(), because it is quite commonly used. # Might become protected one day. # 2005-11-28 # o Added assertion code to example of static fields (?Object). # 2005-11-23 # o BUG FIX: The "$<-" function goes through alternatives where to save # the new value, e.g. set(), field, static field etc. # When a "match" found and the value was assigned, it did not return # (except for the set() match), but instead contiued search for # the rest. One effect of this was that the new value was always assign # to the static field too. Thanks Edouard Duchesnay at Service # Hospitalier Frederic Joliot, Commissariat a l'Energie Atomique, France # for spotting this. # o Minor typo corrections in the Rdoc. # o Replaced all TABs with spaces in source code. Don't know where they # came from. # 2005-07-12 # o Added an Rdoc section on "Defining static fields" with an example # showing how to do it. # 2005-06-14 # o Replaced all data.class(obj) with class(obj)[1]. # o Added attachLocally(). # 2005-06-01 # o Now load() asserts that the loaded Object inherits from the class that # the static object, which is used to call load(), is of. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-10-18 # o Typo in Rdoc example for equals(). # o Added more Rdoc comments. # 2004-05-14 # o BUG FIX: getInternalAddress() for class Object was "too" hard coded # making it not work correctly on for instance Suse Linux. Assumed fixed # positions of the hexadecimal address of the environment. Now a gsub() # with a backreference is used. Should be more safe. # 2003-11-27 # o Added a reference to my DSC-2003 paper. # 2003-10-28 # o BUG FIX: The way "$.Object" and "$<-.Object" was check if an attribute # with the same name as argument 'name' exists was not done correctly. # Now it gets the list of names of the attributes and compares to that. # 2003-10-20 # o Added argument 'compress=TRUE' to save() to make it more explicit that # compression is supported too. compression is supported by all R systems # since R v1.5.0. See ?capabilities. # o BUG FIX: If save() was called with a connection the save() method would # still interpret it as a filename. # 2003-07-07 # o From R v1.7.x extend() generated a warning saying that a vector was # compared to a scalar and only the first element was compared. Now # is.element() is used instead. # 2003-05-14 # o Slight improvement in the generation of get and set, by # using substr()<-. # 2003-04-13 # o Made isReferable() and names() private too hide the from the help # indices. # o Updated all Rdoc comments to make use of all new Rdoc features. # 2003-03-23 # o data.class() is also a method of Object, but it is not needed to # explicitly define it since it already works as expected. # 2003-01-18 # o IMPROVEMENT: Slight speed improvement in "$()" and "$()<-" in testing # for virtual fields, i.e. get() and set(). # o BUG FIX: The caching of "$()" introduced a bug that made try(throw()) # to loop forever. If was a copy'n'paste error and it works now. Found it # because when Rdoc was try to generate Rdoc files for Exception classes # it hanged. There were also other bugs related to the caching. Now the # package passes R CMD check. # o Replaced all occurences of getClass() with data.class(). Will change # the use of getClass() in the future to return a Class object. # 2003-01-17 # o Added a caching feature of "$"() to speed up access to members. The # first time a member (field, virtual field, static field, method etc) is # accessed it is done by looking it up one at the time and taking the # first existing one (in a predefined order). The second time the same # field is accessed, the name is remembered and "$"() access the right # member directly. # 2002-12-20 # o Made getInternalAddress() to return an (true) integer. # 2002-12-15 # o Added finalize(). Note that reg.finalizer() has to be done in extend() # and not the constructor of Object. Also, did not know about # reg.finalizer(), but is has apparantly been around since at least # v1.5.1 (maybe longer). # 2002-12-01 # o COMPATIBILITY FIX: Removed creation of getClass() for ANY. It won't work # with the methods package. # o Now extend() removes duplicated class attributes. # 2002-11-28 # o Added argument 'path=NULL' to save() and load(). # 2002-11-12 # o Added trial version of callSuperMethodS3(). # 2002-11-07 # o Now $() and $<-() also gets and sets attribute values too, # respectively. # 2002-11-04 # o Added getInstanciationTime(), which returns the time point when the # object was created. # 2002-10-24 # o BUG FIX: Change argument name className to ...className of extend() to # minimize risks for conflict, which gives really hard to track bugs. # 2002-10-23 # o BUG FIX: clone() was not doing clones in all situations. See comments # in the code section for explanations. # o Added hasField(). Maybe it should also include virtual and static # fields?! # 2002-10-22 # o BUG FIX: The exists() call in "$<-"() was by misstake (type) like # exists(name, value, ...) and not exists(name, ...). # o Added isField to "$" and "$<-" because if the name contains a # white space, we know that it can not be a method, it must be a field. # o BUG FIX: Have to use UseMethod() in "[[" and "[[<-". For some reason # does for instace get("$")(this, name) not work. # 2002-10-21 # o BUG FIX: getInternalAddress() did not remove temporary "connection" # variable because they are save in .GlobalEnv and not the local # environment. # o Added argument private=FALSE to attach(). # 2002-10-18 # o Wow, now static fields are supported! ...release party this weekend ;) # o Added getStaticInstance(). # 2002-10-15 # o Note that the code in Object.R does NOT rely on the fact the a method # or class/constructor has been defined using setMethodS3() or # setCl assS3(). These methods are just used for convinience and to enforce # the naming conventions. # o Created from R.oo Object.R and ideas as described on # http://www.maths.lth.se/help/R/ ############################################################################ R.oo/R/RdocException.R0000755000177400001440000000525412726216524014373 0ustar murdochusers###########################################################################/** # @RdocClass RdocException # # @title "RdocException are thrown by the Rdoc compiler" # # \description{ # @classhierarchy # # @get "title" when it fails to generate a Rd file from an Rdoc comment. # } # # @synopsis # # \arguments{ # \item{...}{Any arguments accepted by @Exception}. # \item{source}{Object specifying the source where the Rdoc error occured. # This is commonly a filename @character string.}. # } # # \section{Fields and Methods}{ # @allmethods # } # # @author # # \seealso{ # For detailed information about exceptions see @Exception. # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setConstructorS3("RdocException", function(..., source=NULL) { extend(Exception(...), "RdocException", .source = source ) }) ###########################################################################/** # @RdocMethod as.character # # \title{Gets a character string representing of the RdocException} # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("as.character", "RdocException", function(x, ...) { # To please R CMD check this <- x; paste("[", getWhen(this), "] ", class(this)[1L], " in ", getSource(this), ": ", getMessage(this), sep = ""); }) ###########################################################################/** # @RdocMethod getSource # # \title{Gets the source of the exception} # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns the source. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getSource", "RdocException", function(x, ...) { x$.source }) ############################################################################ # HISTORY: # 2012-12-28 # o Replaced all data.class(obj) with class(obj)[1]. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-10-17 # o Added more Rdoc comments. # 2003-04-28 # o Added the field source to refer to the source file in which the error # was found. # 2003-04-12 # o Created. ############################################################################ R.oo/R/ASCII.R0000755000177400001440000001615012726216524012452 0ustar murdochusers#########################################################################/** # @RdocObject ASCII # # @alias ASCII.BEL # @alias ASCII.BS # @alias ASCII.HT # @alias ASCII.LF # @alias ASCII.FF # @alias ASCII.CR # @alias ASCII.SO # @alias ASCII.SI # @alias ASCII.DC1 # @alias ASCII.DC3 # @alias ASCII.ESC # # @title "8-bit ASCII table" # # \description{ # ASCII is the 8-bit ASCII table with ASCII characters from 0-255. # } # # \examples{ # ch <- ASCII[65+1]; # ch == "A" # } # # @author # # \seealso{ # @see charToInt # @see intToChar # } # # @keyword character # @keyword internal #*/######################################################################### ASCII <- c( "","\001","\002","\003","\004","\005","\006","\007", # 000-007 "\010","\011","\012","\013","\014","\015","\016","\017", # 010-017 "\020","\021","\022","\023","\024","\025","\026","\027", # 020-027 "\030","\031","\032","\033","\034","\035","\036","\037", # 030-037 "\040","\041","\042","\043","\044","\045","\046","\047", # 040-047 "\050","\051","\052","\053","\054","\055","\056","\057", # 050-057 "\060","\061","\062","\063","\064","\065","\066","\067", # 060-067 "\070","\071","\072","\073","\074","\075","\076","\077", # 070-077 "\100","\101","\102","\103","\104","\105","\106","\107", # 100-107 "\110","\111","\112","\113","\114","\115","\116","\117", # 110-117 "\120","\121","\122","\123","\124","\125","\126","\127", # 120-127 "\130","\131","\132","\133","\134","\135","\136","\137", # 130-137 "\140","\141","\142","\143","\144","\145","\146","\147", # 140-147 "\150","\151","\152","\153","\154","\155","\156","\157", # 150-157 "\160","\161","\162","\163","\164","\165","\166","\167", # 160-167 "\170","\171","\172","\173","\174","\175","\176","\177", # 170-177 "\200","\201","\202","\203","\204","\205","\206","\207", # 200-207 "\210","\211","\212","\213","\214","\215","\216","\217", # 210-217 "\220","\221","\222","\223","\224","\225","\226","\227", # 220-227 "\230","\231","\232","\233","\234","\235","\236","\237", # 230-237 "\240","\241","\242","\243","\244","\245","\246","\247", # 240-247 "\250","\251","\252","\253","\254","\255","\256","\257", # 250-257 "\260","\261","\262","\263","\264","\265","\266","\267", # 260-267 "\270","\271","\272","\273","\274","\275","\276","\277", # 270-277 "\300","\301","\302","\303","\304","\305","\306","\307", # 300-307 "\310","\311","\312","\313","\314","\315","\316","\317", # 310-317 "\320","\321","\322","\323","\324","\325","\326","\327", # 320-327 "\330","\331","\332","\333","\334","\335","\336","\337", # 330-337 "\340","\341","\342","\343","\344","\345","\346","\347", # 340-347 "\350","\351","\352","\353","\354","\355","\356","\357", # 350-357 "\360","\361","\362","\363","\364","\365","\366","\367", # 360-367 "\370","\371","\372","\373","\374","\375","\376","\377" # 370-377 ); # We removed ASCII 0x00, because it represents an empty string in # R v2.7.0 (and maybe some earlier version) and in R v2.8.0 we will get # a warning. However, for backward compatibility we will still use it # for version prior to R v2.7.0. See also email from Brian Ripley # on 2008-04-23 on this problem. if (compareVersion(as.character(getRversion()), "2.7.0") < 0) { ASCII[1] <- eval(parse(text="\"\\000\"")); } # Alternatively one can do like this. Idea by Peter Dalgaard, # Dept. of Biostatistics, University of Copenhagen, Denmark. # ASCII <- c("\000", sapply(1:255, function(i) parse(text=paste("\"\\", # structure(i,class="octmode"), "\"", sep=""))[[1]]) ); # Some special ASCII characters. ASCII.BEL <- "\007"; ASCII.BS <- "\010"; ASCII.HT <- "\011"; ASCII.LF <- "\012"; ASCII.FF <- "\014"; ASCII.CR <- "\015"; ASCII.SO <- "\016"; ASCII.SI <- "\017"; ASCII.DC1 <- "\021"; ASCII.DC3 <- "\023"; ASCII.ESC <- "\033"; #########################################################################/** # @RdocDefault charToInt # # @title "Converts a vector of ASCII characters into a vector of integers" # # \description{ # Converts a @vector of ASCII @characters to a equal length vector of ASCII # @integers. # } # # @synopsis # # \arguments{ # \item{ch}{A @character @vector.} # \item{...}{Not used.} # } # # \value{ # Returns an ASCII @integer @vector. # } # # @author # # \examples{ # i <- charToInt(unlist(strsplit("Hello world!", split=NULL))) # # Gives: 72 101 108 108 111 32 119 111 114 108 100 33 # ch <- intToChar(c(72,101,108,108,111,32,119,111,114,108,100,33)) # # Gives: "H" "e" "l" "l" "o" " " "w" "o" "r" "l" "d" "!" # } # # \seealso{ # @see intToChar # @see "base::utf8Conversion". # @see "base::rawConversion" # } # # @keyword character # @keyword internal #*/######################################################################### setMethodS3("charToInt", "default", function(ch, ...) { match(ch, ASCII) - 1L; }) #########################################################################/** # @RdocDefault intToChar # # @title "Converts a vector of integers into a vector of ASCII characters" # # \description{ # Converts a vector of ASCII integers to a equal length vector of ASCII # characters. To make sure that all values in the input vector are in # the range [0,255], the input vector is taken modulo 256. # } # # @synopsis # # \arguments{ # \item{i}{An @integer @vector.} # \item{...}{Not used.} # } # # \value{ # Returns an ASCII @character @vector. # } # # @author # # \examples{ # i <- charToInt(unlist(strsplit("Hello world!", split=NULL))) # # Gives: 72 101 108 108 111 32 119 111 114 108 100 33 # ch <- intToChar(c(72,101,108,108,111,32,119,111,114,108,100,33)) # # Gives: "H" "e" "l" "l" "o" " " "w" "o" "r" "l" "d" "!" # } # # \seealso{ # @see "base::utf8Conversion". # @see charToInt # } # # @keyword character # @keyword internal #*/######################################################################### setMethodS3("intToChar", "default", function(i, ...) { ASCII[i %% 256 + 1]; }) ############################################################################ # HISTORY: # 2015-01-27 # o Now charToInt() returns integers (was numerics). # 2013-08-23 # o CLEANUP: Hiding charToInt() and intToChar() from help indices. # 2009-05-18 # o DOC FIX: The titles for intToChar() and charToInt() where mixed up. # Thanks to Jens Philip Hoehmann for reporting this. # 2008-05-08 # o Updated the ASCII vector to deal with updates of '\000'. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2002-10-20 # o Added keywords to the Rdoc comments. # 2002-05-26 # * Changed the \keyword{}'s to contain valid keyword as in KEYWORDS.db. # 2002-02-04 # * Added alternative idea of creating the ASCII table. # 2002-01-29 # * Rewritten to make use of setMethodS3. # 2001-08-06 # * Moved ASCII back to R.oo from R.base. It is needed by the String class. # By moving it back R.oo is stand-alone again. # 2001-07-28 # * Also defined up the ASCII.BEL constants etc. # * Moved the ASCII stuff from R.oo to R.base. # 2001-07-13 # * Made all methods using UseMethod. # 2001-06-07 # * Added [R] documents to ASCII, charToInt and intToChar. # 2001-04-02 # * Created! ############################################################################ R.oo/R/Class.misc.R0000755000177400001440000001410612726216524013620 0ustar murdochusers###########################################################################/** # @set "class=Class" # # @RdocMethod getRdDeclaration # # @title "Gets the class declaraction in Rd format" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getRdDeclaration", "Class", function(this, ...) { s <- "public"; # visibility(this); if (isAbstract(this)) s <- paste(s, "abstract"); if (isStatic(this)) s <- paste(s, "static"); if (inherits(this, "Class")) s <- paste(s, "class") else throw(getName(this), " is neither a class nor an interface."); s <- paste(s, " \\bold{", getName(this), "}\\cr\n", sep=""); links <- getSuperclasses(this); if (length(links) > 0) { name <- links[1]; link <- name; cls <- .getClassByName(name, mustExist=FALSE); if (inherits(cls, "Class")) { pkg <- getPackage(cls); if (is.null(pkg)) link <- paste("\\link{", link ,"}", sep="") else link <- paste("\\link[", pkg, "]{", link ,"}", sep=""); if (isAbstract(cls)) link <- paste("\\emph{", link, "}", sep=""); } paste("\\code{", link ,"}", sep=""); s <- paste(s, "extends ", link, "\\cr\n", sep=""); } s; }, private=TRUE); ###########################################################################/** # @RdocMethod getRdMethods # # @title "Gets the methods of a class in Rd format" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{visibilities}{A @character string specifying what types of methods # to return.} # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getRdMethods", "Class", function(class, visibilities=c("private", "protected", "public"), ...) { className <- getName(class); methods <- getMethods(class, private=TRUE); # Excludes empty classes! methods <- methods[[className]]; methods <- names(methods); src <- "\\bold{Methods:}\\cr\n"; tmpsrc <- "\\tabular{rll}{\n"; count <- 0; for (method in methods) { fcnName <- paste(method, className, sep="."); fcn <- .getS3Method(fcnName); modifiers <- attr(fcn, "modifiers"); if (Rdoc$isVisible(modifiers, visibilities)) { helpName <- Rdoc$createName(getName(class), method, escape=TRUE); label <- method; title <- Rdoc$getRdTitle(class, method); package <- attr(title, "package"); if (is.null(package)) package <- Rdoc$package; # Is there a specific help document for this method or not? if (!is.null(title)) { link <- paste("\\link[", package, ":", helpName, "]{", label, "}", sep=""); } else { link <- label; } item <- paste(" \\tab \\code{", link, "} \\tab ", sep=""); # Create the title if (!is.null(title)) { if (title != "") item <- paste(item, title, ".\\cr", sep=""); } else { item <- paste(item, " -\\cr", sep=""); } tmpsrc <- paste(tmpsrc, item, "\n", sep=""); count <- count + 1; } # if(isVisible(...)) } tmpsrc <- paste(tmpsrc, "}\n", sep=""); # end of \tabular{rll} if (count == 0) src <- paste(src, "\\emph{No methods defined}.\n", sep="") else src <- paste(src, tmpsrc, sep=""); src; }, private=TRUE); ###########################################################################/** # @RdocMethod getRdHierarchy # # @title "Gets the class hierarchy in Rd format" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # @keyword documentation #*/########################################################################### setMethodS3("getRdHierarchy", "Class", function(this, ...) { package <- getPackage(this); s <- paste("Package: ", package, "\\cr\n"); what <- if (inherits(this, "Class")) "Class" else "Interface"; s <- paste(s, "\\bold{", what, " ", getName(this), "}\\cr\n\n", sep=""); indent <- ""; for (extend in rev(getSuperclasses(this))) { link <- sapply(extend, FUN=function(name) { # isAbstract <- FALSE; link <- name; cls <- .getClassByName(name, mustExist=FALSE); if (inherits(cls, "Class")) { pkg <- getPackage(cls); if (is.null(pkg)) { link <- paste("\\link{", link ,"}", sep="") } else { link <- paste("\\link[", pkg, "]{", link ,"}", sep=""); } # if (isAbstract(cls)) { # link <- paste("\\emph{", link, "}", sep=""); # isAbstract <- TRUE; } paste("\\code{", link ,"}", sep=""); }); if (indent == "") { s <- paste(s, link, "\\cr\n", sep=""); indent <- "~~"; } else { s <- paste(s, "\\code{", indent, "+--}", link, "\\cr\n", sep=""); indent <- paste(indent, "~~~~~", sep=""); } s <- paste(s, "\\code{", indent, "|}\\cr\n", sep=""); } link <- paste("\\code{", getName(this), "}", sep=""); if (isAbstract(this)) link <- paste("\\emph{", link, "}", sep=""); s <- paste(s, "\\code{", indent, "+--}", link, "\\cr\n\n", sep=""); s; }, private=TRUE); ######################################################################### # HISTORY: # 2014-03-30 # o BUG FIX: Now getRdDeclaration(), getRdHierarchy() and getRdMethods() # for Class handles also non-exported methods and Classes. # 2006-05-29 # o Added support for visibility of getRdMethods(). # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-10-22 # o BUG FIX: getRdMethods() returned empty \tabular{rll}{} if no methods # exist, but this gives an error in R CMD Rdconv. # 2004-10-18 # o BUG FIX: Invalid filenames and link names are now escaped. # 2004-10-17 # o Added Rdoc comments. ######################################################################### R.oo/R/030.ObjectClassFunctions.R0000755000177400001440000001243612726216524016213 0ustar murdochusers############################################################################ # This source code file contains constructor and function definitions that # are used for loading this package only. ############################################################################ # To please R CMD check attachX <- base::attach; attachX(list( Object = function(core=NA, finalize=TRUE) { # Create a new environment and wrap it up as a private field of a list. this <- core; this.env <- new.env(); attr(this, ".env") <- this.env; class(this) <- "Object"; if (getOption("R.oo::Object/instantiationTime", FALSE)) { attr(this, "...instantiationTime", Sys.time()); } finalizer <- function(env) { # Nothing needed to be done in this temporary finalizer factory, # because it is only utilized by this very package and none of # the classes in this package created Object:s that needs to be # finalized. } # finalizer() # Should this Object be finalized? if (finalize) { onexit <- getOption("R.oo::Object/finalizeOnExit", FALSE); reg.finalizer(this.env, finalizer, onexit=onexit); } assign("...finalize", finalize, envir=this.env, inherits=FALSE); this; }, extend = function(this, ...className, ..., ...finalize=TRUE) { fields <- list(...); names <- names(fields); this.env <- attr(this, ".env"); for (name in names) assign(name, fields[[name]], envir=this.env); class(this) <- c(...className, class(this)); # Override this (=unregister finalizer) according to argument # '...finalize' of extend()? if (!is.na(...finalize) && !isTRUE(...finalize)) { # Unregister finalizer (by registering a dummy one) reg.finalizer(this.env, f=function(...) {}); } this; }, Class = function(name=NULL, constructor=NULL) { if (is.null(name)) { constructor <- NA; } else if (!is.function(constructor)) { throw("Argument 'constructor' must be a function: ", mode(constructor)); } # This is an example where one wants to have the core of an Object to not # be NA, but something else. this <- extend(Object(constructor), "Class", .staticInstance = NULL ); this; } ), name="R.oo"); # Cleanup rm(list="attachX"); ############################################################################ # HISTORY: # 2014-02-22 # o Now the temporary registered finalizer for Object:s returns a # finalizer function that does nothing. This is possible because # none of the classes in this package produces Object:s that needs # finalization. # 2014-01-05 # o BUG FIX: The temporary finalizer() registered for Object while # loading the R.oo package itself would cause cyclic loading of R.oo. # The reason was that it checked whether R.oo was available or not, # by only looking at attached namespaces but not loaded ones. # 2013-10-13 # o Added argument 'finalize' to Object() and '...finalize' to extend() # for Object. The latter override the former. # 2012-12-18 # o R CMD check for R devel no longer gives a NOTE about attach(). # 2012-11-28 # o LIMITATION: Registered finalizer for pure Object:s (i.e. excluding # those which are of a subclass of Object) will no longer be called # if the R.oo package has been detached. # 2011-04-02 # o Added option "R.oo::Object/finalizeOnExit". # o Added option "R.oo::Object/instantiationTime", which controls # whether the instantiation timestamp should be set when instantiating # an Object. Analogoulsy, option "R.oo::BasicObject/instantiationTime" # controls ditto for a BasicObject. # 2011-03-11 # o Added explicit 'onexit=FALSE' to all reg.finalizer():s so it is clear # that they are not finalized when quitting R. See 050.Object.R too. # 2008-05-28 # o SPELL CORRECTION: Used '...instanciation' instead of 'instantiation'. # 2008-01-10 # o Made the registered finalizer calling finalize() more error prone. # 2007-08-29 # o BUG FIX: If Object:s are garbage collected after R.oo has been detached, # the error 'Error in function (env) : could not find function "finalize"' # would be thrown, because the registered finalizer hook tries to call # the generic function finalize() in R.oo. We solve this by trying to # reload R.oo (and the unload it again). Special care was taken so that # Object:s allocated by R.oo itself won't cause an endless loop. # 2005-06-10 # o Added reg.finalizer() to Object() for pure Object:s. However, it must # be done in extend.Object() too. # 2004-10-18 # o Updated the arguments for extend() so that they are identical to the # ones in extend.Object. # 2002-12-15 # o Added reg.finalizer() to the Object class. # 2002-11-04 # o Added the feature to timestamp each object when it is instanciated. # 2002-10-17 # o Removed obsolete "modifiers<-"(). # o Added also "Object" to the class attribute to make static methods to # work. # 2002-10-16 # o There are times when # generic <- function(...) UseMethod() # is not working, for example # fcn <- get("generic"); fcn(myObj, ...); # For this reason, always do method dispatching using the name explicitly; # generic <- function(...) UseMethod("generic") # 2002-10-15 # o Created from R.oo Object.R and ideas as described on # http://www.maths.lth.se/help/R/ ############################################################################ R.oo/R/zzz.rJava-tweaks.R0000644000177400001440000000217112726216524015010 0ustar murdochusers## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ## WORKAROUND for namespace clashes between R.oo and rJava ## where some R.oo S3 methods for Object and Exception ## override the intended ones for rJava objects with ## class attributes containing these classes as well. ## ## See https://github.com/s-u/rJava/issues/60 ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .fixMethodS3 <- function(generic, class, expr=NULL, envir=parent.frame()) { method <- sprintf("%s.%s", generic, class) expr <- substitute(expr) f <- get(method, mode="function", envir=getNamespace("R.oo"), inherits=TRUE) if (is.null(expr)) { x <- as.symbol(names(formals(f)[1])) expr <- substitute( if(!.isRoo(x)) return(NextMethod()) , list(x=x)) } body(f) <- substitute({ a b }, list(a=expr, b=body(f))) assign(method, f, envir=envir, inherits=TRUE) invisible(f) } ## .fixMethodS3() .isRoo <- function(x) is.environment(attr(x, ".env")) .fixMethodS3("names", "Object") .fixMethodS3("$", "Object") .fixMethodS3("[[", "Object") .fixMethodS3("print", "Object") .fixMethodS3("print", "Exception") R.oo/R/classRepresentation.misc.R0000755000177400001440000001206612726216524016606 0ustar murdochusers###########################################################################/** # @set "class=classRepresentation" # # @RdocMethod getKnownSubclasses # @keyword internal # # @title "Gets the known subclasses" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # @keyword documentation #*/########################################################################### setMethodS3("getKnownSubclasses", "classRepresentation", function(this, ...) { this@subclasses$signature; }) ###########################################################################/** # @RdocMethod getSuperclasses # @keyword internal # # @title "Gets the superclasses" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # @keyword documentation #*/########################################################################### setMethodS3("getSuperclasses", "classRepresentation", function(this, ...) { superClasses <- NULL; for (contain in attr(this, "contains")$vector) { superClasses <- c(superClasses, contain@superClass); } superClasses; }) ###########################################################################/** # @RdocMethod getRdHierarchy # @keyword internal # # @title "Gets the class hierarchy in Rd format" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # @keyword documentation #*/########################################################################### setMethodS3("getRdHierarchy", "classRepresentation", function(this, ...) { package <- "???"; name <- this@className; superClasses <- getSuperclasses(this); s <- paste("Package: ", package, "\\cr\n"); s <- paste(s, "\\bold{Class ", name, "}\\cr\n\n", sep=""); indent <- ""; for (extend in rev(superClasses)) { link <- sapply(extend, FUN=function(name) { link <- name; if (isClass(name)) { cls <- getClass(name); link <- paste("\\link{", link ,"}", sep="") } paste("\\code{", link ,"}", sep=""); }); if (indent == "") { s <- paste(s, link, "\\cr\n", sep=""); indent <- "~~"; } else { s <- paste(s, "\\code{", indent, "+--}", link, "\\cr\n", sep=""); indent <- paste(indent, "~~~~~", sep=""); } s <- paste(s, "\\code{", indent, "|}\\cr\n", sep=""); } link <- paste("\\code{", name, "}", sep=""); s <- paste(s, "\\code{", indent, "+--}", link, "\\cr\n\n", sep=""); s; }, private=TRUE); ###########################################################################/** # @RdocMethod getRdDeclaration # @keyword internal # # @title "Gets the class declaration in Rd format" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # @keyword documentation #*/########################################################################### setMethodS3("getRdDeclaration", "classRepresentation", function(this, ...) { name <- this$className; s <- "public"; # visibility(this); s <- paste(s, "class") s <- paste(s, " \\bold{", name, "}\\cr\n", sep=""); links <- getSuperclasses(this); if (length(links) > 0) { name <- links[1]; link <- name; # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (exists(name, mode="function")) { cls <- get(name, mode="function"); if (inherits(cls, "Class")) { pkg <- getPackage(cls); if (is.null(pkg)) link <- paste("\\link{", link ,"}", sep="") else link <- paste("\\link[", pkg, "]{", link ,"}", sep=""); if (isAbstract(cls)) link <- paste("\\emph{", link, "}", sep=""); } } paste("\\code{", link ,"}", sep=""); s <- paste(s, "extends ", link, "\\cr\n", sep=""); } s; }, private=TRUE); ###########################################################################/** # @RdocMethod getRdMethods # @keyword internal # # @title "Gets the methods in Rd format" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{visibility}{-} # \item{trial}{-} # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # @keyword documentation #*/########################################################################### setMethodS3("getRdMethods", "classRepresentation", function(class, visibility=c("public", "protected", "private"), trial=FALSE, ...) { src <- NULL; src <- paste(src, "\\emph{No methods defined}.\n", sep="") src; }, private=TRUE); ######################################################################### # HISTORY: # 2005-06-08 # o Added keyword "internal" to all methods, because of change in Rdoc. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-10-17 # o Added Rdoc comments. ######################################################################### R.oo/R/getName.environment.R0000644000177400001440000000275212726216524015545 0ustar murdochusers###########################################################################/** # @class "environment" # @RdocMethod getName # # @title "Gets the name of an environment" # # \description{ # @get "title", e.g. \code{"R_GlobalEnv"} or \code{"0x01ddd060"}. # } # # @synopsis # # \arguments{ # \item{env}{An @environment.} # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{ # name <- getName(globalenv()) # print(name) # stopifnot(identical(name, "R_GlobalEnv")) # # getName(new.env()) # } # # @author # # \seealso{ # \code{\link[base:environment]{environmentName}()}. # } # # \keyword{programming} #*/########################################################################### setMethodS3("getName", "environment", function(env, ...) { # base::environmentName() was added to R v2.5.0 if (exists("environmentName", mode="function")) { name <- environmentName(env); } else { name <- ""; } if (name == "") { name <- capture.output(print.default(env)); name <- name[1]; # Just in case name <- gsub("[<]*environment:[ ]*([^>]*)[>]", "\\1", name); } name; }) ############################################################################ # HISTORY: # 2008-03-25 # o Added getName() for 'environment':s. It extends base::environmentName() # to return the "pointer" if not a name. It is used by # getInternalAddress() of Object in R.oo. # o Created. ############################################################################ R.oo/R/BasicObject.R0000755000177400001440000005575012763175003014000 0ustar murdochusers###########################################################################/** # @RdocClass BasicObject # # @title "A root class like Object but without references" # # \description{ # R.oo\cr # \bold{Class BasicObject}\cr # # public class \bold{BasicObject}\cr # } # # @synopsis # # \arguments{ # \item{core}{The core value of the object.} # } # # \section{Fields and Methods}{ # @allmethods # } # # @author # # \keyword{programming} # \keyword{methods} # \keyword{internal} #*/########################################################################### setConstructorS3("BasicObject", function(core=NULL) { # Create a new environment and wrap it up as a private field of a list. if (is.null(core)) core <- NA; this <- core; class(this) <- unique(c("BasicObject", class(this))); if (getOption("R.oo::BasicObject/instantiationTime", FALSE)) { attr(this, "...instantiationTime") <- Sys.time(); } this; }) ###########################################################################/** # @RdocMethod isReferable # # @title "Checks if the object is referable or not" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @logical value, which by default is @TRUE for all # @see "BasicObject"'s. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("isReferable", "BasicObject", function(this, ...) { TRUE; }) # isReferable() ###########################################################################/** # @RdocMethod as.character # # @title "Gets a character string representing the object" # # \description{ # @get "title". # } # # @synopsis # # \value{ # Returns a @character string representation of the object. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("as.character", "BasicObject", function(x, ...) { # To please R CMD check this <- x; paste(class(this)[1L], ": ", getInstantiationTime(this), sep=""); }) # as.character() ###########################################################################/** # @RdocMethod getInstantiationTime # # @title "Gets the time when the object was instantiated" # # \description{ # @get "title" (created) as a POSIXt object. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a POSIXt object, which extends class POSIXct. # } # # \details{ # The instantiation timestamp is set when the object is created, and # only of option \code{"R.oo::BasicObject/instantiationTime"} is @TRUE. # } # # \seealso{ # For more about time formats and POSIX see @see "base::DateTimeClasses". # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("getInstantiationTime", "BasicObject", function(this, ...) { time <- attr(this, "...instantiationTime"); if (!is.null(time)) return(time); # Backward compatibility (due to a SPELLING ERROR in an earlier version) time <- attr(this, "...instanciationTime"); NULL; }) ###########################################################################/** # @RdocMethod hashCode # # @title "Gets a hash code for the object" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns an @integer. # } # # @author # # \seealso{ # @seemethod "equals" # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("hashCode", "BasicObject", function(this, ...) { as.integer(getInstantiationTime(this)); }) ###########################################################################/** # @RdocMethod equals # # @title "Compares an object with another" # # \description{ # @get "title" and returns @TRUE if they are equal. # The equal property must be # # 1) \emph{reflexive}, i.e. \code{equals(o1,o1)} should be @TRUE. # # 2) \emph{symmetric}, i.e. \code{equals(o1,o2)} is @TRUE if and only # if \code{equals(o2,o1)} is @TRUE. # # 3) \emph{transitive}, i.e. \code{equals(o1,o2)} is @TRUE and # \code{equals(o2,o3)} is @TRUE, then \code{equals(o1,o3)} should # be @TRUE. # # 5) \emph{consistent}, i.e. \code{equals(o1,o2)} should return the same # result on multiple invocations as long as noting has changed. # # 6) \code{equals(o1,NULL)} should return @FALSE. # # By default, the method returns @TRUE if and only if the two # references compared refer to the same @see "BasicObject", i.e. # \code{( !is.null(obj) && (hashCode(this) == hashCode(obj)) )}. # } # # @synopsis # # \arguments{ # \item{other}{The other object this object should be compared to.} # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the objects are equal, otherwise @FALSE. # } # # \seealso{ # @seeclass # } # # @author # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("equals", "BasicObject", function(this, other, ...) { ( !is.null(other) && (hashCode(this) == hashCode(other)) ); }) ###########################################################################/** # @RdocMethod print # # @title "Prints an BasicObject" # # \description{ # For all objects of class @see "BasicObject", this method will print the # value of \code{as.character()} of the object. Note that this function is # not called if the argument is not an object of class @see "BasicObject". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # @author # # \seealso{ # @see "base::print.default" # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("print", "BasicObject", function(x, ...) { print(as.character(x)); }) # print() ###########################################################################/** # @RdocMethod objectSize # # @title "Gets the size of the BasicObject in bytes" # # \description{ # @get "title" by summing the sizes of all its members. For this reason, # the size of memory the BasicObject actually allocates might vary slighty. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns an @integer specifying the size of the object in number of bytes. # } # # @author # # \seealso{ # @see "utils::object.size". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("objectSize", "BasicObject", function(this, ...) { object.size(this); }) # objectSize() ###########################################################################/** # @RdocMethod getFields # # @title "Returns the field names of an BasicObject" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{private}{If @TRUE, private fields will also be returned, # otherwise only public fields are returned.} # \item{...}{Not used.} # } # # \value{ # Returns a @character @vector of field names. # } # # @author # # \seealso{ # To check if a field exists or not, see @seemethod "hasField". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("getFields", "BasicObject", function(this, private=FALSE, ...) { members <- names(attributes(this)); if (!private) { isPrivate <- (regexpr("^[.].*", members) != -1); members <- members[!isPrivate]; } members; }) # getFields() ###########################################################################/** # @RdocMethod hasField # # @title "Checks if a field exists or not" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{field}{@vector of fields to be checked if they exists or not.} # \item{...}{Not used.} # } # # \value{ # Returns a @logical @vector indicating for each field if it exists or not. # } # # @author # # \seealso{ # To get the fields of an Object, see @seemethod "getFields". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("hasField", "BasicObject", function(this, field, ...) { !is.na(match(field, getFields(this, private=TRUE))); }) # hasFields() ###########################################################################/** # @RdocMethod attach # # @title "Attach an BasicObject to the R search path" # # \description{ # Attach the members of an BasicObject to the \R search path. # # If trying to attach the same BasicObject twice without detaching it # inbetween, a @warning will be generated and nothing will be done. # } # # @synopsis # # \arguments{ # \item{private}{If @TRUE, private fields will also be attached, # otherwise not.} # \item{pos}{The position at in search path where the BasicObject should be # inserted.} # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the @see "BasicObject" was attached, otherwise @FALSE. # } # # @author # # \seealso{ # @seemethod "detach" and @see "base::attach", @see "base::detach". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("attach", "BasicObject", function(this, private=FALSE, pos=2, ...) { # To please R CMD check attachX <- base::attach; attachName <- as.character.BasicObject(this); if (is.element(attachName, search())) { warning(paste("Object is already attached:", attachName)); return(invisible(FALSE)); } if (is.list(this)) { attachX(unclass(this), name=attachName, pos=pos); } else { attachX(list(), name=attachName, pos=pos); } members <- names(attributes(this)); for (member in members) { assign(member, attr(this, member), pos=pos); } return(invisible(TRUE)); }) # attach() ###########################################################################/** # @RdocMethod detach # # @title "Detach an BasicObject from the R search path" # # \description{ # Detach, from the \R search path, an BasicObject that has previously been # attached. If the BasicObject was not attached, a @warning will be # generated and nothing will be done. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns @TRUE if the BasicObject was detached, otherwise @FALSE. # } # # @author # # \seealso{ # @seemethod "attach" and @see "base::attach", @see "base::detach". # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("detach", "BasicObject", function(this, ...) { attachName <- as.character.BasicObject(this); if (!is.element(attachName, search())) { warning(paste("Object is not attached:", attachName)); return(invisible(FALSE)); } pos <- which(search() == attachName); if (length(pos) == 1L) detach(pos=pos); return(invisible(TRUE)); }) # detach() ###########################################################################/** # @RdocMethod extend # # @title "Extends another class" # # \description{ # via a mechanism known as "parasitic inheritance". # Simply speaking this method "extends another class". What is actually # happening is that it creates an instance of class name \code{...className}, # by taking another BasicObject instance and add \code{...className} to # the class list and also add all the named values in @... as fields to the # new instance. # # The method should be used by the constructor of a class and nowhere else. # } # # @synopsis # # \arguments{ # \item{...className}{The name of new class.} # \item{...}{Named values representing the fields of the new instance.} # } # # \value{ # Returns an BasicObject of class \code{className}. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("extend", "BasicObject", function(this, ...className, ...) { fields <- list(...); names <- names(fields); for (ii in seq_along(fields)) { name <- names[ii]; if (is.null(name) || nchar(name) == 0) { callNames <- names(sys.call()); callNames <- callNames[nchar(callNames) > 0]; matchNames <- paste("^", callNames, sep=""); for (jj in seq_along(matchNames)) { if (regexpr(matchNames[jj], "...className") != -1) { className <- sys.call()[[3]]; throw("Could not set field of class (probably called ", className, ") because the field name is a prefix to the argument name ", "\"...className\": ", callNames[jj]); } } # for (jj ...) throw("Missing name of field #", ii, " in class definition: ", ...className); } attr(this, name) <- fields[[ii]]; } # for (ii ...) class(this) <- c(...className, class(this)); this; }) # extend() ###########################################################################/** # @RdocMethod newInstance # # @title "Creates a new instance of the same class as this object" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Arguments passed to the constructor of the corresponding # @see "BasicObject" class.} # } # # \value{ # Returns a reference to an instance of @see "BasicObject" or a subclass thereof. # } # # @author # # \seealso{ # @see "newInstance.Object". # @see "newInstance.Class". # @seeclass # } # # @keyword programming # @keyword methods #*/########################################################################### setMethodS3("newInstance", "BasicObject", function(this, ...) { # Creates a new instance of the same class clazz <- Class$forName(class(this)[1]); newInstance(clazz, ...); }, private=TRUE) ###########################################################################/** # @RdocMethod $ # @aliasmethod [[ # # @title "Makes the fields and methods of an BasicObject accessable via the \$ and the [[ operator" # # \description{ # @get "title". # } # # \usage{ # \method{$}{BasicObject}(this, name) # \method{[[}{BasicObject}(this, name, exact=TRUE) # } # # \arguments{ # \item{name}{The name of the field or method to be accessed.} # } # # \value{ # Returns the value of a field or a method (@function). # If no such field or method exists, @NULL is returned. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("$", "BasicObject", function(this, name) { memberAccessorOrder <- attr(this, ".memberAccessorOrder"); if (is.null(memberAccessorOrder)) memberAccessorOrder <- c(1,2,3,4); for (memberAccessor in memberAccessorOrder) { if (memberAccessor == 1) { firstChar <- substr(name, 1,1); isPrivate <- identical(firstChar, "."); isField <- (regexpr(" ", name) != -1); # Do not try to access private fields using a get() method, # because such a functionality means that the user *expects* that # there actually is a field called '.', which he or she # should not do since it is a private field! if (!isField && !isPrivate && is.null(attr(this, "disableGetMethods"))) { # 1. Is it a get() method? getName <- paste(c("get", toupper(firstChar), substr(name,2,nchar(name))),collapse=""); getMethodNames <- paste(getName, class(this), sep="."); for (getMethodName in getMethodNames) { # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (exists(getMethodName, mode="function")) { ref <- this; attr(ref, "disableGetMethods") <- TRUE; return( get(getMethodName, mode="function")(ref) ); } } } } else if (memberAccessor == 2) { # 2. Is it a field? value <- attr(this, name); if (!is.null(value)) return(value); } else if (memberAccessor == 3) { # 3. Is it a static S3 method? methodNames <- paste(name, class(this), sep="."); for (methodName in methodNames) { # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (exists(methodName, mode="function")) { # # Alt 1. Rather "obfuscated" code # method <- get(methodName, mode="function"); # fcn <- function(...) method(this, ...); # Alt 3. Using explicit UseMethod() code code <- sprintf("function(...) \"%s\"(this, ...)", name); fcn <- eval(base::parse(text=code)); return(fcn); } } } } # for (memberAccessor in memberAccessorOrder) # 5. Otherwise, return NULL. NULL; }) # $() setMethodS3("[[", "BasicObject", function(this, name, exact=TRUE) { .subset2Internal(this, name=name, exact=exact) }) setMethodS3(".subset2Internal", "BasicObject", function(this, name, exact=TRUE, ...) { memberAccessorOrder <- attr(this, ".memberAccessorOrder"); if (is.null(memberAccessorOrder)) memberAccessorOrder <- c(1,2,3,4); for (memberAccessor in memberAccessorOrder) { if (memberAccessor == 1) { firstChar <- substr(name, 1,1); isPrivate <- identical(firstChar, "."); isField <- (regexpr(" ", name) != -1); # Do not try to access private fields using a get() method, # because such a functionality means that the user *expects* that # there actually is a field called '.', which he or she # should not do since it is a private field! if (!isField && !isPrivate && is.null(attr(this, "disableGetMethods"))) { # 1. Is it a get() method? getName <- paste(c("get", toupper(firstChar), substr(name,2,nchar(name))),collapse=""); getMethodNames <- paste(getName, class(this), sep="."); for (getMethodName in getMethodNames) { # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (exists(getMethodName, mode="function")) { ref <- this; attr(ref, "disableGetMethods") <- TRUE; return( get(getMethodName, mode="function")(ref) ); } } } } else if (memberAccessor == 2) { # 2. Is it a field? value <- attr(this, name); if (!is.null(value)) return(value); } else if (memberAccessor == 3) { # 3. Is it a method? methodNames <- paste(name, class(this), sep="."); for (methodName in methodNames) { # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (exists(methodName, mode="function")) { method <- get(methodName, mode="function"); return( function(...) method(this, ...) ); } } } } # for (memberAccessor in memberAccessorOrder) # 5. Otherwise, return NULL. NULL; }, private=TRUE) # .subset2Internal() ###########################################################################/** # @RdocMethod $<- # @aliasmethod [[<- # # @title "Makes the fields and methods of an BasicObject assignable via the \$<- and the [[<- operator" # # \description{ # @get "title". # } # # \usage{ # \method{$}{BasicObject}(this, name) <- value # \method{[[}{BasicObject}(this, name) <- value # } # # \arguments{ # \item{name}{The name of the \preformatted{set()} method or the # name of the field to be assigned the new value.} # \item{value}{The value to be assigned.} # } # # \value{ # Returns itself, i.e. \code{this}, as all \code{$<-} methods must do. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("$<-", "BasicObject", function(this, name, value) { memberAccessorOrder <- attr(this, ".memberAccessorOrder"); if (is.null(memberAccessorOrder)) memberAccessorOrder <- c(1,2,3,4); for (memberAccessor in memberAccessorOrder) { if (memberAccessor == 1) { # Do not try to access private fields using a set() method, # because such a functionality means that the user *expects* that # there actually is a field called '.', which he or she # should not do since it is a private field! firstChar <- substr(name, 1,1); isPrivate <- identical(firstChar, "."); isField <- (regexpr(" ", name) != -1); if (!isField && !isPrivate && is.null(attr(this, "disableSetMethods"))) { # 1. Is it a set() method? setName <- paste(c("set", toupper(firstChar), substr(name,2,nchar(name))),collapse=""); setMethodNames <- paste(setName, class(this), sep="."); for (setMethodName in setMethodNames) { # TO DO/FIX ME: This part only works when packages are attached. # /HB 2013-10-08 if (exists(setMethodName, mode="function")) { ref <- this; attr(ref, "disableSetMethods") <- TRUE; this <- get(setMethodName, mode="function")(ref, value); attr(this, "disableSetMethods") <- NULL; return(this); } } } } else if (memberAccessor == 2) { # 2. If there exists a field, assign the value to that field. if (!is.null(attr(this, name))) { attr(this, name) <- value; return(this); } } else if (memberAccessor == 4) { # 4. Otherwise, assign the value to a new field. attr(this, name) <- value; return(this); } } # for (memberAccessor in memberAccessorOrder) this; }) # $<-() setMethodS3("[[<-", "BasicObject", function(this, name, value) { UseMethod("$<-"); }) # "[[<-"() setMethodS3(".DollarNames", "BasicObject", .DollarNames.Object, appendVarArgs=FALSE, private=TRUE) ############################################################################ # HISTORY: # 2012-12-28 # o Replaced all data.class(obj) with class(obj)[1]. # 2012-12-18 # o R CMD check for R devel no longer gives a NOTE about attach(). # 2012-10-14 # o Now $(...) calls (, ...). # 2012-06-22 # o ROBUSTNESS: Now constructor BasicObject() is guaranteed to return # an object with non-duplicated class attribute elements. # o GENERALIZATION: Added newInstance() for BasicObject. # 2011-04-02 # o Added option "R.oo::Object/instantiationTime", which controls # whether the instantiation timestamp should be set when instantiating # an Object. Analogoulsy, option "R.oo::BasicObject/instantiationTime" # controls ditto for a BasicObject. # 2008-05-28 # o SPELL CORRECTION: Used '...instanciation' instead of 'instantiation'. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-10-17 # o Added Rdoc comments. # 2003-01-18 # o Replaced all occurences of getClass() with data.class(). Will change # the use of getClass() in the future to return a Class object. # 2002-11-05 # o Added class(core) to the class list. # 2002-11-04 # o Created to be the upcoming root class which does not create a reference # object by default. ############################################################################ R.oo/R/InternalErrorException.R0000755000177400001440000001043712726216524016271 0ustar murdochusers###########################################################################/** # @RdocClass InternalErrorException # # @title "InternalErrorException represents internal errors" # # \description{ # @classhierarchy # # @get "title" that are likely to be due to implementation errors done by # the author of a specific package and not because the user made an error. # Errors that are due to unexpected input to functions etc falls under # this error type. # } # # @synopsis # # \arguments{ # \item{...}{Any arguments accepted by @see "Exception"}. # \item{package}{The name (@character string) of the package where the # error exists. Can also be a @see "Package" object. If @NULL, the # source of the error is assumed to be unknown.} # } # # \section{Fields and Methods}{ # @allmethods # } # # @author # # \seealso{ # For detailed information about exceptions see @see "Exception". # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setConstructorS3("InternalErrorException", function(..., package=NULL) { if (!is.null(package) && !inherits(package, "Package")) { package <- Package(as.character(package)); } extend(Exception(...), "InternalErrorException", .package=package ) }) ###########################################################################/** # @RdocMethod getPackage # # @title "Gets the suspicious package likely to contain an error" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @see "Package" object. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getPackage", "InternalErrorException", function(this, ...) { this$.package; }) ###########################################################################/** # @RdocMethod getMessage # # @title "Gets the message of the exception" # # \description{ # @get "title" and adds a message that clarifies that the error is likely # due to an internal error and not due to the user. It also gives information # how to contact the maintainer or author of the suspicous package. This # information is retrieved from the DESCRIPTION file of the package. To help # the package developer, information about the current version of R, the # current version of the package etc are also returned so the user can # easily cut'n'paste that information into a bug report. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getMessage", "InternalErrorException", function(this, ...) { msg <- getMessage.Exception(this); msg <- paste(msg, " This error is likely to be due to an internal error", sep=""); pkg <- getPackage(this); if (!is.null(pkg)) { msg <- paste(msg, " related to package ", getName(pkg), " v", getVersion(pkg), ". Please report this problem to the maintainer ", getMaintainer(pkg), " or the author ", getAuthor(pkg), " of that package", sep=""); } R.oo <- Package("R.oo"); msg <- paste(msg, ". Do not forget to report that you are using R v", getVersion(Package("base")), " on a ", R.Version()$platform, " platform together with R.oo v", getVersion(R.oo), ".", sep=""); msg; }) ############################################################################ # HISTORY: # 2012-11-13 # o ROBUSTNESS: Now getMessage() for InternalErrorException setups an # Package("R.oo") object, instead of assuming that R.oo is loaded. # 2007-04-07 # o Removed reportBug() for InternalErrorException. Never completed/used. # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2003-12-02 # o Bug report now generates a form process by the braju.com server. # 2003-04-15 # o First trial version of a bug report system from within R that # automatically fills in the version information since that is the most # commonly forgotten information. # o Created. ############################################################################ R.oo/R/ll.default.R0000755000177400001440000002776612762371467013703 0ustar murdochusers###########################################################################/** # @RdocDefault ll # # @title "Generates a list of informative properties of all members of an environment" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{pattern}{Regular expression pattern specifying which members to # return. If \code{".*"}, all names are matched.} # \item{...}{A named @vector of format \code{functionName=value}, where # \code{functionName()} will be called on each member found. If the # result matches the \code{value}, the member is returned, otherwise # not.} # \item{private}{If @TRUE, also private members, i.e. members with # a name starting with a @. (period), will be listed, otherwise not.} # \item{properties}{Names of properties to be returned. There must exist # a @function with the same name, because it will be called. This way # one can extract any type of property by defining new methods.} # \item{sortBy}{Name or index of column (property) to be sorted by. # If @NULL, the objects are listed in the order they are found.} # \item{decreasing}{A @logical indiciating whether the sorting should # be done in increasing or decreasing order.} # \item{envir}{An @environment, a search path index or a name of a package # to be scanned.} # } # # \value{ # Returns a @data.frame containing information about all the members. # } # # \section{Default properties returned}{ # It is possible to set the default value of argument \code{properties} # by setting option \code{"R.oo::ll/properties"}, e.g. # \code{options("R.oo::ll/properties"=c("data.class", "dimension"))}. # If this option is not set when the package is loaded, it is set to # \code{c("data.class", "dimension", "objectSize")}. # } # # \examples{ # \dontrun{ # To list all objects in .GlobalEnv: # > ll() # member data.class dimension objectSize # 1 *tmp* Person 1 428 # 2 as.character.Person function NULL 1208 # 3 country character 1 44 # 4 equals.Person function NULL 2324 # 5 filename character 1 84 # 6 getAge function NULL 372 # 7 getAge.Person function NULL 612 # 8 getName.Person function NULL 628 # 9 hashCode.Person function NULL 1196 # 10 last.warning list 1 192 # 11 obj Person 1 428 # 12 Person Class NULL 2292 # 13 setAge function NULL 372 # 14 setAge.Person function NULL 2088 # 15 setName function NULL 372 # 16 setName.Person function NULL 760 # 17 staticCode.Person function NULL 2372 # # To list all functions in the methods package: # ll(mode="function", envir="methods") # # To list all numeric and character object in the base package: # ll(mode=c("numeric", "character"), envir="base") # # To list all objects in the base package greater than 40kb: # subset(ll(envir="base"), objectSize > 40000) # } # } # # @author # # \seealso{ # @see "utils::ls.str" and @see "ll.Object". # } # # \keyword{utilities} #*/########################################################################### setMethodS3("ll", "default", function(pattern=".*", ..., private=FALSE, properties=getOption("R.oo::ll/properties", c("data.class", "dimension", "objectSize")), sortBy=NULL, decreasing=FALSE, envir=parent.frame()) { # AD HOC: Workaround to make sure property functions can be found. # This is because they are currently search for via the global # environment. /HB 2013-07-11 require("R.oo") || throw("Package not loaded: R.oo"); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Validate arguments # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Argument 'envir': if (is.numeric(envir)) { envir <- as.environment(envir); } else if (is.character(envir)) { search <- gsub("^package:", "", search()); pos <- which(search == envir); envir <- as.environment(pos); } members <- ls(envir=envir, all.names=private); # Any members at all? if (length(members) == 0L) return(data.frame()); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Keep members whose names match the pattern # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (!is.null(pattern)) { matches <- regexpr(pattern, members); members <- members[matches != -1L]; if (length(members) == 0L) return(data.frame()); } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Filter out members that to not match the search criteria according to "...". # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - args <- list(...); if (length(args) > 0L) { # Precreate a function to filter out members to be returned names <- names(args); expr <- NULL; for (kk in seq_along(args)) { value <- args[[kk]]; if (is.null(value)) { e <- substitute(is.null(fcn(..object)), list(fcn=as.name(names[kk]))); } else { e <- substitute(is.element(fcn(..object), value), list(fcn=as.name(names[kk]), value=value)); } if (is.null(expr)) { expr <- e; } else { expr <- substitute(expr && e, list(expr=expr, e=e)); } } # for (kk ...) # expr <- substitute(filter <- function(name) { # eval(substitute(expr, list(..object=as.name(name))), envir=envir) # }, list(expr=expr, envir=envir)); # Now, create the filter() function # eval(expr); # Replaces the above construct. filter <- eval(substitute({ function(name) { ..object <- get(name, envir=envir); eval(expr, envir=envir) } }, list(expr=expr))); # Filter out members keep <- c(); for (member in members) { # Keep the member or not? if (filter(member)) keep <- c(keep, member); } if (length(keep) == 0L) return(data.frame()); members <- keep; } if (length(properties) == 0L || identical(properties, "")) return(data.frame(member=members)); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Generate a data frame row by row where each row contains the name of the # member and the properties as character strings. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Precreate a function returning a row in the resulting data frame expr <- expression(); for (property in properties) { e <- substitute({ ..exp <- substitute(propertyFcn(object), list(propertyFcn=as.name(property), object=..object)); ..value <- eval(..exp, envir=globalenv()); if (is.null(..value)) { ..value <- "NULL"; } else if (is.vector(..value) && length(..value) > 1L) { ..value <- sprintf("c(%s)", paste(..value, collapse=",")); } else if (is.list(..value)) { ..value <- unlist(..value); } if (length(..value) > 0L) { ..value <- ..value[1L]; } }, list(property=property)); expr <- substitute({expr; e; ..row <- cbind(..row, ..value);}, list(expr=expr,e=e)); } df <- NULL; for (member in members) { if (is.element(member, c("..."))) { dfRow <- c(member, rep(NA_character_, times=length(properties))); dfRow <- as.list(dfRow); } else { rowExpr <- substitute({ ..row <- list(name); ..object <- get(name, envir=envir); expr; }, list(name=member, member=as.name(member), expr=expr)); dfRow <- eval(rowExpr); } if (is.null(df)) { df <- dfRow; } else { for (kk in seq_along(df)) { df[[kk]] <- c(df[[kk]], dfRow[[kk]]); } } } attributes(df) <- NULL; names(df) <- c("member", properties); df <- as.data.frame(df); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Sort data frame? # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (!is.null(sortBy)) { if (is.numeric(sortBy)) pos <- sortBy else pos <- pmatch(sortBy, colnames(df)); if (is.na(pos) || pos > ncol(df)) throw("The column to sort by does not exist: ", sortBy); by <- df[,pos]; # We know that the first column always contains character strings... if (pos > 1L) { sortBy <- colnames(df)[pos]; # Figure out the data type of the sort column dummy <- eval(substitute(property(2), list(property=as.name(sortBy)))); mode(by) <- mode(dummy); } # Finally, sort the result table df <- df[order(by, decreasing=decreasing),]; } as.data.frame(df); }) # ll.default() ############################################################################ # HISTORY: # 2014-12-29 # o Added argument 'decreasing' to ll(), e.g. # ll(sortBy="objectSize", decreasing=TRUE). # 2014-02-05 # o CLEANUP: Argument 'properties' of ll() defaults to an options, which # if not set in turn defaults to a given value. The ll() method is no # longer trying to set that option if missing. The option is also no # longer set when the package is attached. # 2013-07-11 # o Now R.oo::ll() works without attaching the package. # o BUG FIX: ll(private=TRUE) gave an error if the environment # contained the special '...' argument. # 2012-02-29 # o CLEANUP: Dropped an .Internal() call in the default ll() method. # 2008-08-11 # o Replace all 'a %in% b' with is.element(a,b) due to weird bug, cf. # my R-devel post 'Argument "nomatch" matched by multiple actual # arguments ... %in% -> match?!?' on March 6, 2008. # 2007-06-09 # o Removed (incorrect) argument name 'list' from all substitute() calls. # 2007-03-24 # o Now ll() returns a data frame with column of the "minimal" data type. # This makes it possible to use subset() on the output as the new example # illustrates. # 2007-03-23 # o Now ll() uses objectSize() instead object.size(). # 2005-06-12 # o Now ll.default() does not assign variables in the lookup environment. # o Now ll.default() uses prefix '..' for all internal variable names, # because they are added to the environment investigated. This strategy # should be replaced by a better one, but at least for now it works. # 2005-03-28 # o Now argument 'properties' of ll() is given by the option # "R.oo::ll/properties". If not set when the package is loaded, it is # set to c("data.class", "dimension", "object.size"). # 2005-02-11 # o Made all regular expression patterns strict. # 2003-09-02 # o BUG FIX: dimension() would not be found if ll(envir=...) was done on # another package. Had to be more careful with function lookup using # different levels of eval(), substitute() and as.name(), but also make # sure some expression are evaluated in .GlobalEnv with inheritance. See # code for more details. # 2003-04-25 # o BUG FIX: The evaluation of the property functions was done in the # current environment, not the environment required. This made ll.Object() # to fail. # o TO DO: The local variables 'row' and 'value' are included when the # property functions. # 2003-04-24 # o Argument environment can now be a search path position, an environment # or a name of a package. # o Argument sortBy can now also be the column number. # o Removed the argument mode="ANY" and replaced it with ..., i.e. now one # can do ll(data.class="function") or ll(mode="function") to list all # functions or ll(mode="numeric") to list all numerics etc. # 2003-01-18 # o Added the sortBy argument to ll(). # 2002-11-28 # o Replace "getClass" with "data.class" in the 'properties' argument. Since # 'data.class' is almost the same as 'mode', mode was removed. # 2002-10-17 # o Added the 'mode="ANY"' argument. # 2002-10-16 # o Created. ############################################################################ R.oo/R/006.fixVarArgs.R0000755000177400001440000000427412726216524014206 0ustar murdochusers# Added '...' to some base functions. These will later be # turned into default functions by setMethodS3(). # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Methods in 'base' # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # USED TO DO: attach <- appendVarArgs(attach) attach <- function(...) UseMethod("attach"); setMethodS3("attach", "default", function(...) { base::attach(...); }) # USED TO DO: detach <- appendVarArgs(attach) detach <- function(...) UseMethod("detach"); setMethodS3("detach", "default", function(...) { base::detach(...); }) # USED TO DO: load <- appendVarArgs(load) load <- function(...) UseMethod("load"); setMethodS3("load", "default", function(..., envir=parent.frame()) { base::load(..., envir=envir); }) # USED TO DO: save <- appendVarArgs(load) save <- function(...) UseMethod("save"); setMethodS3("save", "default", function(..., envir=parent.frame()) { base::save(..., envir=envir); }) # USED TO DO: gc <- appendVarArgs(gc) gc <- function(...) UseMethod("gc"); setMethodS3("gc", "default", function(...) { base::gc(...); }) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Methods in 'methods' # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getClasses <- appendVarArgs(getClasses) getMethods <- appendVarArgs(getMethods) ############################################################################ # HISTORY: # 2012-06-20 # o CLEANUP: Dropped non-used adjusted getClass() generic function. # 2012-02-29 # o Replaced all appendVarArgs() for 'base' functions that do .Internal() # calls, because they would then appear as local functions of this # package and hence not be accepted by CRAN according to their new # policies. Instead we now create "default" functions that are # wrappers to the corresponding functions in the 'base' package. # Extra care has to be taken for functions that have arguments whose # values are dependent on the call environment/closure. # o CLEANUP: Dropped unused(?) 'environment <- appendVarArgs(environment)'. # 2005-02-15 # o Created to please R CMD check. ############################################################################ R.oo/R/objectSize.environment.R0000644000177400001440000000356012726216524016264 0ustar murdochusers###########################################################################/** # @set "class=environment" # @RdocMethod objectSize # # @title "Gets the size of an environment in bytes" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{envir}{An @see "base::environment".} # \item{...}{Arguments passed to @see "base::ls".} # } # # \value{ # Returns an @integer. # } # # @author # # \seealso{ # Internally @see "utils::object.size" is used. # } # # \keyword{attribute} # \keyword{utilities} #*/########################################################################### setMethodS3("objectSize", "environment", function(envir, ...) { ## Keep track of already scanned environments ## in order to avoid endless recursion. args <- list(...) .scannedEnvs <- args$.scannedEnvs if (is.null(.scannedEnvs)) .scannedEnvs <- list() alreadyScanned <- function(envir) { if (!is.environment(envir)) return(FALSE) for (env in .scannedEnvs) { if (identical(env, envir)) return(TRUE) } FALSE } ## Get all objects in the environment args <- list(envir=envir, all.names=TRUE, ...) args$.scannedEnvs <- NULL names <- do.call(ls, args=args) # Nothing to do? if (length(names) == 0L) return(0) ## Avoid scanning the current environment again .scannedEnvs <- c(.scannedEnvs, envir) size <- 0 for (name in names) { obj <- envir[[name]] if (!alreadyScanned(obj)) { size <- size + objectSize(obj, .scannedEnvs=.scannedEnvs) } } size }) ############################################################################ # HISTORY: # 2015-01-27 # o BUG FIX: objectSize() for environment could result in infinite # recursive calls if there circular dependencies between environments. # 2009-10-26 # o Added objectSize() for environments. ############################################################################ R.oo/R/trim.R0000755000177400001440000000177112726216524012600 0ustar murdochusers###########################################################################/** # @RdocDefault trim # # @title "Converts to a string and removes leading and trailing whitespace" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{object}{A @vector of \R objects to be trimmed.} # \item{...}{Not used.} # } # # \value{ # Returns a @vector of @character strings. # } # # @author # # @keyword character # @keyword internal #*/########################################################################### setMethodS3("trim", "default", function(object, ...) { s <- sub("^[\t\n\f\r ]*", "", as.character(object)); s <- sub("[\t\n\f\r ]*$", "", s); s; }) ############################################################################ # HISTORY: # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-10-18 # o Added Rdoc comments. # 2002-12-08 # o Currently used by the Rdoc class. ############################################################################ R.oo/R/Interface.R0000644000177400001440000001214512726216524013517 0ustar murdochusers###########################################################################/** # @RdocClass Interface # # @title "The Interface class" # # \description{ # @classhierarchy # # This class represents a special set of classes whose purpose is to # provide methods (but not fields) shared by multiple different classes. # } # # @synopsis # # \arguments{ # \item{core}{The core value.} # \item{...}{Not used.} # } # # \section{Methods}{ # @allmethods "public" # } # # @author # @keyword internal #*/########################################################################### setConstructorS3("Interface", function(core=NA, ...) { this <- core; class(this) <- "Interface"; this; }, private=TRUE) ###########################################################################/** # @RdocMethod extend # # @title "Extends another Interface class" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...className}{The name of new interface.} # \item{...}{Named values representing the fields of the new instance.} # } # # \value{ # Returns an Interface of class \code{className}. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("extend", "Interface", function(this, ...className, ...) { class(this) <- unique(c(...className, class(this))); this; }) ###########################################################################/** # @RdocMethod uses # @alias uses # @alias uses.character # # @title "Specifies that an object uses this Interface" # # \description{ # @get "title". # } # # @synopsis # # \value{ # Returns a @character @vector of class names of Interface:s. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("uses", "Interface", function(this, ...) { res <- setdiff(class(this), "Interface"); if (length(list(...)) > 0) { res <- c(list(res), list(uses(...))); # Order interfaces/classes names <- sort(unique(unlist(res, use.names=FALSE))); idxs <- integer(length(names)); names(idxs) <- names; for (kk in seq_along(res)) { for (name in res[[kk]]) { idxs[name] <- kk; } } for (kk in seq_along(res)) { keep <- (idxs[res[[kk]]] == kk); res[[kk]] <- res[[kk]][keep]; } res <- unlist(res, use.names=FALSE); } res; }) setMethodS3("uses", "character", function(className, ...) { clazz <- Class$forName(className); obj <- newInstance(clazz); uses(obj, ...); }) ###########################################################################/** # @RdocMethod as.character # # @title "Gets a character string representing the Interface" # # \description{ # @get "title". # } # # @synopsis # # \value{ # Returns a @character string. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("as.character", "Interface", function(x, ...) { # To please R CMD check this <- x; # Check if there are class "after" this one pos <- which("Interface" == class(this)); isLast <- (pos == length(class(this))); if (isLast) { s <- paste(class(this), collapse=", "); } else { s <- NextMethod("as.character"); } s; }, private=TRUE) ###########################################################################/** # @RdocMethod print # # @title "Prints an Interface" # # \description{ # For all objects of class @see "Interface", this method will print the # value of \code{as.character()} of the object. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("print", "Interface", function(x, ...) { # To please R CMD check this <- x; print(as.character(this), ...); }) ###########################################################################/** # @RdocMethod getFields # # @title "Returns NULL" # # \description{ # @get "title". # } # # @synopsis # # \arguments{ # \item{...}{Ignored.} # } # # \value{ # Always returns @NULL. # } # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("getFields", "Interface", function(...) { NULL }, private=TRUE) ############################################################################ # HISTORY: # 2009-10-02 # o Added Rdoc comments. # o Moved to R.oo. # 2009-07-22 # o Now uses(...) takes multiple Interface classes. # 2009-06-10 # o Added getFields() to Interface as an ad hoc solutions to avoid # print() throwing 'Error in UseMethod("getFields") : no # applicable method for "getFields"'. # 2008-05-09 # o Added uses() for a character string. # 2006-09-11 # o Added trial version of an Interface class. ############################################################################ R.oo/R/compileRdoc.R0000644000177400001440000000606412726216524014062 0ustar murdochusers###########################################################################/** # @RdocFunction compileRdoc # # @title "Compiles the Rdoc help comments in a package" # # \description{ # @get "title" by parsing the source code files and writes Rd help files. # } # # @synopsis # # \arguments{ # \item{pkgname}{A @character string specifying the package name. # If @NULL, the package name is inferred from the DESCRIPTION file # that is automatically search for in the subdirectories.} # \item{path}{A @character string specifying the path of the # package source directory.} # \item{...}{Additional arguments passed to \code{Rdoc\$compile()}.} # \item{verbose}{If @TRUE, verbose output is printed, otherwise not.} # } # # \value{ # Returns nothing. # } # # \details{ # To compile all Rdoc comments in a package 'PkgA' that is located # under the current working directory (e.g. \code{PkgA/R/*.R}) from # the system command line, do: # \preformatted{ # Rscript -e R.oo::compileRdoc() # } # } # # @author # # \seealso{ # See the @see "Rdoc" class. # } # # @keyword documentation # @keyword IO # @keyword internal #*/########################################################################### compileRdoc <- function(pkgname=NULL, path=pkgname, ..., verbose=TRUE) { require("R.oo") || stop("Package not loaded: R.oo"); # Infer package name from DESCRIPTION? if (is.null(pkgname)) { dirs <- list.files(); dirs <- dirs[file_test("-d", dirs)]; pathnames <- file.path(dirs, "DESCRIPTION"); pathnames <- pathnames[file_test("-f", pathnames)]; if (length(pathnames) == 0L) { throw("Failed to infer package name, since no */DESCRIPTION file was found."); } if (length(pathnames) > 1L) { throw("Failed to infer unique package name, because more than one */DESCRIPTION file was found: ", paste(sQuote(pathnames), collapse=", ")); } pathname <- pathnames[1L]; pi <- read.dcf(file=pathname); pkgname <- pi[,"Package", drop=TRUE]; if (length(pkgname) == 0L) { throw("Failed to infer package name. No 'Package' was listed in ", sQuote(pathname), "."); } if (length(pkgname) > 1L) { throw("Failed to infer package name. More than one 'Package' were listed in ", sQuote(pathname), ": ", paste(sQuote(pkgname), collapse=", ")); } } if (is.null(path)) { path <- pkgname; } if (!file_test("-d", path)) { throw("No such package directory: ", path); } pathR <- file.path(path, "R") if (!file_test("-d", pathR)) { throw("No such package R/ directory: ", pathR); } require(pkgname, character.only=TRUE) || throw("Package not loaded: ", pkgname); opwd <- setwd(pathR); on.exit(setwd(opwd)); Rdoc$compile(..., verbose=verbose); } # compileRdoc() ############################################################################ # HISTORY: # 2013-05-30 # o Added argument 'path' to compileRdoc(). # 2013-04-03 # o CLEANUP: compileRdoc() was outputting search() and sessionInfo(). # 2013-03-08 # o Created. ############################################################################ R.oo/R/abort.R0000644000177400001440000000655612726216524012737 0ustar murdochusers## covr: skip=all ###########################################################################/** # @RdocDefault abort # @alias abort.condition # # @title "Aborts the current expression call" # # \description{ # @get "title" and returns to the top level prompt/browser # \emph{without signalling a condition}. # } # # @synopsis # # \arguments{ # \item{...}{(optional) Objects coerced to @character and pasted together without a separator, or a @condition object. If no object are given, no message is printed.} # \item{call.}{If @TRUE, the call is added to the message, otherwise not.} # \item{domain}{Used to translate the message (see @see "base::gettext"). If @NA, messages will not be translated.} # } # # \value{ # Returns nothing. # } # # \details{ # There are still cases where one can "catch" the abort and undo it, cf. [1]. # } # # \examples{\dontrun{ # @include "../incl/abort.Rex" # }} # # @author # # \seealso{ # @see "throw". # @see "base::stop". # Internally, @see "base::invokeRestart"\code{("abort")} is utilized. # } # # \references{ # [1] R-devel thread '', Sept 11, 2012, # \url{https://stat.ethz.ch/pipermail/r-devel/2012-September/064838.html}.\cr # } # # @keyword error # @keyword internal #*/########################################################################### setMethodS3("abort", "condition", function(cond, ..., call.=TRUE, domain=NULL) { message <- conditionMessage(cond); call <- conditionCall(cond); if (is.null(call)) { msg <- sprintf("%s", .makeMessage("Abort", domain=domain)); } else { call <- deparse(call); msg <- sprintf("%s %s", .makeMessage("Abort in", domain=domain), call); } msg <- sprintf("%s: %s\n", msg, message); cat(msg, file=stderr()); abort(); }) setMethodS3("abort", "default", function(..., call.=TRUE, domain=NULL) { args <- list(...); if (nargs() > 0) { message <- .makeMessage(..., domain=domain); nframe <- sys.nframe(); if (nframe <= 2) call. <- FALSE; if (call.) { call <- sys.call(which=nframe-2L); if (is.null(call)) { msg <- sprintf("%s", .makeMessage("Abort", domain=domain)); } else { call <- deparse(call); msg <- sprintf("%s %s", .makeMessage("Abort in", domain=domain), call); } msg <- sprintf("%s: %s\n", msg, message); } else { msg <- sprintf("%s: %s\n", .makeMessage("Abort", domain=domain), message); } cat(msg, file=stderr()); } # Now abort R. invokeRestart("abort"); }) ############################################################################ # HISTORY: # 2012-09-11 # o Now abort() immitates how stop() works but without the signalling # of a condition. # 2012-09-10 # o ROBUSTNESS/CRAN POLICY: Updated abort() for condition to utilize # invokeRestart("abort"). This avoids having to call # .Internal(.signalCondition(...)). It also means that the message # outputted by abort() no longer starts with a "Error in ...:" line. # 2012-03-05 # o The abort() method is hidden and is not used by any R.oo methods. # Will keep it until it is fully certain that throw() for Exception # will work as expected without it. # 2012-02-29 # o KNOWN ISSUES: abort() for 'condition' still uses .Internal(). # o Added abort(), which is available as default function as well as # a method for 'condition' objects. # o Created. ############################################################################ R.oo/R/999.NonDocumentedObjects.R0000755000177400001440000000756412726216524016240 0ustar murdochusers###########################################################################/** # @RdocDocumentation "Non-documented objects" # # % The BasicObject class # @alias getInstanciationTime.default # @alias isReferable # # % The Class class # @alias forName # @alias getDetails # @alias getKnownSubclasses # @alias getMethods # @alias getMethods.default # @alias getName # @alias getPackage # @alias getStaticInstance # @alias getSuperclasses # @alias isAbstract # @alias isBeingCreated # @alias isDeprecated # @alias isPrivate # @alias isProtected # @alias isPublic # @alias isStatic # @alias newInstance # # % The Exception class # @alias getCalls # @alias getCall # @alias getLastException # @alias getMessage # @alias getStackTrace # @alias getStackTraceString # @alias getWhen # @alias printStackTrace # # % The Object class # @alias attach # @alias attach.default # @alias attachLocally # @alias clone # @alias clearLookupCache # @alias clearCache # @alias detach # @alias detach.default # @alias finalize # @alias gc # @alias getFields # @alias getInstanciationTime # @alias getInstanciationTime.default # @alias getInstantiationTime # @alias getInternalAddress # @alias getFieldModifier # @alias getFieldModifiers # @alias hasField # @alias load # @alias load.default # @alias novirtual # @alias registerFinalizer # @alias save # @alias save.default # @alias staticCode # # % The Package class # @alias getAuthor # @alias getBundle # @alias getBundlePackages # @alias getChangeLog # @alias getClasses # @alias getClasses.default # @alias getContribUrl # @alias getContents # @alias getDataPath # @alias getDate # @alias getDescription # @alias getDescriptionFile # @alias getDevelUrl # @alias getDocPath # @alias getEnvironment # @alias getExamplePath # @alias getHistory # @alias getHowToCite # @alias getLicense # @alias getMaintainer # @alias getManPath # @alias getNews # @alias getPath # @alias getPosition # @alias getTitle # @alias getUrl # @alias getVersion # @alias isLoaded # @alias isOlderThan # @alias showChangeLog # @alias showContents # @alias showDescriptionFile # @alias showHistory # @alias showHowToCite # @alias showNews # @alias startupMessage # @alias unload # # % The RccViolationException class # @alias getRccUrl # # % The Rdoc class # @alias argsToString # @alias check # @alias compile # @alias createManPath # @alias createName # @alias declaration # @alias escapeRdFilename # @alias getClassS4Usage # @alias getKeywords # @alias getNameFormat # @alias getObject # @alias getObject.Rdoc # @alias getPackageNameOf # @alias getRdDeclaration # @alias getRdHierarchy # @alias getRdMethods # @alias getRdTitle # @alias getUsage # @alias hierarchy # @alias isKeyword # @alias isVisible # @alias methodsInheritedFrom # @alias setManPath # @alias setNameFormat # # % The RdocException class # @alias getSource # # % Trial functions # @alias gc.default # @alias callSuperMethodS3 # @alias callSuperMethodS3.default # # % Deprecated functions # @alias setClassS3 # @alias setClassS3.default # @alias getClass.BasicObject # @alias getClass.default # # \description{ # This page contains aliases for all "non-documented" objects that # \code{R CMD check} detects in this package. # # Almost all of them are \emph{generic} functions that have specific # document for the corresponding method coupled to a specific class. # Other functions are re-defined by \code{setMethodS3()} to # \emph{default} methods. Neither of these two classes are non-documented # in reality. # The rest are deprecated methods. # } # # @author # # @keyword internal #*/########################################################################### ############################################################################ # HISTORY: # 2012-02-29 # o CLEANUP: Dropped aliases for non-existing environment[.default](). # 2005-02-10 # o Created to please R CMD check. ############################################################################ R.oo/R/999.package.R0000755000177400001440000000513212726216524013544 0ustar murdochusers#########################################################################/** # @RdocPackage R.oo # # \description{ # @eval "getDescription(R.oo)" # # Please note that the Rdoc syntax/grammar used to convert Rdoc comments # in code into Rd files is not strictly defined and is modified by the # need of the author. Ideally, there will be a well defined Rdoc language # one day. # } # # \section{Installation and updates}{ # To install this package do\cr # # \code{install.packages("R.oo")} # } # # \section{Dependancies and other requirements}{ # This package requires a standard \R installation and # the \pkg{R.methodsS3} package. # } # # \section{To get started}{ # To get started,It is very useful to understand that: # \enumerate{ # \item The @see "R.methodsS3::setMethodS3"() function, which is # defined in the \pkg{R.methodsS3} package (used to be part of # \pkg{R.oo}), is nothing but a conveniency wrapper for setting # up S3 methods, and automatically create an S3 generic # function, if missing. For more information, see the help of # \pkg{R.methodsS3}. # \item The @see "Object" class is a top-level "root" class # that provides support for \emph{reference variables}. # Any class inheriting from this class supports # reference variables. # \item The @see "Object" class is basically a wrapper around an # @environment, which some additional accessors etc. It is the # environment data type that provides the "emulation" of # reference variables - the Object class structure makes # it easier to extends this class and adds some level of coding # protection. The Object class features is not intended for # referencing individual elements of basic \R data types, # but rather for the whole variable of such. # For instance, you can reassign a whole matrix \code{X} part of # the object this way, but you cannot reassign \code{X[1,1]} # without creating a completely new copy. # } # } # # \section{Further readings}{ # For a detailed introduction to the package see [1] (part of the # package distribution). # } # # \section{How to cite this package}{ # Whenever using this package, please cite [1] as\cr # # @howtocite "R.oo" # } # # @author # # \section{License}{ # The releases of this package is licensed under # LGPL version 2.1 or newer. # } # # \references{ # [1] @include "../incl/BengtssonH_2003.bib.Rdoc" \cr # } # # \seealso{ # People interested in \pkg{R.oo} may also be interested in # packages \pkg{proto} and \pkg{mutatr}. # } #*/######################################################################### R.oo/R/getNnnByName.R0000644000177400001440000000601612726216524014144 0ustar murdochusers.getFunctionByName <- function(name, where=c("ns", "search", "ns*"), envir=NULL, callEnvir=as.environment(-1L), class="function", mustExist=TRUE, ...) { # Backward compatibility (ignore where="ns*" if explicitly disabled) if (!getOption("R.oo::Class/searchNamespaces", TRUE)) { where <- setdiff(where, "ns*"); } # Ignore where = "ns" if 'envir' was not specified if (is.null(envir)) { where <- setdiff(where, "ns"); } # Search each 'where'... for (kk in seq_along(where)) { whereKK <- where[kk]; # (a) Search a specific environment? # (which should be a namespace of package) if (whereKK == "ns") { if (exists(name, mode="function", envir=envir, inherits=TRUE)) { res <- get(name, mode="function", envir=envir, inherits=TRUE); if (inherits(res, class)) return(res); } } # (b) Search globally? if (whereKK == "search") { envirT <- callEnvir; if (exists(name, mode="function", envir=envirT, inherits=TRUE)) { res <- get(name, mode="function", envir=envirT, inherits=TRUE); if (inherits(res, class)) return(res); } } # (c) Search all loaded namespaces? if (whereKK == "ns*") { for (pkg in loadedNamespaces()) { envirT <- getNamespace(pkg); if (exists(name, mode="function", envir=envirT, inherits=TRUE)) { res <- get(name, mode="function", envir=envirT, inherits=TRUE); if (inherits(res, class)) return(res); } } } } # for (kk in ...) if (mustExist) { # Don't use throw() here, because it may result in an endless loop # if Exception is not found. /HB 2012-11-23 stop(sprintf("INTERNAL ERROR: No such %s: %s", class, name)); } # Not found NULL; } # .getFunctionByName() .getS3Method <- function(name, ...) { .getFunctionByName(name, class="function", ..., callEnvir=as.environment(-1L)); } .getClassByName <- function(name, ...) { .getFunctionByName(name, class="Class", ..., callEnvir=as.environment(-1L)); } ############################################################################ # HISTORY: # 2014-01-05 # o Now .getFunctionByName() also searches all loaded namespaces at the end. # o Renamed .findS3Method() to .getS3Method() for consistency. # o CONSISTENCY: Added .getFunctionByName(), which .getClassByName() and # .findS3Method() utilizes. This makes it particularly easy to change # both their behaviors. # o ROBUSTNESS: .getClassByName() assumed that argument 'where' was # not explicitly passed. # 2013-08-20 # o Now .getClassByName() searches in the order of 'where'. # o Added argument 'mustExist' to .getClassByName(). # o Now option 'R.oo::Class/searchNamespaces' defaults to TRUE. # 2013-07-11 # o Now internal .findS3Method() and .getClassByName() search the given # environment (argument 'envir') if a secret option is enabled. # 2012-12-27 # o Added argument 'envir' to .getClassByName(). # 2012-11-23 # o Added internal .getClassByName(). # o Created. ############################################################################ R.oo/R/zzz.R0000755000177400001440000000232712726216524012460 0ustar murdochusers## covr: skip=all # Detach the 'R.oo' attached in file 030.ObjectClassFunctions.R if (is.element("R.oo", search())) detach("R.oo"); .onUnload <- function(libpath) { ## message("R.oo::.onUnload()"); # Force finalize() on Object:s base::gc(); } # .onUnload() .onLoad <- function(libname, pkgname) { ns <- getNamespace(pkgname); ## Doing assign(pkgname, Package(pkgname), envir=ns) seems to ## introduce potential cyclic loading of the R.oo namespace. ## My best guess is that it has to do with garbage collection. ## Because of this, we use a "delayed" assignment. /HB 2013-10-10 delayedAssign(pkgname, Package("R.oo"), eval.env=ns, assign.env=ns); # Create getCall() generic function, iff missing (R < 2.14.0) if (!exists("getCall", mode="function")) { assign("getCall", function(...) UseMethod("getCall"), envir=ns); } } # .onLoad() .onAttach <- function(libname, pkgname) { pkg <- get(pkgname, envir=getNamespace(pkgname)); startupMessage(pkg); } # .onAttach() ############################################################################ # HISTORY: # 2014-02-21 # o Added .onUnload() which calls the garbage collector. ############################################################################ R.oo/R/throw.default.R0000755000177400001440000000516112726216524014410 0ustar murdochusers###########################################################################/** # @RdocDefault throw # # @title "Throws an Exception" # # \description{ # Throws an exception similar to \code{stop()}, but with support for # @see "Exception" classes. The first argument (\code{object}) is by # default pasted together with other arguments (@...) and with seperator # \code{sep=""}. For instance, to throw an exception, write # # \code{throw("Value out of range: ", value, ".")}. # # which is short for # # \code{throw(Exception("Value out of range: ", value, "."))}. # # Note that \code{throw()} can be defined for classes inheriting # @see "Exception", which can then be caught (or not) # using \code{\link[base:conditions]{tryCatch}()}. # } # # @synopsis # # \arguments{ # \item{...}{One or several strings that are concatenated and collapsed # into on message string.} # } # # \value{ # Returns nothing. # } # # \examples{ # rbern <- function(n=1, prob=1/2) { # if (prob < 0 || prob > 1) # throw("Argument 'prob' is out of range: ", prob) # rbinom(n=n, size=1, prob=prob) # } # # rbern(10, 0.4) # # [1] 0 1 0 0 0 1 0 0 1 0 # tryCatch(rbern(10, 10*0.4), # error=function(ex) {} # ) # } # # @author # # \seealso{ # See the @see "Exception" class for more detailed information. # } # # \keyword{error} #*/########################################################################### setMethodS3("throw", "default", function(...) { throw(Exception(...)); }, overwrite=TRUE, conflict="quiet") ## setGenericS3("throw", force=TRUE); ############################################################################ # HISTORY: # 2012-06-17 # o Override generic function throw() of R.methodsS3 with one here. # 2012-03-08 # o Now the default throw() of R.methodsS3 is "quietly" overwritten, # i.e. there is no longer a warning about it when R.oo is loaded. # 2005-02-20 # o Updated broken link to tryCatch(). # 2005-02-10 # o Making use of tryCatch() only. # 2002-10-17 # o Now throw() always throws an Exception. # 2002-05-25 # * Bug fix in Rd \examples{}. Forgot a comment. # 2002-04-21 # * Redefined throw.default() so it takes several arguments, which are then # pasted together with sep="". In other words, instead of doing # stop(paste("bla bla", "value:", x, ".\n", sep="")) # one can just do # throw("bla bla", "value:", x, ".\n") # This is also a step towards the new exception model that supports # classes. # * Extract the throw() functions from trycatch.R, which relies on them, but # the throw()'s are stand-alone. ############################################################################ R.oo/R/RccViolationException.R0000755000177400001440000001005512726216524016073 0ustar murdochusers###########################################################################/** # @RdocClass RccViolationException # # @title "An RccViolationException indicates a violation of the R Coding Conventions (RCC)" # # \description{ # @classhierarchy # # @get "title". # It is generated by \code{setConstructorS3()} and \code{setMethodS3()}. # It is \emph{not} meant to be caught, but instead the source code that # violates the RCC should be fixed. For more information about RCC, see # references below. # } # # @synopsis # # \arguments{ # \item{...}{Any arguments accepted by the constructor of Exception, i.e. # one or several @character strings, which will be concatenated and # contain informative message about why the RCC was violated.} # } # # \section{Fields and Methods}{ # @allmethods # } # # \details{ # Since it is not possible to assert that the RCC is followed during the # parsing of the source code, but first only when the source code is # actually executed. # } # # \examples{ # \dontrun{ # setConstructorS3("myClass", function() { extends(Object(), .value=0) }) # setMethodS3("MyMethod", "myClass", function(this) { "Hullo!" }) # } # } # # @author # # \seealso{ # See also @see "base::try" and \code{\link[base:conditions]{tryCatch}()}. # For detailed information about exceptions see @see "Exception". # The R Coding Conventions (RCC) can be found at # \url{@eval "RccViolationException$getRccUrl()"}. # } # # @keyword programming # @keyword methods # @keyword error # @keyword internal #*/########################################################################### setConstructorS3("RccViolationException", function(...) { extend(Exception(...), c("RccViolationException") ) }) ###########################################################################/** # @RdocMethod as.character # # @title "Gets a string representing of the RCC violation" # # \description{ # @get "title" of format "[\{POSIX date string\}] \{class name\}: \{msg\}, cf. @eval "RccViolationException$getRccUrl()"". # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{\dontrun{For a complete example see help(Exception).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("as.character", "RccViolationException", function(x, ...) { # To please R CMD check this <- x; paste("[", getWhen(this), "] ", class(this)[1L], ": ", getMessage(this), ", cf. ", getRccUrl(this), sep=""); }) ###########################################################################/** # @RdocMethod getRccUrl # # @title "Static method to get a URL where the RCC can be found" # # \description{ # Static method to get a URL where one can find details about the # R Code Convention (RCC). # Currently the URL is \url{@eval "RccViolationException$getRccUrl()"}. # } # # @synopsis # # \arguments{ # \item{...}{Not used.} # } # # \value{ # Returns a @character string. # } # # \examples{\dontrun{For a complete example see help(RccViolationException).}} # # @author # # \seealso{ # @seeclass # } # # \keyword{programming} # \keyword{methods} # \keyword{error} #*/########################################################################### setMethodS3("getRccUrl", "RccViolationException", function(this, ...) { "http://aroma-project.org/developers/RCC/" }, static=TRUE) ############################################################################ # HISTORY: # 2012-12-28 # o Replaced all data.class(obj) with class(obj)[1]. # 2012-11-18 # o Updated the URL returned by RccViolationException$getRccUrl(). # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2003-03-18 # o Spell correction: "c.f." -> "cf." # 2003-01-18 # o Replaced all occurences of getClass() with data.class(). Will change # the use of getClass() in the future to return a Class object. # 2002-10-18 # o Created. ############################################################################ R.oo/R/040.setConstructorS3.R0000755000177400001440000002072212726216524015373 0ustar murdochusers###########################################################################/** # @RdocDefault setConstructorS3 # # @title "Defines a class in S3/UseMethod style" # # \description{ # Defines a class in R.oo/S3 style. # What this function currently does is simply creating a constructor # function for the class. # } # # @synopsis # # \arguments{ # \item{name}{The name of the class.} # \item{definition}{The constructor defintion. \emph{Note: The constructor # must be able to be called with no arguments, i.e. use default values # for all arguments or make sure you use \code{missing()} or similar!}} # \item{static}{If @TRUE this class is defined to be static, # otherwise not. Currently this has no effect expect as an indicator.} # \item{abstract}{If @TRUE this class is defined to be abstract, # otherwise not. Currently this has no effect expect as an indicator.} # \item{private}{If @TRUE this class is defined to be private.} # \item{protected}{If @TRUE this class is defined to be protected.} # \item{export}{A @logical setting attribute \code{"export"}.} # \item{trial}{If @TRUE this class is defined to be a trial class, # otherwise not. A trial class is a class that is introduced to be # tried out and it might be modified, replaced or even removed in a # future release. Some people prefer to call trial versions, beta # version. Currently this has no effect expect as an indicator.} # \item{deprecated}{If @TRUE this class is defined to be deprecated, # otherwise not. Currently this has no effect expect as an indicator.} # \item{envir}{The environment for where the class (constructor function) # should be stored.} # \item{enforceRCC}{If @TRUE, only class names following the R Coding # Convention is accepted. If the RCC is violated an RccViolationException # is thrown.} # \item{...}{Not used.} # # Note: If a constructor is not declared to be private nor protected, it # will be declared to be public. # } # # \section{A constructor must be callable without arguments}{ # The requirement that a constructor function should be callable without # arguments (e.g. \code{MyConstructor()}) is because that call is used # to create the static instance of a class. The reason for this is that # a static instance of the class is created automatically when the # constructor is called \emph{the first time} (only), that is, # when the first of object of that class is created. # All classes have to have a static instance. # # To make a constructor callable without arguments, one can either make # sure all arguments have default values or one can test for missing # arguments using \code{missing()}. # For instance the following defintion is \emph{not} correct: # \code{setConstructorS3("Foo", function(x) extend(Object(), "Foo", x=x))} # whereas this one is # \code{setConstructorS3("Foo", function(x=NA) extend(Object(), "Foo", x=x))} # } # # \section{Code validation}{ # If argument \code{enforceRCC} is @TRUE, # the class name is validated so it starts with a letter and it # also gives a @warning if its first letter is \emph{not} captial. The # reason for this is to enforce a naming convention that names classes # with upper-case initial letters and methods with lower-case initial # letters (this is also the case in for instance Java). # } # # \examples{\dontrun{For a complete example see help(Object).}} # # \seealso{ # To define a method see @see "R.methodsS3::setMethodS3". # For information about the R Coding Conventions, see # @see "RccViolationException". # For a thorough example of how to use this method see @see "Object". # } # # @author # # \keyword{programming} # \keyword{methods} #*/########################################################################### setMethodS3("setConstructorS3", "default", function(name, definition, private=FALSE, protected=FALSE, export=TRUE, static=FALSE, abstract=FALSE, trial=FALSE, deprecated=FALSE, envir=parent.frame(), enforceRCC=TRUE, ...) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Assert that RCC naming conventions are followed. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (enforceRCC) { # Assert that the class name is a valid class name. firstLetter <- substring(name, 1,1); if (!is.element(tolower(firstLetter), letters)) throw(RccViolationException("Class names must begin with a letter: ", name)); # Check first letter if (firstLetter == tolower(firstLetter)) throw(RccViolationException("Class names should be nouns starting with a capital letter: ", name)); # Check if name contains . (period) if (regexpr("\\.", name) != -1) throw(RccViolationException("Class names must not contain . (period): ", name)); } # Check for forbidden names. ns <- getNamespace("R.methodsS3"); R.methodsS3_R.KEYWORDS <- get("R.KEYWORDS", envir=ns); if (is.element(name, R.methodsS3_R.KEYWORDS)) throw(RccViolationException("Class names must not be same as a reserved keyword in R: ", name)); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Set up the modifiers # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (private) protection="private" else if (protected) protection="protected" else protection="public"; # Create the modifiers modifiers <- protection; if (static == TRUE) modifiers <- c(modifiers, "static"); if (abstract == TRUE) modifiers <- c(modifiers, "abstract"); if (deprecated == TRUE) modifiers <- c(modifiers, "deprecated"); if (trial == TRUE) modifiers <- c(modifiers, "trial"); modifiers <- c(modifiers, "class"); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Create the constructor function (by default in the parent frame) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Create expr <- substitute({ ns <- getNamespace("R.oo"); if (exists("Class", mode="function", envir=ns, inherits=FALSE)) { R.oo_Class <- get("Class", mode="function", envir=ns, inherits=FALSE); fcn <- R.oo_Class(name, definition); rm(list="R.oo_Class"); } else { # Only used for/by R.oo itself. fcn <- Class(name, definition); } rm(list="ns"); attr(fcn, "export") <- export; attr(fcn, "modifiers") <- modifiers; }, list(fcn=as.name(name), name=name, definition=definition, export=export, modifiers=modifiers) ); # Assign retValue <- eval(expr, envir=envir); invisible(); }) # setConstructorS3() ############################################################################ # HISTORY: # 2012-08-29 # o Now setConstructorS3() no longer requires that R.oo is attached # ("loaded") - it's enough that it's namespace is loaded. # 2012-04-17 # o Added argument 'export' to setConstructorS3(). # o CLEANUP: setConstructorS3() no longer sets attribute "formals". It # has been deprecated since April 2003. # 2007-06-09 # o Removed (incorrect) argument name 'list' from all substitute() calls. # 2006-05-30 # o Renamed class from "ANY" to "default". # 2005-02-15 # o Added arguments '...' in order to match any generic functions. # 2004-03-03 # o Moved deprecated setCl assS3() to its own file. # 2003-07-17 # o Added Rdoc comments saying that the constructor function must be able # to be called without any arguments! # 2003-04-13 # o Now setConstructorS3() sets the attribute "modifiers". "formals" will # still be around, but will be phased out. # 2002-11-23 # o Renamed setClassS3() to setConstructorS3(), since this is what it is # actually doing. Keeping setClassS3() for backward compatibility but made # it deprecated. # 2002-10-17 # o Removed obsolete "modifiers<-"(). # o Added also "Object" to the class attribute to make static methods to # work. # 2002-10-16 # o There are times when # generic <- function(...) UseMethod() # is not working, for example # fcn <- get("generic"); fcn(myObj, ...); # For this reason, always do method dispatching using the name explicitly; # generic <- function(...) UseMethod("generic") # 2002-10-15 # o Created from R.oo Object.R and ideas as described on # http://www.maths.lth.se/help/R/ ############################################################################ R.oo/MD50000644000177400001440000003507013005746667011614 0ustar murdochusers62cc9cc5c7c1c010fa385ecf726222dd *DESCRIPTION fa5542bd2aebff9264a927e665af025c *NAMESPACE 912077a39d999da69e95a2def2b8c973 *NEWS 5b3e0291bcc049d9ada9005162c5259a *R/000.R da86aab11652da856d55eb0598e0c802 *R/006.fixVarArgs.R 4751a5e9715eb165d7105229a90bec24 *R/020.makeObjectFinalizer,private.R 2f2f5070207d0a7ce9b12d0e0ca929aa *R/030.ObjectClassFunctions.R 8f64589d838039d3e6fd5204873b864f *R/040.setConstructorS3.R 6c77c8125bb79ec70d66d2b62ccddfdb *R/050.Object.R 1a6e08457efc17a574d24474738f1cc7 *R/060.Class.R 147bf29fa6655fc7b1fcf4f7645a67d0 *R/999.DEPRECATED.R 340e36d463df0309b08745734b7eb871 *R/999.NonDocumentedObjects.R 4f095ea8cac158a9638a3dc8be691523 *R/999.package.R 5a21c15e55528b87a850c5d756920778 *R/ASCII.R 4e9a492444d00748f54c03c956b61c68 *R/BasicObject.R 9be45da757b0e3bdb304f4b440820601 *R/Class.misc.R eb4dc87410956416f0c525dc99c05e33 *R/Exception.R 789484840808b2e9b1447f61a8a74fcc *R/Interface.R be62c3b8609e24938c379d4a2cad8895 *R/InternalErrorException.R 2ea4540555c804f66c33bd2074127268 *R/Package.R c3a0c41b3d11ad57f4a172461a8655f1 *R/RccViolationException.R 146a8628c4772302bd2a252820eeee63 *R/Rdoc.R a78c0273e3a6366dde0effabfc2d5f56 *R/RdocException.R 6766fe95b51e77dcf03c9475a0c4b8f3 *R/abort.R 8bf990b17d86a8c7db607dbbd2b6ff21 *R/classRepresentation.misc.R 6466c8df1fc688c84f432cdc45bdc1b4 *R/compileRdoc.R a3eee77ab2f6f968b6efcf7eb2dffb60 *R/dimension.default.R 858e8850f99f133c64c76c8955fbe0fa *R/equals.default.R 5087e0f4c7dcdcbb1246e31248e3b382 *R/error.throw.R 64dda24f633c41f3cd1d3cfe1b4a77aa *R/extend.default.R 4345ada562943f3df1f9fac43b138931 *R/getConstructorS3.R c5cd5121f43dbc41d39fd1c32eaf165e *R/getName.environment.R f93482d5af83c3ff390be0c96af6046a *R/getNnnByName.R 528bdb9e6bcfd3d13154e9dd9ac2ace9 *R/hashCode.R 49a9f98cfe4f9e227dd5b191c72fa61b *R/ll.default.R ef0f6d414aea43a215dbaa4230369691 *R/objectSize.default.R 3255460cd41b60605e5ef8257fcf11ea *R/objectSize.environment.R 30d944e9ba09903f81d66bb3c3b0c9f0 *R/throw.default.R 125c410039114fbf792f9e9317ca448a *R/trim.R 372266d68688e87ed0ce4a18d164309b *R/typeOfClass.R 737a1331ad24cffce856c75d10bb5252 *R/zzz.R ae4d0a6399c929b3e81870199b0a38e6 *R/zzz.rJava-tweaks.R 876ecd0d1086da7656574be4b7739d14 *inst/CITATION 6958ed0722d07b6ca46fafca8aabd608 *inst/doc/Bengtsson.pdf 0f69446bf87d203d9aa7ae96b6711b97 *inst/misc/ASCII.R be5e10acdaefd2ff6cc016f2a0ffb689 *inst/misc/Exception.R 785a50da848bbd6ad592edffcc3c6774 *man/000.makeObjectFinalizer.Rd 25181dbf69eb710562992cd31acea011 *man/ASCII.Rd ad48a3f9a4c94befa143d19d7be90125 *man/BasicObject.Rd 0243877a5304c8d3882260e5aa46b4f3 *man/Class.Rd 704f1eb06eb4d34cbf72293a827a8536 *man/DOLLAR.BasicObject.Rd f554d1ead01c1c7021a245d48d39d40d *man/DOLLAR.Class.Rd bd7a2c56289e125215a400e6569dabad *man/DOLLAR.Object.Rd f19e562c98855468c0b7abcd66b09274 *man/DOLLARLT_-.BasicObject.Rd 21f5de4950bf328932f04e2fb1329992 *man/DOLLARLT_-.Class.Rd 5a84ab7892ca3a0329ab9990c48392e6 *man/DOLLARLT_-.Object.Rd 9255607a267448ff9e665ef01fef9300 *man/Exception.Rd b1a24e7675a94714a08c22590cd010c4 *man/Interface.Rd ce077dc2a937b8ad29504501084e3d2a *man/InternalErrorException.Rd 422d3126a23a37074cbbe7571fe11d06 *man/Non-documented_objects.Rd f64fec56f7161f53f8394ebcdad6220b *man/Object.Rd 574872c87e8191bc8984befb25ce25f7 *man/Package.Rd 66ba3eb9883e48cdf248991419ad01cf *man/R.oo-package.Rd 1b37c21d1ac2bc41a319ee74d47e23d9 *man/RccViolationException.Rd 0b1b66b5802535f0fae13526dffddf02 *man/Rdoc.Rd 6ce0067ddf5b9ee93ad8f2b6d3490ba5 *man/RdocException.Rd b85c3146e3f285d583570f1b99c0c850 *man/abort.Rd 80a5bf6887980ec5f1cdcd175cf61e4e *man/argsToString.Class.Rd 9e7b5e9469b332af8da82d633dc22b68 *man/argsToString.Rdoc.Rd 2081d6fe742815ce312ba99135dfcd44 *man/as.character.BasicObject.Rd 7a872a1ce978fd53dd39dae97ce6f04b *man/as.character.Class.Rd 9c5b7596466964b241d878a4a492c3f1 *man/as.character.Exception.Rd 5a9ea3b1e21e7ba99b5a520be238c1dd *man/as.character.Interface.Rd b7bcf3ceb4419d6058e08f37899242f3 *man/as.character.Object.Rd 2e907a5d0ba7c0fe22717158c892f355 *man/as.character.Package.Rd 8a2f4d447369069b8754ae71450fc7f1 *man/as.character.RccViolationException.Rd 3541b5a81b14fd75ef7a7b40f7286c93 *man/as.character.RdocException.Rd 1d2b60e84054bb8dda5cf5ed62cea038 *man/attach.BasicObject.Rd 2e7150928b4b0702aae0268d376d168e *man/attach.Object.Rd 75e3f59ac1c86203031a83eea741471b *man/attachLocally.Object.Rd 14d3e71b6831f7403b79c6fe9acb05ef *man/charToInt.Rd 300a03b7658fc53ba0b623cc891b9be9 *man/check.Rdoc.Rd 9dad6f28867121d4bdabf6536b25bf1d *man/clearCache.Object.Rd 554e9063796bc79f759caa27c3b981f7 *man/clearLookupCache.Object.Rd b247a45c7705380a39c61cb42cb56dae *man/clone.Object.Rd 7eb599b4baeabaab3a4a3573a577044d *man/compile.Rdoc.Rd 4cd903de2e389537348ccb00e24b98b6 *man/compileRdoc.Rd c2b14a5e74b1b68816e41bb7a89bd773 *man/createManPath.Rdoc.Rd c3709819b08e47c26f7c0d3093582412 *man/createName.Rdoc.Rd 66bcb297a123729a188a244467e7a492 *man/declaration.Rdoc.Rd b5141cdc18be9dc2a933761144c6f1f5 *man/detach.BasicObject.Rd 1d877d92837f384d97195a23c1777b0c *man/detach.Object.Rd 6faaf3774a757e73b37768a2c07379ef *man/dimension.Rd 43aec1048190143e37aaf9b0b82be424 *man/equals.BasicObject.Rd d3bf66a71639218e4253ac2a10c01588 *man/equals.Object.Rd 483e45de46dd0d315e45385894dc818e *man/equals.Rd e75f20556be6d55adc1d9ff87aa6bdd8 *man/escapeRdFilename.Rdoc.Rd d4f783d76796ad04bb8a2fd599d72571 *man/extend.BasicObject.Rd 14ce09fe538ab686e42e1713c6c07326 *man/extend.Interface.Rd cbda08c162289c8defb7f1bb6fe5b629 *man/extend.Object.Rd 8f185cd3e8e39ace3c26ea2ed43247b1 *man/extend.Rd 290c15c4a61a1047a80b15fca0b88c5f *man/finalize.Object.Rd 889ae86e79300ef0fcb6c63394371380 *man/forName.Class.Rd a4d13c03b7efd120e320eaca001a35d5 *man/gc.Object.Rd 1749c45a51469ea05edad884e591dfcd *man/getAuthor.Package.Rd 7845d3e3e1c42e54bfe53815b8e90dd2 *man/getBundle.Package.Rd 4d70020e6d85eea6e58de4f73fce899c *man/getBundlePackages.Package.Rd 7810a61a4a2ed382b157705b2bdd259c *man/getCalls.Exception.Rd 390896c0e3ff341e0c0f6f6c6507d9c0 *man/getChangeLog.Package.Rd 708e6815a2d1840edea4a584093bfe18 *man/getClassS4Usage.Rdoc.Rd 367974a09a07b8e96d19c4a9b2ec32b4 *man/getClasses.Package.Rd 09d653e5fb13cd25af5933ccad5b9f76 *man/getConstructorS3.Rd 5233b79fe290a3e52c93dfc69b25a4bd *man/getContents.Package.Rd 3c6a9636df6727c1a9bb431c8ebe99df *man/getContribUrl.Package.Rd d78f6cbdeacca57093d257901a136a25 *man/getDataPath.Package.Rd 1165407e4d6e8d565f71b08b3fd687bb *man/getDate.Package.Rd 8cf0231b753a46d021f1494ded95b004 *man/getDescription.Package.Rd 276e36dcb27f1a2f310b3e945805e77e *man/getDescriptionFile.Package.Rd d3f7d390d942ec20fe90688bc9a7d503 *man/getDetails.Class.Rd aec5edbb1a03b1bd80e5edc91bd1d858 *man/getDevelUrl.Package.Rd 0a05580a58ddd84e09e4a841ff236199 *man/getDocPath.Package.Rd 4980a8c1e9c81a6a0662ae7c1cfb04df *man/getEnvironment.Object.Rd 0c6085ef5a8f862e2db608780f3d027a *man/getEnvironment.Package.Rd 1158aeeb43ab187e02a4781bb0fb54df *man/getExamplePath.Package.Rd fa5f3aae43b975a90ea82a19f42d56ed *man/getFieldModifiers.Object.Rd e3909d201f92dbb931a108afedffe4e4 *man/getFields.BasicObject.Rd e897f187d08fbb893af0b04dcd7b26f4 *man/getFields.Class.Rd b5c4f9a3f0795395264591b1e8df7dd5 *man/getFields.Interface.Rd 67c0509bc67062c08bf01c9a1733b8ca *man/getFields.Object.Rd 0c554581de0046b1e6abeacb025e0694 *man/getHowToCite.Package.Rd a3d3a839ddc51d92dc910c002bf15d43 *man/getInstantiationTime.BasicObject.Rd 30acd8bcf106136d04297f41de02ec08 *man/getInstantiationTime.Object.Rd a3cd00d41122ec37d9b1350adc723b01 *man/getInternalAddress.Object.Rd d7b56ccd4010eafa54154827b6a8bd5e *man/getKeywords.Rdoc.Rd 6b84a7ae5135711ad22c403ac2b5eff3 *man/getKnownSubclasses.Class.Rd e40816a4793ac2e46674882437227159 *man/getKnownSubclasses.classRepresentation.Rd cf2c547ec5e661974f4ef12e5ab5ef13 *man/getLastException.Exception.Rd 35879aa6c09ec008c26536331096b4a4 *man/getLicense.Package.Rd 1142ad65dd9e0cd674501faee4e76b67 *man/getMaintainer.Package.Rd 7fc05ad512ac8efebe03df33209864e2 *man/getManPath.Rdoc.Rd df2eb30241aea986e2e890919888b781 *man/getMessage.Exception.Rd e56616c391315816146848cd7cce4e80 *man/getMessage.InternalErrorException.Rd 3aec6602206f1d959b8dae1ac9575a24 *man/getMethods.Class.Rd feaa11e74ea1fe59c6c7570db47b52e8 *man/getName.Class.Rd 57b03bab837e08aa59ddbb4147fb1d72 *man/getName.Package.Rd c4150476fb649019a5bc485bbb5be059 *man/getName.environment.Rd 2286c4b9ae5f8a75c3bf897e94aedbaf *man/getNameFormat.Rdoc.Rd b26db8431a42f48bb1c6650c8de8ed3f *man/getPackage.Class.Rd 259b162127cc67b8a396a9adef3813cc *man/getPackage.InternalErrorException.Rd 40e4c0bb372498dfddb8f9f93e722b98 *man/getPackageNameOf.Rdoc.Rd cc7fbf6d2f01271d3f28f67079c59145 *man/getPath.Package.Rd 3570722216042431936a0103eeac4bfd *man/getPosition.Package.Rd e9e9bdca88c52684c3a9d8567148f3e9 *man/getRccUrl.RccViolationException.Rd 02f1b2c027f62e671387e93739e9f978 *man/getRdDeclaration.Class.Rd 3e79fa4abebf702cba1402ee681601ee *man/getRdDeclaration.classRepresentation.Rd dca312a51b46e57312c6ee66d4963f17 *man/getRdHierarchy.Class.Rd 4a8221276a3f8e34c0def7ae1d47c43f *man/getRdHierarchy.classRepresentation.Rd c49b100ae51c1bfd1e6058128ca71253 *man/getRdMethods.Class.Rd c895362780071f93961ffe17a66d777e *man/getRdMethods.classRepresentation.Rd ff9d8a2007a07fbb19d1b8cb3fa85e74 *man/getRdTitle.Rdoc.Rd c8083042384ebbd3b8c9a0f0a61da37a *man/getSource.RdocException.Rd f690e87faad36591bd1e18ef97d2d747 *man/getStackTrace.Exception.Rd 29f8a5ef04f38d61e09cfbdb096bc4e5 *man/getStackTraceString.Exception.Rd fc6ebe7910f61ab00261fe1610e7e204 *man/getStaticInstance.Class.Rd 15c76743165d81af9f3fd6bd88ad4410 *man/getStaticInstance.Object.Rd 20944717d9b2e5f7ebaad4ba70788f8a *man/getSuperclasses.Class.Rd cb604510292330dc2f269f235d35ddcb *man/getSuperclasses.classRepresentation.Rd 8179934a07e1cf2cd8427616a3bca4c9 *man/getTitle.Package.Rd a0818351a7a9c01a355d5f162ef0ac36 *man/getUrl.Package.Rd c31066275243a6a670448d885ca74e02 *man/getUsage.Rdoc.Rd 530be65fce5fb7d735afe9b285c0eff9 *man/getVersion.Package.Rd e6fa5c902f54603bce36f56571488179 *man/getWhen.Exception.Rd be9ff6d7bc02c93d8b01191406c24aa4 *man/hasField.BasicObject.Rd 01da01107c8b331cde76fdda9afa2b8d *man/hasField.Object.Rd fce21c7e3a0ffc4c2131f9baa2c328c7 *man/hashCode.BasicObject.Rd 91b51d77e4dc1292af617374187eca2b *man/hashCode.Object.Rd d7cc8d2005e81869597141bda0eb1653 *man/hashCode.Rd 77677cdee77b5f236042d8799d3f86ac *man/hierarchy.Rdoc.Rd 55099b79a40ba5f6a0cf1ad6fbdf1698 *man/intToChar.Rd f02ced2a5c71ffebebfdf69fa79b3d63 *man/isAbstract.Class.Rd 9f15691a50c36cecd45c33ab6ba9f14c *man/isBeingCreated.Class.Rd a3c522084d8e5c8813b1762a74d2ee57 *man/isDeprecated.Class.Rd 06fe451b9c864d88361a56f871316795 *man/isKeyword.Rdoc.Rd feb192e19fb098fc35fc2870b1ff6e25 *man/isLoaded.Package.Rd ad3136d26208f867571cf49b529c42a3 *man/isOlderThan.Package.Rd eac324d09b15e47c75a8913f1f9c290d *man/isPrivate.Class.Rd 54fd4bc64092fdd525b4ec2e3006f559 *man/isProtected.Class.Rd 56b7f23a91292abe5deb489f92e01b25 *man/isPublic.Class.Rd 23816fe75c12a34339480ba7d2c35733 *man/isReferable.BasicObject.Rd 1a976205897dad0a1aeec0af1cd803b7 *man/isReferable.Object.Rd 1ca7ea2a162b650ea71aec1a0a371f54 *man/isStatic.Class.Rd 359f4c4f2623b5ed66b8854c361ac214 *man/isVisible.Rdoc.Rd 218e3fcfb2720eb4bd14cf1e59216d8c *man/ll.Object.Rd 8e973d973371138ced6f88e1ae5d6065 *man/ll.Package.Rd c182196d80ef1e15e7904b4fe82b9618 *man/ll.Rd a4a7dffb88d8d2156ed94cdb7320ddca *man/load.Object.Rd e567d65f961b590bbbbcdbd9a64f3983 *man/load.Package.Rd 617f33a50d87fed3bb40b8a0d5f22ba1 *man/methodsInheritedFrom.Rdoc.Rd 41e25a27cf652e3e458ff96b7a75ee75 *man/newInstance.BasicObject.Rd b79f707fee846503fa18eaa1b27e498f *man/newInstance.Class.Rd 6efda2e014f303f0d01fc233287d5743 *man/newInstance.Object.Rd 38532629ff97e52b4c79dc779b565ff9 *man/novirtual.Object.Rd 9fb5709527dae1693d7fdf50077db59a *man/objectSize.BasicObject.Rd 14253becfbc7a26bea8b6ca3a65a1f0c *man/objectSize.Object.Rd 9267cc66c0d8b4958231766da0682a17 *man/objectSize.Rd cf93f61f80fa5c3e9a861549f378b6bb *man/objectSize.environment.Rd 49b29a7a021a65282ec718652e8de298 *man/print.BasicObject.Rd 09694ed3273406d399351e383760244b *man/print.Class.Rd 9e2a44a0f32747800d7db9fcf80c4f7c *man/print.Exception.Rd b54ea27602b0e6f077a8f6b28132d415 *man/print.Interface.Rd 26a32ca1a00af1412ce54686d78d056c *man/print.Object.Rd 36a7bdadf325e5674960f2aac5300531 *man/printStackTrace.Exception.Rd 1680e9e90ee0de072f5818ac3430d6d9 *man/registerFinalizer.Object.Rd cee1fa2b48ea3f32132ba2245c6cb83c *man/save.Object.Rd 89fdb7375ca13ba13f08dab1a438b063 *man/setConstructorS3.Rd fed641fb7d7e3502aee7e6828e294929 *man/setManPath.Rdoc.Rd d6050b2f3c1e7948c5eb84f5376d810e *man/setNameFormat.Rdoc.Rd 45e93a1b664e659ab73832217b061955 *man/showChangeLog.Package.Rd 3f7a21268d70a351943fce8ad01e8954 *man/showContents.Package.Rd 14c38f27651151e9dc36b0392a527304 *man/showDescriptionFile.Package.Rd 6e9b3b70f51896a148875bc525fb6eec *man/showHowToCite.Package.Rd 7c715a35da3815ffb921bf1ea1422d92 *man/startupMessage.Package.Rd 9c854e863e225e79413e332f501160d2 *man/staticCode.Object.Rd 55c32a75d7bef5d8ffe357a7f7bf0631 *man/throw.Exception.Rd d65acd234a66014c56694674e3d85083 *man/throw.Rd b2069a677b1114406e7db4ea2e5dffc2 *man/throw.error.Rd a12028bb733485849439f3213fe8e52f *man/trim.Rd a9ecd083d17f289f95e3d1910b168df4 *man/typeOfClass.Rd a1f142be9c315739b230ec02c8e67706 *man/unload.Package.Rd 8e03b6de44d3c27e4924a69f577be6a4 *man/update.Package.Rd a1d13ed5dd1fb6509995148daa54a192 *man/uses.Interface.Rd 7e20e770f311cd069c3c45e0dc40434b *tests/ASCII.R 984790d3e1cd078368e83e0fab94d858 *tests/BasicObject.R 9e89dd7f03f7610820612b132711b5eb *tests/Class.R 6c95cfe7cc9617d5b99e1d6755f5a9a6 *tests/Exception.R 3c558a5db3f78af8caa30770f1db87bf *tests/Interface.R 0c9385711caf77f4681e6084c273638f *tests/InternalErrorException.reportBug.R b495aafe3373ed3922d653b4b1d96274 *tests/Object.R 64d024290cbb2af6c170915cfe19bc12 *tests/Object.finalize,noattach.R 37d9750cfc18ef25494a91efe51c19a6 *tests/Object.finalize,onoff.R 66b5b1551498ad20595f3ad1a31fe371 *tests/Object.finalize.R a2d2c3c88863cbe2329a091e9e414e52 *tests/Package.R 19a0210b7f75cc6addc00399431cca98 *tests/Package.unload.R e2c346a3eaedc17c03b74e9605ea92ff *tests/StaticMethodsAndNamespaces.R d0bb42cb3b0727f37bc061c0e84720ec *tests/abort.R a6d6dafc1837ebf25a20d5da12a1fffe *tests/attachLocally.Object.R c14c98dd367a26bce140563350ff4a49 *tests/equals.R 2b5676d1b5a917158bfea6cca92da84a *tests/extend.default.R 3d331609f3d79fa4cf8840bcaf6655c8 *tests/getConstructorS3.R 65097e1dc4a8e7c39f4fc32e89e84aa2 *tests/hashCode.R 12a0faf084f9f24ad01fac25970e8479 *tests/isBeingCreated.Class.R 6991fe671d618138be9d06745c866371 *tests/ll.R 2605f974d27c6b7b7cc16919cf4504b8 *tests/local.R 78f51ad0a149226925f8ed36bb1c6bbf *tests/objectSize.R ecc3a6634d974a69c2cc0ac52d25a180 *tests/throw.R 5e1580623cace2ce9f981b6aa2f32386 *tests/trim.R b62c10fecaa397495f9c15b7941cebea *tests/typeOfClass.R 0c108961bac81236840c496f2acf723c *tests/zzz.Object.finalize,reentrant.R R.oo/DESCRIPTION0000755000177400001440000000212513005746667013010 0ustar murdochusersPackage: R.oo Version: 1.21.0 Depends: R (>= 2.13.0), R.methodsS3 (>= 1.7.1) Imports: methods, utils Suggests: tools Date: 2016-10-30 Title: R Object-Oriented Programming with or without References Authors@R: c(person("Henrik", "Bengtsson", role=c("aut", "cre", "cph"), email = "henrikb@braju.com")) Author: Henrik Bengtsson [aut, cre, cph] Maintainer: Henrik Bengtsson Description: Methods and classes for object-oriented programming in R with or without references. Large effort has been made on making definition of methods as simple as possible with a minimum of maintenance for package developers. The package has been developed since 2001 and is now considered very stable. This is a cross-platform package implemented in pure R that defines standard S3 classes without any tricks. License: LGPL (>= 2.1) LazyLoad: TRUE URL: https://github.com/HenrikBengtsson/R.oo BugReports: https://github.com/HenrikBengtsson/R.oo/issues NeedsCompilation: no Packaged: 2016-10-31 16:46:50 UTC; hb Repository: CRAN Date/Publication: 2016-11-01 00:03:19 R.oo/man/0000755000177400001440000000000012763175003012040 5ustar murdochusersR.oo/man/getSuperclasses.Class.Rd0000755000177400001440000000207113005563376016556 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getSuperclasses.Class} \alias{getSuperclasses.Class} \alias{Class.getSuperclasses} \alias{getSuperclasses,Class-method} \title{Gets the super classes of this class} \description{ Gets the super classes of this class. } \usage{ \method{getSuperclasses}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{vector}} of \code{\link[base]{character}} strings. } \examples{ print(getSuperclasses(RccViolationException)) \dontrun{ returns [1] "Exception" "try-error" "Object" } } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{class}}(). \code{\link[R.oo:getKnownSubclasses.Class]{*getKnownSubclasses}()}. For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/getDocPath.Package.Rd0000755000177400001440000000175613005563400015707 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getDocPath.Package} \alias{getDocPath.Package} \alias{Package.getDocPath} \alias{getDocPath,Package-method} \title{Gets the path to the accompanying documentation (doc/) directory of this package} \description{ Gets the path to the accompanying documentation (doc/) directory of this package. } \usage{ \method{getDocPath}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{ print(list.files(getDocPath(R.oo))) # explicit call, or print(list.files(R.oo$docPath)) # as a virtual field } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/isAbstract.Class.Rd0000755000177400001440000000211413005563376015477 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isAbstract.Class} \alias{isAbstract.Class} \alias{Class.isAbstract} \alias{isAbstract,Class-method} \title{Checks if a class is abstract or not} \description{ Checks if a class is abstract or not. A class is abstract if it has abstract methods. } \usage{ \method{isAbstract}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the class is abstract, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ if (isAbstract(RccViolationException)) throw("The class RccViolationException should NOT be abstract.") } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{class}}(). \code{\link{setConstructorS3}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/DOLLARLT_-.Class.Rd0000755000177400001440000000445413005563376015042 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{DOLLAR< -.Class} \alias{$<-.Class} \alias{Class.$<-} \alias{$<-,Class-method} \alias{Class.[[<-} \alias{[[<-.Class} \alias{[[<-,Class-method} \title{Makes the fields and methods of an Class assignable via the \$<- and the [[<- operator} \usage{ \method{$}{Class}(this, name) <- value \method{[[}{Class}(this, name) <- value } \description{ Makes the fields and methods of an Class assignable via the \code{$<-} operator. This method is never called explicitly, but through an indirect usage of the \code{$<-} operator, e.g. \code{obj$name <- "foo"}. \enumerate{ \item This method will first search for a \preformatted{set()} method, e.g. if name has the value \code{"age"}, a \code{setAge()} will be looked for. If such a method exists it will be called with the Class as the first argument and \code{value} as the second, e.g. \code{setAge(this, value)}. A \code{get()} is only looked for if \code{} is not a private field. A private field is a name \emph{beginning} with a \code{.} (period). The rational for this naming convention is to be consistent with how \code{\link[base]{ls}()} works, which will not list such members by default. \item If no such method exists it will assign the \code{value} to a (existing or a non-existing) field named \code{name}. } Because any \preformatted{set()} is called first, it is possible to \emph{encapsulate} (hide away) fields with certain names or to put restrictions to what values can be assigned to them. } \arguments{ \item{name}{The name of the \preformatted{set()} method or the name of the field to be assigned the new value.} \item{value}{The value to be assigned.} \item{...}{Not used.} } \value{ Returns itself, i.e. \code{this}, as all \code{$<-} methods must do. } \examples{\dontrun{For a complete example see help(Class).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/hashCode.Rd0000755000177400001440000000230313005563401014037 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % hashCode.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{hashCode} \alias{hashCode.default} \alias{hashCode} \title{Gets an integer hashcoded for R objects} \description{ Gets an integer hashcoded for R objects. } \usage{ \method{hashCode}{default}(object, ...) } \arguments{ \item{object}{A \code{\link[base]{vector}} or \code{\link[base]{list}} of \R objects.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{vector}} of \code{\link[base]{integer}}'s. } \details{ A \code{\link[base]{character}} string is converted into a hashcode following Java conventions by \code{s[1]*31^(n-1) + s[2]*31^(n-2) + ... + s[n]} using integer arithmetic, where \code{s[i]} is the \code{i}:th character of the string, \code{n} is the length of the string. The hash value of the empty string is zero. For all other objects, by default \code{as.integer()} is called. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{internal} R.oo/man/getKeywords.Rdoc.Rd0000755000177400001440000000175413005563401015527 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$getKeywords} \alias{Rdoc$getKeywords} \alias{getKeywords.Rdoc} \alias{Rdoc.getKeywords} \alias{getKeywords,Rdoc-method} \title{Gets the keywords defined in R with descriptions} \description{ Gets the keywords defined in R with descriptions. } \usage{ ## Static method (use this): ## Rdoc$getKeywords(fullInfo=FALSE, ...) ## Don't use the below: \method{getKeywords}{Rdoc}(this, fullInfo=FALSE, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:setManPath.Rdoc]{*setManPath}()} For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/DOLLAR.BasicObject.Rd0000755000177400001440000000224013005563377015461 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{DOLLAR.BasicObject} \alias{$.BasicObject} \alias{BasicObject.$} \alias{$,BasicObject-method} \alias{BasicObject.[[} \alias{[[.BasicObject} \alias{[[,BasicObject-method} \title{Makes the fields and methods of an BasicObject accessable via the \$ and the [[ operator} \description{ Makes the fields and methods of an BasicObject accessable via the \$ and the [[ operator. } \usage{ \method{$}{BasicObject}(this, name) \method{[[}{BasicObject}(this, name, exact=TRUE) } \arguments{ \item{name}{The name of the field or method to be accessed.} } \value{ Returns the value of a field or a method (\code{\link[base]{function}}). If no such field or method exists, \code{\link[base]{NULL}} is returned. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getUrl.Package.Rd0000755000177400001440000000152313005563400015117 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getUrl.Package} \alias{getUrl.Package} \alias{Package.getUrl} \alias{getUrl,Package-method} \title{Gets the URL of this package} \description{ Gets the URL of this package as specified by the \code{DESCRIPTION} file. } \usage{ \method{getUrl}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{ pkg <- Package("R.oo") print(getUrl(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/detach.BasicObject.Rd0000755000177400001440000000223613005563377015741 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{detach.BasicObject} \alias{detach.BasicObject} \alias{BasicObject.detach} \alias{detach,BasicObject-method} \title{Detach an BasicObject from the R search path} \description{ Detach, from the \R search path, an BasicObject that has previously been attached. If the BasicObject was not attached, a \code{\link[base]{warning}} will be generated and nothing will be done. } \usage{ \method{detach}{BasicObject}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the BasicObject was detached, otherwise \code{\link[base:logical]{FALSE}}. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:attach.BasicObject]{*attach}()} and \code{\link[base]{attach}}(), \code{\link[base]{detach}}(). For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/extend.Interface.Rd0000644000177400001440000000162613005563377015527 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Interface.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{extend.Interface} \alias{extend.Interface} \alias{Interface.extend} \alias{extend,Interface-method} \title{Extends another Interface class} \description{ Extends another Interface class. } \usage{ \method{extend}{Interface}(this, ...className, ...) } \arguments{ \item{...className}{The name of new interface.} \item{...}{Named values representing the fields of the new instance.} } \value{ Returns an Interface of class \code{className}. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Interface}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/escapeRdFilename.Rdoc.Rd0000755000177400001440000000202513005563401016377 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$escapeRdFilename} \alias{Rdoc$escapeRdFilename} \alias{escapeRdFilename.Rdoc} \alias{Rdoc.escapeRdFilename} \alias{escapeRdFilename,Rdoc-method} \title{Escape non-valid characters in a filename} \description{ Escape non-valid characters in a filename. } \usage{ ## Static method (use this): ## Rdoc$escapeRdFilename(filename, ...) ## Don't use the below: \method{escapeRdFilename}{Rdoc}(static, filename, ...) } \arguments{ \item{filename}{A filename (\code{\link[base]{character}} string) to be escaped.} \item{...}{Not used.} } \value{ Returns \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getMaintainer.Package.Rd0000755000177400001440000000245013005563400016444 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getMaintainer.Package} \alias{getMaintainer.Package} \alias{Package.getMaintainer} \alias{getMaintainer,Package-method} \title{Gets the Maintainer of this package} \description{ Gets the Maintainer of this package as specified by the \code{DESCRIPTION} file. } \usage{ \method{getMaintainer}{Package}(this, as=c("character", "person"), include=c("given", "family"), ...) } \arguments{ \item{as}{A \code{\link[base]{character}} string specifying the return format.} \item{include}{A \code{\link[base]{character}} \code{\link[base]{vector}} specifying which person fields to include if returning a \code{\link[base]{character}} string.} \item{...}{Optional arguments passed to \code{\link[utils]{format.person}}.} } \value{ Returns a \code{\link[base]{character}} string or a \code{\link[utils]{person}} object. } \examples{ pkg <- Package("R.oo") print(getMaintainer(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getName.environment.Rd0000644000177400001440000000167613005563401016255 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % getName.environment.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getName.environment} \alias{getName.environment} \title{Gets the name of an environment} \description{ Gets the name of an environment, e.g. \code{"R_GlobalEnv"} or \code{"0x01ddd060"}. } \usage{ \method{getName}{environment}(env, ...) } \arguments{ \item{env}{An \code{\link[base]{environment}}.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{ name <- getName(globalenv()) print(name) stopifnot(identical(name, "R_GlobalEnv")) getName(new.env()) } \author{Henrik Bengtsson} \seealso{ \code{\link[base:environment]{environmentName}()}. } \keyword{programming} \keyword{methods} R.oo/man/getPosition.Package.Rd0000755000177400001440000000166513005563400016170 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getPosition.Package} \alias{getPosition.Package} \alias{Package.getPosition} \alias{getPosition,Package-method} \title{Gets the search path position of the package} \description{ Gets the search path position of the package. } \usage{ \method{getPosition}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ An \code{\link[base]{integer}}. } \examples{ pkg <- Package("base") print(getPosition(pkg)) } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getEnvironment.Package]{*getEnvironment}()}. \code{\link[base]{search}}(). For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/argsToString.Class.Rd0000755000177400001440000000211113005563376016023 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Class$argsToString} \alias{Class$argsToString} \alias{argsToString.Class} \alias{Class.argsToString} \alias{argsToString,Class-method} \title{Gets the arguments of a function as a character string} \description{ Gets the arguments (with default values) of a function as a character string, which can be used for debugging purposes etc. Used by: classinfo(). } \usage{ ## Static method (use this): ## Class$argsToString(fcn, ...) ## Don't use the below: \method{argsToString}{Class}(this, fcn, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{ Class$argsToString(plot); } \seealso{ For more information see \code{\link{Class}}. } \author{Henrik Bengtsson} \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/hierarchy.Rdoc.Rd0000755000177400001440000000155013005563401015170 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$hierarchy} \alias{Rdoc$hierarchy} \alias{hierarchy.Rdoc} \alias{Rdoc.hierarchy} \alias{hierarchy,Rdoc-method} \title{Gets the class hierarchy} \description{ Gets the class hierarchy. } \usage{ ## Static method (use this): ## Rdoc$hierarchy(class, ...) ## Don't use the below: \method{hierarchy}{Rdoc}(this, class, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getHowToCite.Package.Rd0000755000177400001440000000204713005563400016224 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getHowToCite.Package} \alias{getHowToCite.Package} \alias{Package.getHowToCite} \alias{getHowToCite,Package-method} \title{Gets the citation of this package} \description{ Gets the citation of this package. If text file \code{HOWTOCITE} exists in package root directory, then its contents is retrieved, otherwise \code{\link[utils]{citation}} for the package is retrieved. } \usage{ \method{getHowToCite}{Package}(this, newline="\n", ...) } \arguments{ \item{newline}{The \code{\link[base]{character}} string to collapse lines in the file.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/createManPath.Rdoc.Rd0000755000177400001440000000216013005563401015724 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$createManPath} \alias{Rdoc$createManPath} \alias{createManPath.Rdoc} \alias{Rdoc.createManPath} \alias{createManPath,Rdoc-method} \title{Creates the directory where the Rd files should be saved} \description{ Creates the directory where the Rd files should be saved. } \usage{ ## Static method (use this): ## Rdoc$createManPath(...) ## Don't use the below: \method{createManPath}{Rdoc}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the directory was creates, \code{\link[base:logical]{FALSE}} if it already exists and throws an \code{\link[R.oo]{Exception}} if failed. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getManPath.Rdoc]{*getManPath}()} For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/extend.BasicObject.Rd0000755000177400001440000000246713005563377016006 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{extend.BasicObject} \alias{extend.BasicObject} \alias{BasicObject.extend} \alias{extend,BasicObject-method} \title{Extends another class} \description{ via a mechanism known as "parasitic inheritance". Simply speaking this method "extends another class". What is actually happening is that it creates an instance of class name \code{...className}, by taking another BasicObject instance and add \code{...className} to the class list and also add all the named values in \code{...} as fields to the new instance. The method should be used by the constructor of a class and nowhere else. } \usage{ \method{extend}{BasicObject}(this, ...className, ...) } \arguments{ \item{...className}{The name of new class.} \item{...}{Named values representing the fields of the new instance.} } \value{ Returns an BasicObject of class \code{className}. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getRdMethods.classRepresentation.Rd0000755000177400001440000000150113005563401020740 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % classRepresentation.misc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getRdMethods.classRepresentation} \alias{getRdMethods.classRepresentation} \title{Gets the methods in Rd format} \description{ Gets the methods in Rd format. } \usage{ \method{getRdMethods}{classRepresentation}(class, visibility=c("public", "protected", "private"), trial=FALSE, ...) } \arguments{ \item{visibility}{-} \item{trial}{-} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \keyword{methods} \keyword{internal} \keyword{documentation} R.oo/man/throw.error.Rd0000755000177400001440000000153613005563401014623 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % error.throw.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{throw.error} \alias{throw.error} \title{Throws (rethrows) an object of class 'error'} \description{ Rethrows an 'error' object. The 'error' class was introduced in R v1.8.1 with the new error handling mechanisms. } \usage{ \method{throw}{error}(error, ...) } \arguments{ \item{error}{An object or class 'error'.} \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ See the \code{tryCatch()} method etc. See the \code{\link{Exception}} class for more detailed information. } \keyword{error} \keyword{methods} R.oo/man/setNameFormat.Rdoc.Rd0000755000177400001440000000244613005563401015764 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$setNameFormat} \alias{Rdoc$setNameFormat} \alias{setNameFormat.Rdoc} \alias{Rdoc.setNameFormat} \alias{setNameFormat,Rdoc-method} \title{Sets the current name format} \description{ Sets the current name format. Throws a \code{\link{RccViolationException}} if an unknown format is requested. } \usage{ ## Static method (use this): ## Rdoc$setNameFormat(nameFormat, ...) ## Don't use the below: \method{setNameFormat}{Rdoc}(static, nameFormat, ...) } \arguments{ \item{nameFormat}{ If \code{"method.class"}, help files for methods belonging to classes are named .. If \code{"class.method"}, help files for methods belonging to classes are named .. These are currently the only name formats supported. } \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getNameFormat.Rdoc]{*getNameFormat}()} For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/isLoaded.Package.Rd0000755000177400001440000000201313005563400015374 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isLoaded.Package} \alias{isLoaded.Package} \alias{Package.isLoaded} \alias{isLoaded,Package-method} \title{Checks if the package is installed on the search path or not} \description{ Checks if the package is installed on the search path or not. } \usage{ \method{isLoaded}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ \code{\link[base:logical]{TRUE}} if the packages has been loaded, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ pkg <- Package("base") print(isLoaded(pkg)) # TRUE } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:load.Package]{*load}()}. \code{\link[base]{search}}(). For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/showContents.Package.Rd0000755000177400001440000000150413005563400016352 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{showContents.Package} \alias{showContents.Package} \alias{Package.showContents} \alias{showContents,Package-method} \title{Show the CONTENTS file of this package} \description{ Show the CONTENTS file of this package. If the \code{CONTENTS} file does not exist, an exception is thrown. } \usage{ \method{showContents}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/print.Object.Rd0000755000177400001440000000170513005563375014701 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{print.Object} \alias{print.Object} \alias{Object.print} \alias{print,Object-method} \title{Prints an Object} \description{ For all objects of class \code{\link{Object}}, this method will print the value of \code{as.character()} of the object. Note that this function is not called if the argument is not an object of class \code{\link[R.oo]{Object}}. } \usage{ \method{print}{Object}(x, ...) } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ \code{\link[base]{print.default}}() For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/compileRdoc.Rd0000644000177400001440000000274113005563401014564 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % compileRdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{compileRdoc} \alias{compileRdoc} \title{Compiles the Rdoc help comments in a package} \description{ Compiles the Rdoc help comments in a package by parsing the source code files and writes Rd help files. } \usage{ compileRdoc(pkgname=NULL, path=pkgname, ..., verbose=TRUE) } \arguments{ \item{pkgname}{A \code{\link[base]{character}} string specifying the package name. If \code{\link[base]{NULL}}, the package name is inferred from the DESCRIPTION file that is automatically search for in the subdirectories.} \item{path}{A \code{\link[base]{character}} string specifying the path of the package source directory.} \item{...}{Additional arguments passed to \code{Rdoc\$compile()}.} \item{verbose}{If \code{\link[base:logical]{TRUE}}, verbose output is printed, otherwise not.} } \value{ Returns nothing. } \details{ To compile all Rdoc comments in a package 'PkgA' that is located under the current working directory (e.g. \code{PkgA/R/*.R}) from the system command line, do: \preformatted{ Rscript -e R.oo::compileRdoc() } } \author{Henrik Bengtsson} \seealso{ See the \code{\link{Rdoc}} class. } \keyword{documentation} \keyword{IO} \keyword{internal} R.oo/man/load.Object.Rd0000755000177400001440000000424013005563375014461 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Object$load} \alias{Object$load} \alias{load.Object} \alias{Object.load} \alias{load,Object-method} \title{Static method to load an Object from a file or a connection} \description{ Static method to load an Object from a file or a connection, which previously have been saved using \code{save()} of class Object. } \usage{ ## Static method (use this): ## Object$load(file, path=NULL, ...) ## Don't use the below: \method{load}{Object}(static, file, path=NULL, ...) } \arguments{ \item{file}{Filename or \code{\link[base:connections]{connection}} from where to read the Object.} \item{path}{The path where the file exists.} \item{...}{Not used.} } \value{ Returns a reference to the loaded Object. } \details{ Please note that no constructors are called when an Object is loaded and neither is any static class code called. } \section{Type control}{ Typically this static method is called as \code{$load(...)} where \code{} is any Object class. When an Object has been loaded, it is verified that it inherits from \code{}. If it does not, an exception is thrown. Thus, \code{Object$load(...)} will load any Object, but \code{MyClass$load(...)} will only load an Object that inherits from MyClass. If loaded object is not of correct class, an exception is thrown. } \section{Troubleshooting}{ Due to a bug, likely in \R itself, one can not specify the \code{file} argument by its name, i.e. \code{Object$load(file="foo.RData")} will not work, but \code{Object$load("foo.RData")} work just fine. } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:save.Object]{*save}()} and \code{\link[base]{save}}(), \code{\link[base]{load}}(). For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{IO} \keyword{internal} \keyword{methods} R.oo/man/uses.Interface.Rd0000644000177400001440000000154513005563377015217 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Interface.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{uses.Interface} \alias{uses.Interface} \alias{Interface.uses} \alias{uses,Interface-method} \alias{uses} \alias{uses.character} \title{Specifies that an object uses this Interface} \description{ Specifies that an object uses this Interface. } \usage{ \method{uses}{Interface}(this, ...) } \value{ Returns a \code{\link[base]{character}} \code{\link[base]{vector}} of class names of Interface:s. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Interface}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/hasField.BasicObject.Rd0000755000177400001440000000207613005563377016232 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{hasField.BasicObject} \alias{hasField.BasicObject} \alias{BasicObject.hasField} \alias{hasField,BasicObject-method} \title{Checks if a field exists or not} \description{ Checks if a field exists or not. } \usage{ \method{hasField}{BasicObject}(this, field, ...) } \arguments{ \item{field}{\code{\link[base]{vector}} of fields to be checked if they exists or not.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{logical}} \code{\link[base]{vector}} indicating for each field if it exists or not. } \author{Henrik Bengtsson} \seealso{ To get the fields of an Object, see \code{\link[R.oo:getFields.BasicObject]{*getFields}()}. For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/isVisible.Rdoc.Rd0000755000177400001440000000230013005563401015135 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$isVisible} \alias{Rdoc$isVisible} \alias{isVisible.Rdoc} \alias{Rdoc.isVisible} \alias{isVisible,Rdoc-method} \title{Checks if a member is visible given its modifiers} \description{ Checks if a member is visible given its modifiers. } \usage{ ## Static method (use this): ## Rdoc$isVisible(modifiers, visibilities, ...) ## Don't use the below: \method{isVisible}{Rdoc}(static, modifiers, visibilities, ...) } \arguments{ \item{modifiers}{A \code{\link[base]{character}} string of modifiers.} \item{visibilities}{A \code{\link[base]{character}} string of visibility flags.} \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the modifiers are equal or higher than the visibility flags, otherwise \code{\link[base:logical]{FALSE}}. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getMethods.Class.Rd0000644000177400001440000000253613005563376015510 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getMethods.Class} \alias{getMethods.Class} \alias{Class.getMethods} \alias{getMethods,Class-method} \title{Returns the method names of class and its super classes} \description{ Returns the method names of class and its super classes as a list. } \usage{ \method{getMethods}{Class}(this, private=FALSE, deprecated=TRUE, unique=TRUE, ...) } \arguments{ \item{private}{If \code{\link[base:logical]{TRUE}}, private methods are also returned, otherwise only public ones are returned.} \item{deprecated}{If \code{\link[base:logical]{TRUE}}, deprecated methods are also returned.} \item{unqiue}{If \code{\link[base:logical]{TRUE}}, only methods that are not implemented in one of the subclasses are returned for each class.} \item{...}{Not used.} } \value{ Returns a named \code{\link[base]{list}} of named \code{\link[base]{character}} strings. } \examples{ names <- getMethods(Exception) print(names) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/BasicObject.Rd0000755000177400001440000000454313005563377014515 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{BasicObject} \docType{class} \alias{BasicObject} \title{A root class like Object but without references} \description{ R.oo\cr \bold{Class BasicObject}\cr public class \bold{BasicObject}\cr } \usage{ BasicObject(core=NULL) } \arguments{ \item{core}{The core value of the object.} } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{$} \tab -\cr \tab \code{$<-} \tab -\cr \tab \code{.DollarNames} \tab -\cr \tab \code{.subset2Internal} \tab -\cr \tab \code{[[} \tab -\cr \tab \code{[[<-} \tab -\cr \tab \code{\link[R.oo:as.character.BasicObject]{as.character}} \tab Gets a character string representing the object.\cr \tab \code{\link[R.oo:attach.BasicObject]{attach}} \tab Attach an BasicObject to the R search path.\cr \tab \code{\link[R.oo:detach.BasicObject]{detach}} \tab Detach an BasicObject from the R search path.\cr \tab \code{\link[R.oo:equals.BasicObject]{equals}} \tab Compares an object with another.\cr \tab \code{\link[R.oo:extend.BasicObject]{extend}} \tab Extends another class.\cr \tab \code{\link[R.oo:getFields.BasicObject]{getFields}} \tab Returns the field names of an BasicObject.\cr \tab \code{\link[R.oo:getInstantiationTime.BasicObject]{getInstantiationTime}} \tab Gets the time when the object was instantiated.\cr \tab \code{\link[R.oo:hasField.BasicObject]{hasField}} \tab Checks if a field exists or not.\cr \tab \code{\link[R.oo:hashCode.BasicObject]{hashCode}} \tab Gets a hash code for the object.\cr \tab \code{\link[R.oo:isReferable.BasicObject]{isReferable}} \tab Checks if the object is referable or not.\cr \tab \code{\link[R.oo:newInstance.BasicObject]{newInstance}} \tab Creates a new instance of the same class as this object.\cr \tab \code{\link[R.oo:objectSize.BasicObject]{objectSize}} \tab Gets the size of the BasicObject in bytes.\cr \tab \code{\link[R.oo:print.BasicObject]{print}} \tab Prints an BasicObject.\cr } \bold{Methods inherited from logical}:\cr as.data.frame, as.raster } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{internal} \keyword{classes} R.oo/man/getStackTraceString.Exception.Rd0000755000177400001440000000165013005563377020211 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getStackTraceString.Exception} \alias{getStackTraceString.Exception} \alias{Exception.getStackTraceString} \alias{getStackTraceString,Exception-method} \title{Gets the stack trace as a string} \description{ . } \usage{ \method{getStackTraceString}{Exception}(this, ..., details=TRUE) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \seealso{ \code{\link[R.oo:getStackTrace.Exception]{*getStackTrace}()}. For more information see \code{\link{Exception}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/charToInt.Rd0000755000177400001440000000237213005563376014235 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % ASCII.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{charToInt} \alias{charToInt.default} \alias{charToInt} \title{Converts a vector of ASCII characters into a vector of integers} \description{ Converts a \code{\link[base]{vector}} of ASCII \code{\link[base]{character}}s to a equal length vector of ASCII \code{\link[base]{integer}}s. } \usage{ \method{charToInt}{default}(ch, ...) } \arguments{ \item{ch}{A \code{\link[base]{character}} \code{\link[base]{vector}}.} \item{...}{Not used.} } \value{ Returns an ASCII \code{\link[base]{integer}} \code{\link[base]{vector}}. } \author{Henrik Bengtsson} \examples{ i <- charToInt(unlist(strsplit("Hello world!", split=NULL))) # Gives: 72 101 108 108 111 32 119 111 114 108 100 33 ch <- intToChar(c(72,101,108,108,111,32,119,111,114,108,100,33)) # Gives: "H" "e" "l" "l" "o" " " "w" "o" "r" "l" "d" "!" } \seealso{ \code{\link{intToChar}}() \code{\link[base]{utf8Conversion}}. \code{\link[base]{rawConversion}} } \keyword{character} \keyword{internal} R.oo/man/createName.Rdoc.Rd0000755000177400001440000000235713005563401015264 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$createName} \alias{Rdoc$createName} \alias{createName.Rdoc} \alias{Rdoc.createName} \alias{createName,Rdoc-method} \title{Creates a class-method name} \description{ Creates a class-method name. } \usage{ ## Static method (use this): ## Rdoc$createName(class, method, escape=TRUE, ...) ## Don't use the below: \method{createName}{Rdoc}(static, class, method, escape=TRUE, ...) } \arguments{ \item{class}{A class name (\code{\link[base]{character}} string).} \item{method}{A method name (\code{\link[base]{character}} string).} \item{escape}{If \code{\link[base:logical]{TRUE}}, non-valid filename characters are escaped into valid character strings.} \item{...}{Not used.} } \value{ Returns \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:escapeRdFilename.Rdoc]{*escapeRdFilename}()}. For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/intToChar.Rd0000755000177400001440000000241413005563376014232 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % ASCII.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{intToChar} \alias{intToChar.default} \alias{intToChar} \title{Converts a vector of integers into a vector of ASCII characters} \description{ Converts a vector of ASCII integers to a equal length vector of ASCII characters. To make sure that all values in the input vector are in the range [0,255], the input vector is taken modulo 256. } \usage{ \method{intToChar}{default}(i, ...) } \arguments{ \item{i}{An \code{\link[base]{integer}} \code{\link[base]{vector}}.} \item{...}{Not used.} } \value{ Returns an ASCII \code{\link[base]{character}} \code{\link[base]{vector}}. } \author{Henrik Bengtsson} \examples{ i <- charToInt(unlist(strsplit("Hello world!", split=NULL))) # Gives: 72 101 108 108 111 32 119 111 114 108 100 33 ch <- intToChar(c(72,101,108,108,111,32,119,111,114,108,100,33)) # Gives: "H" "e" "l" "l" "o" " " "w" "o" "r" "l" "d" "!" } \seealso{ \code{\link[base]{utf8Conversion}}. \code{\link{charToInt}}() } \keyword{character} \keyword{internal} R.oo/man/getMessage.InternalErrorException.Rd0000755000177400001440000000261213005563377021070 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % InternalErrorException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getMessage.InternalErrorException} \alias{getMessage.InternalErrorException} \alias{InternalErrorException.getMessage} \alias{getMessage,InternalErrorException-method} \title{Gets the message of the exception} \description{ Gets the message of the exception and adds a message that clarifies that the error is likely due to an internal error and not due to the user. It also gives information how to contact the maintainer or author of the suspicous package. This information is retrieved from the DESCRIPTION file of the package. To help the package developer, information about the current version of R, the current version of the package etc are also returned so the user can easily cut'n'paste that information into a bug report. } \usage{ \method{getMessage}{InternalErrorException}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{InternalErrorException}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/Exception.Rd0000755000177400001440000001257713005563377014311 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Exception} \docType{class} \alias{Exception} \title{The Exception class to be thrown and caught} \description{ Package: R.oo \cr \bold{Class Exception}\cr \code{\link[R.oo]{Object}}\cr \code{~~|}\cr \code{~~+--}\code{try-error}\cr \code{~~~~~~~|}\cr \code{~~~~~~~+--}\code{condition}\cr \code{~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~+--}\code{error}\cr \code{~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~+--}\code{simpleError}\cr \code{~~~~~~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~~~~~~+--}\code{Exception}\cr \bold{Directly known subclasses:}\cr \link[R.oo]{InternalErrorException}, \link[R.oo]{RccViolationException}, \link[R.oo]{RdocException}\cr public static class \bold{Exception}\cr extends simpleError\cr Creates an Exception that can be thrown and caught. The \code{Exception} class is the root class of all other \code{Exception} classes. } \usage{ Exception(..., sep="", collapse=", ") } \arguments{ \item{...}{One or several strings, which will be concatenated and contain informative message about the exception.} \item{sep}{The string to used for concatenating several strings.} \item{collapse}{The string to used collapse vectors together.} } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{\link[R.oo:as.character.Exception]{as.character}} \tab Gets a character string representing of the Exception.\cr \tab \code{getCall} \tab -\cr \tab \code{\link[R.oo:getCalls.Exception]{getCalls}} \tab Gets the active calls saved when the exception was created.\cr \tab \code{\link[R.oo:getLastException.Exception]{getLastException}} \tab Static method to get the last Exception thrown.\cr \tab \code{\link[R.oo:getMessage.Exception]{getMessage}} \tab Gets the message of the Exception.\cr \tab \code{\link[R.oo:getStackTrace.Exception]{getStackTrace}} \tab Gets the stack trace saved when the exception was created.\cr \tab \code{\link[R.oo:getStackTraceString.Exception]{getStackTraceString}} \tab Gets the stack trace as a string.\cr \tab \code{\link[R.oo:getWhen.Exception]{getWhen}} \tab Gets the time when the Exception was created.\cr \tab \code{\link[R.oo:print.Exception]{print}} \tab Prints the Exception.\cr \tab \code{\link[R.oo:printStackTrace.Exception]{printStackTrace}} \tab Prints the stack trace saved when the exception was created.\cr \tab \code{\link[R.oo:throw.Exception]{throw}} \tab Throws an Exception that can be caught.\cr } \bold{Methods inherited from error}:\cr as.character, throw \bold{Methods inherited from condition}:\cr abort, as.character, conditionCall, conditionMessage, print \bold{Methods inherited from Object}:\cr $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save } \examples{ ###################################################################### # 1. To catch a regular "error" exception thrown by e.g. stop(). ###################################################################### x <- NA y <- NA tryCatch({ x <- log(123) y <- log("a") }, error = function(ex) { print(ex) }) print(x) print(y) ###################################################################### # 2. Always run a "final" expression regardless or error or not. ###################################################################### filename <- tempfile("R.methodsS3.example") con <- file(filename) tryCatch({ open(con, "r") }, error = function(ex) { cat("Could not open ", filename, " for reading.\n", sep="") }, finally = { close(con) cat("The id of the connection is ", ifelse(is.null(con), "NULL", con), ".\n", sep="") }) ###################################################################### # 3. Creating your own Exception class ###################################################################### setConstructorS3("NegativeLogValueException", function( msg="Trying to calculate the logarithm of a negative value", value=NULL) { extend(Exception(msg=msg), "NegativeLogValueException", .value = value ) }) setMethodS3("as.character", "NegativeLogValueException", function(this, ...) { paste(as.character.Exception(this), ": ", getValue(this), sep="") }) setMethodS3("getValue", "NegativeLogValueException", function(this, ...) { this$.value }) mylog <- function(x, base=exp(1)) { if (x < 0) throw(NegativeLogValueException(value=x)) else log(x, base=base) } # Note that the order of the catch list is important: l <- NA x <- 123 tryCatch({ l <- mylog(x) }, NegativeLogValueException = function(ex) { cat(as.character(ex), "\n") }, "try-error" = function(ex) { cat("try-error: Could not calculate the logarithm of ", x, ".\n", sep="") }, error = function(ex) { cat("error: Could not calculate the logarithm of ", x, ".\n", sep="") }) cat("The logarithm of ", x, " is ", l, ".\n\n", sep="") } \author{Henrik Bengtsson} \seealso{ See also \code{\link[base:conditions]{tryCatch}()} (and \code{\link[base]{try}}()). } \keyword{programming} \keyword{methods} \keyword{error} \keyword{classes} R.oo/man/getFields.Object.Rd0000755000177400001440000000256213005563375015455 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getFields.Object} \alias{getFields.Object} \alias{Object.getFields} \alias{getFields,Object-method} \alias{Object.names} \alias{names.Object} \alias{names,Object-method} \title{Returns the field names of an Object} \description{ Returns the field names of an Object. } \usage{ \method{getFields}{Object}(this, private=FALSE, ...) } \arguments{ \item{private}{If \code{\link[base:logical]{TRUE}}, private fields will also be returned, otherwise only public fields are returned.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} \code{\link[base]{vector}} of field names. } \examples{ obj <- Object() obj$x <- 1:100 obj$y <- 100:1 getFields(obj) \dontrun{ gives: [1] "x" "y" } } \author{Henrik Bengtsson} \seealso{ To check if a field exists or not, see \code{\link[R.oo:hasField.Object]{*hasField}()}. For more extensive information about the fields in an Object see \code{\link[R.oo:ll.Object]{*ll}()}. For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/clone.Object.Rd0000755000177400001440000000177113005563375014650 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{clone.Object} \alias{clone.Object} \alias{Object.clone} \alias{clone,Object-method} \title{Clones an Object} \description{ Creates an identical copy of the object and returns a reference to the new object. } \usage{ \method{clone}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ A reference to the new object. } \examples{ o1 <- Object() o2 <- clone(o1) print(equals(o1, o2)) } \details{ Please note that no constructors are called during the creation of the clone and neither is any static class code called. } \seealso{ For more information see \code{\link{Object}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getRdHierarchy.Class.Rd0000755000177400001440000000146513005563377016315 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Class.misc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getRdHierarchy.Class} \alias{getRdHierarchy.Class} \alias{Class.getRdHierarchy} \alias{getRdHierarchy,Class-method} \title{Gets the class hierarchy in Rd format} \description{ Gets the class hierarchy in Rd format. } \usage{ \method{getRdHierarchy}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/DOLLARLT_-.BasicObject.Rd0000755000177400001440000000232513005563377016141 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{DOLLAR< -.BasicObject} \alias{$<-.BasicObject} \alias{BasicObject.$<-} \alias{$<-,BasicObject-method} \alias{BasicObject.[[<-} \alias{[[<-.BasicObject} \alias{[[<-,BasicObject-method} \title{Makes the fields and methods of an BasicObject assignable via the \$<- and the [[<- operator} \description{ Makes the fields and methods of an BasicObject assignable via the \$<- and the [[<- operator. } \usage{ \method{$}{BasicObject}(this, name) <- value \method{[[}{BasicObject}(this, name) <- value } \arguments{ \item{name}{The name of the \preformatted{set()} method or the name of the field to be assigned the new value.} \item{value}{The value to be assigned.} } \value{ Returns itself, i.e. \code{this}, as all \code{$<-} methods must do. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/Rdoc.Rd0000755000177400001440000000762213005563401013221 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc} \docType{class} \alias{Rdoc} \title{Class for converting Rdoc comments to Rd files} \description{ Package: R.oo \cr \bold{Class Rdoc}\cr \code{\link[R.oo]{Object}}\cr \code{~~|}\cr \code{~~+--}\code{Rdoc}\cr \bold{Directly known subclasses:}\cr \cr public static class \bold{Rdoc}\cr extends \link[R.oo]{Object}\cr Class for converting Rdoc comments to Rd files. } \usage{ Rdoc() } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{\link[R.oo:argsToString.Rdoc]{argsToString}} \tab Gets the arguments signature of a function.\cr \tab \code{\link[R.oo:check.Rdoc]{check}} \tab Checks the compiled Rd files.\cr \tab \code{\link[R.oo:compile.Rdoc]{compile}} \tab Compile source code files containing Rdoc comments into Rd files.\cr \tab \code{\link[R.oo:createManPath.Rdoc]{createManPath}} \tab Creates the directory where the Rd files should be saved.\cr \tab \code{\link[R.oo:createName.Rdoc]{createName}} \tab Creates a class-method name.\cr \tab \code{\link[R.oo:declaration.Rdoc]{declaration}} \tab Gets the class declaration.\cr \tab \code{\link[R.oo:escapeRdFilename.Rdoc]{escapeRdFilename}} \tab Escape non-valid characters in a filename.\cr \tab \code{\link[R.oo:getClassS4Usage.Rdoc]{getClassS4Usage}} \tab Gets the usage of a S4 class.\cr \tab \code{\link[R.oo:getKeywords.Rdoc]{getKeywords}} \tab Gets the keywords defined in R with descriptions.\cr \tab \code{\link[R.oo:getManPath.Rdoc]{getManPath}} \tab Gets the path to the directory where the Rd files will be saved.\cr \tab \code{\link[R.oo:getNameFormat.Rdoc]{getNameFormat}} \tab Gets the current name format.\cr \tab \code{getObject} \tab -\cr \tab \code{\link[R.oo:getPackageNameOf.Rdoc]{getPackageNameOf}} \tab Gets the package of a method or an object.\cr \tab \code{\link[R.oo:getRdTitle.Rdoc]{getRdTitle}} \tab Extracts the title string of a Rd file.\cr \tab \code{\link[R.oo:getUsage.Rdoc]{getUsage}} \tab Gets the usage of a method.\cr \tab \code{\link[R.oo:hierarchy.Rdoc]{hierarchy}} \tab Gets the class hierarchy.\cr \tab \code{\link[R.oo:isKeyword.Rdoc]{isKeyword}} \tab Checks if a word is a Rd keyword.\cr \tab \code{\link[R.oo:isVisible.Rdoc]{isVisible}} \tab Checks if a member is visible given its modifiers.\cr \tab \code{\link[R.oo:methodsInheritedFrom.Rdoc]{methodsInheritedFrom}} \tab Gets all methods inherited from a class in Rd format.\cr \tab \code{\link[R.oo:setManPath.Rdoc]{setManPath}} \tab Sets the path to the directory where the Rd files should be saved.\cr \tab \code{\link[R.oo:setNameFormat.Rdoc]{setNameFormat}} \tab Sets the current name format.\cr } \bold{Methods inherited from Object}:\cr $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save } \author{Henrik Bengtsson} \examples{\dontrun{# Set default author author <- "Henrik Bengtsson, \\url{http://www.braju.com/R/}" # Show the file containing the Rdoc comments rdocFile <- system.file("misc", "ASCII.R", package="R.oo") file.show(rdocFile) # Compile the Rdoc:s into Rd files (saved in the destPath directory) destPath <- tempdir() Rdoc$compile(rdocFile, destPath=destPath) # List the generated Rd files rdFiles <- list.files(destPath, full.names=TRUE) print(rdFiles) # Show one of the files file.show(rdFiles[1]) # Clean up file.remove(rdFiles) }} \references{ R developers, \emph{Guidelines for Rd files}, \url{http://developer.r-project.org/Rds.html}, 2003 } \keyword{classes} \keyword{documentation} R.oo/man/getEnvironment.Object.Rd0000755000177400001440000000166013005563375016551 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getEnvironment.Object} \alias{getEnvironment.Object} \alias{Object.getEnvironment} \alias{getEnvironment,Object-method} \title{Gets the environment of this object} \description{ Gets the environment of this object. This is the environment where the members of the Object are stored. } \usage{ \method{getEnvironment}{Object}(fun, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns an \code{\link[base]{environment}}. } \examples{ ll(R.oo) ll(envir=getEnvironment(R.oo)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/hashCode.BasicObject.Rd0000755000177400001440000000155213005563377016227 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{hashCode.BasicObject} \alias{hashCode.BasicObject} \alias{BasicObject.hashCode} \alias{hashCode,BasicObject-method} \title{Gets a hash code for the object} \description{ Gets a hash code for the object. } \usage{ \method{hashCode}{BasicObject}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns an \code{\link[base]{integer}}. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:equals.BasicObject]{*equals}()} For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/isPrivate.Class.Rd0000755000177400001440000000204213005563376015346 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isPrivate.Class} \alias{isPrivate.Class} \alias{Class.isPrivate} \alias{isPrivate,Class-method} \title{Checks if a class is defined private or not} \description{ Checks if a class is defined private or not. } \usage{ \method{isPrivate}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the class is private, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ if (isPrivate(RccViolationException)) throw("The class RccViolationException should NOT be private.") } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{class}}(). \code{\link{setConstructorS3}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/print.Class.Rd0000755000177400001440000000166713005563376014550 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{print.Class} \alias{print.Class} \alias{Class.print} \alias{print,Class-method} \title{Prints detailed information about the class and its fields and methods} \description{ Prints detailed information about the class and its fields and methods. } \usage{ \method{print}{Class}(x, ...) } \arguments{ \item{...}{Arguments passed to \code{\link[R.oo:getDetails.Class]{*getDetails}()}.} } \value{ Returns nothing. } \examples{ print(Object) } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getDetails.Class]{*getDetails}()} For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/update.Package.Rd0000755000177400001440000000272012726216524015152 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 999.DEPRECATED.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{update.Package} \alias{update.Package} \alias{Package.update} \alias{update,Package-method} \title{Deprecated: Updates the package is a newer version is available} \description{ \emph{This method is defunct. Use \code{\link[utils]{update.packages}} instead.} } \usage{ \method{update}{Package}(object, contribUrl=c(getContribUrl(object), getDevelUrl(object)), force=FALSE, reload=TRUE, verbose=TRUE, ...) } \arguments{ \item{contribUrl}{The URL from where the package can be installed and updated. By default the URL according to the DESCRIPTION is assumed. If the URL is missing, CRAN is assumed.} \item{force}{If \code{\link[base:logical]{TRUE}}, the package will reinstalled even if it is up to date according to the version number.} \item{verbose}{If \code{\link[base:logical]{TRUE}}, more detailed information is returned.} \item{...}{Not used.} } \value{ Returns (invisibly) \code{\link[base:logical]{TRUE}} if the package was updated, otherwise \code{\link[base:logical]{FALSE}}. } \author{Henrik Bengtsson} \seealso{ \code{\link[utils]{update.packages}}. For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getInstantiationTime.BasicObject.Rd0000644000177400001440000000230213005563377020643 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getInstantiationTime.BasicObject} \alias{getInstantiationTime.BasicObject} \alias{BasicObject.getInstantiationTime} \alias{getInstantiationTime,BasicObject-method} \title{Gets the time when the object was instantiated} \description{ Gets the time when the object was instantiated (created) as a POSIXt object. } \usage{ \method{getInstantiationTime}{BasicObject}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a POSIXt object, which extends class POSIXct. } \details{ The instantiation timestamp is set when the object is created, and only of option \code{"R.oo::BasicObject/instantiationTime"} is \code{\link[base:logical]{TRUE}}. } \seealso{ For more about time formats and POSIX see \code{\link[base]{DateTimeClasses}}. For more information see \code{\link{BasicObject}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getConstructorS3.Rd0000644000177400001440000000145113005563401015554 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % getConstructorS3.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getConstructorS3} \alias{getConstructorS3.default} \alias{getConstructorS3} \title{Get a constructor method} \description{ Get a constructor method. } \usage{ \method{getConstructorS3}{default}(name, ...) } \arguments{ \item{name}{The name of the constructor function.} \item{...}{Not used.} } \seealso{ \code{\link{setConstructorS3}}(). \code{\link[R.methodsS3]{getMethodS3}}. \code{\link[R.methodsS3]{isGenericS3}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} R.oo/man/hasField.Object.Rd0000755000177400001440000000244413005563375015265 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{hasField.Object} \alias{hasField.Object} \alias{Object.hasField} \alias{hasField,Object-method} \title{Checks if a field exists or not} \description{ Checks if a field exists or not. } \usage{ \method{hasField}{Object}(this, field, ...) } \arguments{ \item{field}{\code{\link[base]{vector}} of fields to be checked if they exists or not.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{logical}} \code{\link[base]{vector}} indicating for each field if it exists or not. } \examples{ obj <- Object() obj$x <- 1:100 obj$y <- 100:1 hasField(obj, c("x", "a", "b", "y")) \dontrun{ gives: [1] TRUE FALSE FALSE TRUE } } \author{Henrik Bengtsson} \seealso{ To get the fields of an Object, see \code{\link[R.oo:getFields.Object]{*getFields}()}. For more extensive information about the fields in an Object see \code{\link[R.oo:ll.Object]{*ll}()}. For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/equals.Object.Rd0000755000177400001440000000421213005563375015033 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{equals.Object} \alias{equals.Object} \alias{Object.equals} \alias{equals,Object-method} \title{Compares an object with another} \description{ Compares an object with another and returns \code{\link[base:logical]{TRUE}} if they are equal. The equal property must be 1) \emph{reflexive}, i.e. \code{equals(o1,o1)} should be \code{\link[base:logical]{TRUE}}. 2) \emph{symmetric}, i.e. \code{equals(o1,o2)} is \code{\link[base:logical]{TRUE}} if and only if \code{equals(o2,o1)} is \code{\link[base:logical]{TRUE}}. 3) \emph{transitive}, i.e. \code{equals(o1,o2)} is \code{\link[base:logical]{TRUE}} and \code{equals(o2,o3)} is \code{\link[base:logical]{TRUE}}, then \code{equals(o1,o3)} should be \code{\link[base:logical]{TRUE}}. 5) \emph{consistent}, i.e. \code{equals(o1,o2)} should return the same result on multiple invocations as long as nothing has changed. 6) \code{equals(o1,}\code{\link[base]{NULL}}\code{)} should return \code{\link[base:logical]{FALSE}}, unless \code{o1} is also \code{\link[base]{NULL}}. By default, the method returns \code{\link[base:logical]{TRUE}} if and only if the two references compared refer to the same \code{\link[R.oo]{Object}}, i.e. \code{( !is.null(obj) && (hashCode(this) == hashCode(obj)) )}. } \usage{ \method{equals}{Object}(this, other, ...) } \arguments{ \item{other}{The other object this \code{\link[R.oo]{Object}} should be compared to.} \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the Object's are equal, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ o1 <- Object() o2 <- clone(o1) equals(o1, o1) # TRUE equals(o1, o2) # FALSE } \seealso{ \code{\link[R.oo:hashCode.Object]{*hashCode}()}. For more information see \code{\link{Object}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/staticCode.Object.Rd0000755000177400001440000000255213005563375015630 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{staticCode.Object} \alias{staticCode.Object} \alias{Object.staticCode} \alias{staticCode,Object-method} \title{Method that will be call each time a new instance of a class is created} \description{ Method that will be call each time a new instance of a class is created. By extending this method it is possible to have static code that is called each time a new instance of a class is created. } \usage{ \method{staticCode}{Object}(static, ...) } \arguments{ \item{static}{The static instance of this class.} \item{...}{Not used.} } \value{ Returns nothing. } \details{ The method \code{extend()} in the Object class will call this method just before returning and it will pass the static instance of the class as a reference. Note that method should never be called explicitly. Any value returned by this method will be ignored. } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getStaticInstance.Class.Rd0000755000177400001440000000156613005563376017026 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getStaticInstance.Class} \alias{getStaticInstance.Class} \alias{Class.getStaticInstance} \alias{getStaticInstance,Class-method} \title{Gets the static instance of this class} \description{ Gets the static instance of this class. } \usage{ \method{getStaticInstance}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a reference to an \code{\link{Object}}. } \examples{ obj <- getStaticInstance(Object) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/getNameFormat.Rdoc.Rd0000755000177400001440000000167213005563401015750 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$getNameFormat} \alias{Rdoc$getNameFormat} \alias{getNameFormat.Rdoc} \alias{Rdoc.getNameFormat} \alias{getNameFormat,Rdoc-method} \title{Gets the current name format} \description{ Gets the current name format. } \usage{ ## Static method (use this): ## Rdoc$getNameFormat(...) ## Don't use the below: \method{getNameFormat}{Rdoc}(static, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:setNameFormat.Rdoc]{*setNameFormat}()} For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getContents.Package.Rd0000755000177400001440000000152613005563400016155 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getContents.Package} \alias{getContents.Package} \alias{Package.getContents} \alias{getContents,Package-method} \title{Gets the contents of this package} \description{ Gets the contents of this package, i.e. the parsed \code{CONTENTS} file. } \usage{ \method{getContents}{Package}(this, fields=NULL, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{data.frame}}. } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{dcf}}. For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/throw.Rd0000755000177400001440000000305713005563401013473 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % throw.default.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{throw} \alias{throw.default} \alias{throw} \title{Throws an Exception} \description{ Throws an exception similar to \code{stop()}, but with support for \code{\link{Exception}} classes. The first argument (\code{object}) is by default pasted together with other arguments (\code{...}) and with seperator \code{sep=""}. For instance, to throw an exception, write \code{throw("Value out of range: ", value, ".")}. which is short for \code{throw(Exception("Value out of range: ", value, "."))}. Note that \code{throw()} can be defined for classes inheriting \code{\link{Exception}}, which can then be caught (or not) using \code{\link[base:conditions]{tryCatch}()}. } \usage{ \method{throw}{default}(...) } \arguments{ \item{...}{One or several strings that are concatenated and collapsed into on message string.} } \value{ Returns nothing. } \examples{ rbern <- function(n=1, prob=1/2) { if (prob < 0 || prob > 1) throw("Argument 'prob' is out of range: ", prob) rbinom(n=n, size=1, prob=prob) } rbern(10, 0.4) # [1] 0 1 0 0 0 1 0 0 1 0 tryCatch(rbern(10, 10*0.4), error=function(ex) {} ) } \author{Henrik Bengtsson} \seealso{ See the \code{\link{Exception}} class for more detailed information. } \keyword{error} R.oo/man/newInstance.Object.Rd0000755000177400001440000000202013005563375016012 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{newInstance.Object} \alias{newInstance.Object} \alias{Object.newInstance} \alias{newInstance,Object-method} \title{Creates a new instance of the same class as this object} \description{ Creates a new instance of the same class as this object. } \usage{ \method{newInstance}{Object}(this, ...) } \arguments{ \item{...}{Arguments passed to the constructor of the corresponding \code{\link{Object}} class.} } \value{ Returns a reference to an instance of \code{\link{Object}} or a subclass thereof. } \author{Henrik Bengtsson} \seealso{ \code{\link{newInstance.Class}}(). \code{\link{newInstance.BasicObject}}(). For more information see \code{\link{Object}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/getStaticInstance.Object.Rd0000755000177400001440000000167213005563375017164 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getStaticInstance.Object} \alias{getStaticInstance.Object} \alias{Object.getStaticInstance} \alias{getStaticInstance,Object-method} \title{Gets the static instance of this objects class} \description{ Gets the static instance of this objects class. } \usage{ \method{getStaticInstance}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a reference to an \code{\link[R.oo]{Object}}. } \examples{ ex <- Exception("Oops!") obj <- getStaticInstance(ex) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/newInstance.Class.Rd0000755000177400001440000000217513005563376015665 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{newInstance.Class} \alias{newInstance.Class} \alias{Class.newInstance} \alias{newInstance,Class-method} \title{Creates a new instance of this class} \description{ Creates a new instance of this class. Important: It should always be possible to create a new Object by calling the constructor without arguments. This method is simply calling the constructor method of the class. } \usage{ \method{newInstance}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a reference to an \code{\link{Object}}. } \examples{ obj <- newInstance(Object, NA) # equivalent to obj <- Object(NA) } \author{Henrik Bengtsson} \seealso{ \code{\link{newInstance.Object}}(). \code{\link{newInstance.BasicObject}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/as.character.RccViolationException.Rd0000755000177400001440000000216113005563400021132 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % RccViolationException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{as.character.RccViolationException} \alias{as.character.RccViolationException} \alias{RccViolationException.as.character} \alias{as.character,RccViolationException-method} \title{Gets a string representing of the RCC violation} \description{ Gets a string representing of the RCC violation of format "[\{POSIX date string\}] \{class name\}: \{msg\}, cf. http://aroma-project.org/developers/RCC/". } \usage{ \method{as.character}{RccViolationException}(x, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{\dontrun{For a complete example see help(Exception).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{RccViolationException}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/extend.Object.Rd0000755000177400001440000000554113005563375015036 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{extend.Object} \alias{extend.Object} \alias{Object.extend} \alias{extend,Object-method} \title{Extends another class} \description{ via a mechanism known as "parasitic inheritance". Simply speaking this method "extends another class". What is actually happening is that it creates an instance of class name \code{...className}, by taking another Object instance and add \code{...className} to the class list and also add all the named values in \code{...} as fields to the new instance. The method should be used by the constructor of a class and nowhere else. } \usage{ \method{extend}{Object}(this, ...className, ..., ...fields=NULL, ...envir=parent.frame(), ...finalize=NA) } \arguments{ \item{...className}{The name of new class.} \item{...}{Named values representing the fields of the new instance.} \item{...fields}{An optional named \code{\link[base]{list}} of fields. This makes it possible to specify a set of fields using a \code{\link[base]{list}} object.} \item{...envir}{An \code{\link[base]{environment}}.} \item{...finalize}{ A \code{\link[base]{logical}} controlling whether method \code{\link[R.oo:finalize.Object]{*finalize}()} should be called on the \code{\link{Object}} when it is garbage collected or not. If \code{\link[base:logical]{TRUE}}, it will be called. If \code{\link[base:logical]{FALSE}}, it will not be called. If \code{\link[base]{NA}}, it will be called according to argument \code{finalize} of the \code{\link{Object}} constructor. } } \value{ Returns an Object of class \code{className}. } \details{ The reason for the strange name of argument \code{"...className"} is that if one tries to set a field with a name that is a prefix of the name of this arguments and one at the same time does not specify the name of this argument one would run into strange errors. For instance, try \code{extend(Object(), "MyClass", ...c=0)}. } \section{Field modifiers}{ It is possible to specify modifiers to some of the fields. Currently it is only the \code{cached} modifier that is recognized. A field that is cached will be assigned \code{\link[base]{NULL}} when \code{\link[R.oo:clearCache.Object]{*clearCache}()} (or \code{\link[R.oo:gc.Object]{*gc}()}) is called. To specify a modifier, append a comma separated list of modifiers followed by a colon, e.g. "cached:foo". } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/isReferable.BasicObject.Rd0000755000177400001440000000166713005563377016743 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isReferable.BasicObject} \alias{isReferable.BasicObject} \alias{BasicObject.isReferable} \alias{isReferable,BasicObject-method} \title{Checks if the object is referable or not} \description{ Checks if the object is referable or not. } \usage{ \method{isReferable}{BasicObject}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{logical}} value, which by default is \code{\link[base:logical]{TRUE}} for all \code{\link{BasicObject}}'s. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getPath.Package.Rd0000755000177400001440000000142413005563400015251 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getPath.Package} \alias{getPath.Package} \alias{Package.getPath} \alias{getPath,Package-method} \title{Gets the library (system) path to this package} \description{ Gets the library (system) path to this package. } \usage{ \method{getPath}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/print.Exception.Rd0000755000177400001440000000207413005563377015433 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{print.Exception} \alias{print.Exception} \alias{Exception.print} \alias{print,Exception-method} \title{Prints the Exception} \description{ . By default the \code{as.character()} representation plus the stack trace is printed. } \usage{ \method{print}{Exception}(x, ...) } \arguments{ \item{...}{Not used.} } \value{Returns nothing.} \examples{\dontrun{For a complete example see help(Exception).}} \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:as.character.Exception]{*as.character}()}. \code{\link[R.oo:getStackTrace.Exception]{*getStackTrace}()}. \code{\link[R.oo:printStackTrace.Exception]{*printStackTrace}()}. For more information see \code{\link{Exception}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/ll.Rd0000755000177400001440000000753213005563401012741 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % ll.default.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{ll} \alias{ll.default} \alias{ll} \title{Generates a list of informative properties of all members of an environment} \description{ Generates a list of informative properties of all members of an environment. } \usage{ \method{ll}{default}(pattern=".*", ..., private=FALSE, properties=getOption("R.oo::ll/properties", c("data.class", "dimension", "objectSize")), sortBy=NULL, decreasing=FALSE, envir=parent.frame()) } \arguments{ \item{pattern}{Regular expression pattern specifying which members to return. If \code{".*"}, all names are matched.} \item{...}{A named \code{\link[base]{vector}} of format \code{functionName=value}, where \code{functionName()} will be called on each member found. If the result matches the \code{value}, the member is returned, otherwise not.} \item{private}{If \code{\link[base:logical]{TRUE}}, also private members, i.e. members with a name starting with a \code{.} (period), will be listed, otherwise not.} \item{properties}{Names of properties to be returned. There must exist a \code{\link[base]{function}} with the same name, because it will be called. This way one can extract any type of property by defining new methods.} \item{sortBy}{Name or index of column (property) to be sorted by. If \code{\link[base]{NULL}}, the objects are listed in the order they are found.} \item{decreasing}{A \code{\link[base]{logical}} indiciating whether the sorting should be done in increasing or decreasing order.} \item{envir}{An \code{\link[base]{environment}}, a search path index or a name of a package to be scanned.} } \value{ Returns a \code{\link[base]{data.frame}} containing information about all the members. } \section{Default properties returned}{ It is possible to set the default value of argument \code{properties} by setting option \code{"R.oo::ll/properties"}, e.g. \code{options("R.oo::ll/properties"=c("data.class", "dimension"))}. If this option is not set when the package is loaded, it is set to \code{c("data.class", "dimension", "objectSize")}. } \examples{ \dontrun{ To list all objects in .GlobalEnv: > ll() member data.class dimension objectSize 1 *tmp* Person 1 428 2 as.character.Person function NULL 1208 3 country character 1 44 4 equals.Person function NULL 2324 5 filename character 1 84 6 getAge function NULL 372 7 getAge.Person function NULL 612 8 getName.Person function NULL 628 9 hashCode.Person function NULL 1196 10 last.warning list 1 192 11 obj Person 1 428 12 Person Class NULL 2292 13 setAge function NULL 372 14 setAge.Person function NULL 2088 15 setName function NULL 372 16 setName.Person function NULL 760 17 staticCode.Person function NULL 2372 To list all functions in the methods package: ll(mode="function", envir="methods") To list all numeric and character object in the base package: ll(mode=c("numeric", "character"), envir="base") To list all objects in the base package greater than 40kb: subset(ll(envir="base"), objectSize > 40000) } } \author{Henrik Bengtsson} \seealso{ \code{\link[utils]{ls.str}} and \code{\link{ll.Object}}(). } \keyword{utilities} R.oo/man/objectSize.BasicObject.Rd0000755000177400001440000000206313005563377016610 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{objectSize.BasicObject} \alias{objectSize.BasicObject} \alias{BasicObject.objectSize} \alias{objectSize,BasicObject-method} \title{Gets the size of the BasicObject in bytes} \description{ Gets the size of the BasicObject in bytes by summing the sizes of all its members. For this reason, the size of memory the BasicObject actually allocates might vary slighty. } \usage{ \method{objectSize}{BasicObject}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns an \code{\link[base]{integer}} specifying the size of the object in number of bytes. } \author{Henrik Bengtsson} \seealso{ \code{\link[utils]{object.size}}. For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/argsToString.Rdoc.Rd0000755000177400001440000000245313005563401015643 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$argsToString} \alias{Rdoc$argsToString} \alias{argsToString.Rdoc} \alias{Rdoc.argsToString} \alias{argsToString,Rdoc-method} \title{Gets the arguments signature of a function} \description{ Gets the arguments signature of a function. } \usage{ ## Static method (use this): ## Rdoc$argsToString(fcn, escapeRd=FALSE, collapse=TRUE, ...) ## Don't use the below: \method{argsToString}{Rdoc}(static, fcn, escapeRd=FALSE, collapse=TRUE, ...) } \arguments{ \item{fcn}{A \code{\link[base]{function}}.} \item{escapeRd}{If \code{\link[base:logical]{TRUE}}, certain Rd markup symbols are escaped.} \item{collapse}{If \code{\link[base:logical]{TRUE}}, each argument is returned as a single string, otherwise split up into a vector of strings as far as possible.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{list}} of \code{\link[base]{character}} strings. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/Object.Rd0000755000177400001440000002613013005563375013545 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Object} \docType{class} \alias{Object} \title{The root class that every class must inherit from} \description{ R.oo\cr \bold{Class Object}\cr public class \bold{Object}\cr \code{Object} is the root class of all other classes. All classes \emph{must} extends this class, directly or indirectly, which means that they all will inherit the methods in this class. } \usage{ Object(core=NA, finalize=TRUE) } \arguments{ \item{core}{The core value of each \emph{reference} referering to the Object. By default, this is just the smallest possible \R object, but there are situations where it is useful to have another kind of core, which is the case with the Class class. \emph{Note that this value belongs to the reference variable and not to the Object, which means it can not be referenced.}} \item{finalize}{If \code{\link[base:logical]{TRUE}}, method \code{\link[R.oo:finalize.Object]{*finalize}()} will be called on this Object when it is garbage collected.} } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{$} \tab -\cr \tab \code{$<-} \tab -\cr \tab \code{.DollarNames} \tab -\cr \tab \code{.subset2Internal} \tab -\cr \tab \code{[[} \tab -\cr \tab \code{[[<-} \tab -\cr \tab \code{\link[R.oo:as.character.Object]{as.character}} \tab Gets a character string representing the object.\cr \tab \code{\link[R.oo:attach.Object]{attach}} \tab Attaches an Object to the R search path.\cr \tab \code{\link[R.oo:attachLocally.Object]{attachLocally}} \tab Attaches an Object locally to an environment.\cr \tab \code{\link[R.oo:clearCache.Object]{clearCache}} \tab Clear fields that are defined to have cached values.\cr \tab \code{\link[R.oo:clearLookupCache.Object]{clearLookupCache}} \tab Clear internal fields used for faster lookup.\cr \tab \code{\link[R.oo:clone.Object]{clone}} \tab Clones an Object.\cr \tab \code{\link[R.oo:detach.Object]{detach}} \tab Detach an Object from the R search path.\cr \tab \code{\link[R.oo:equals.Object]{equals}} \tab Compares an object with another.\cr \tab \code{\link[R.oo:extend.Object]{extend}} \tab Extends another class.\cr \tab \code{\link[R.oo:finalize.Object]{finalize}} \tab Finalizer methods called when object is clean out.\cr \tab \code{\link[R.oo:getEnvironment.Object]{getEnvironment}} \tab Gets the environment of this object.\cr \tab \code{getFieldModifier} \tab -\cr \tab \code{\link[R.oo:getFieldModifiers.Object]{getFieldModifiers}} \tab Gets all types of field modifiers.\cr \tab \code{\link[R.oo:getFields.Object]{getFields}} \tab Returns the field names of an Object.\cr \tab \code{\link[R.oo:getInstantiationTime.Object]{getInstantiationTime}} \tab Gets the time when the object was instantiated.\cr \tab \code{\link[R.oo:getInternalAddress.Object]{getInternalAddress}} \tab Gets the memory location where the Object resides.\cr \tab \code{\link[R.oo:getStaticInstance.Object]{getStaticInstance}} \tab Gets the static instance of this objects class.\cr \tab \code{\link[R.oo:hasField.Object]{hasField}} \tab Checks if a field exists or not.\cr \tab \code{\link[R.oo:hashCode.Object]{hashCode}} \tab Gets a hash code for the Object.\cr \tab \code{\link[R.oo:isReferable.Object]{isReferable}} \tab Checks if the object is referable or not.\cr \tab \code{\link[R.oo:ll.Object]{ll}} \tab Generates a list of informative properties of all members of an Object.\cr \tab \code{\link[R.oo:load.Object]{load}} \tab Static method to load an Object from a file or a connection.\cr \tab \code{names} \tab -\cr \tab \code{\link[R.oo:newInstance.Object]{newInstance}} \tab Creates a new instance of the same class as this object.\cr \tab \code{\link[R.oo:novirtual.Object]{novirtual}} \tab Returns a reference to the same Object with virtual fields turned off.\cr \tab \code{\link[R.oo:objectSize.Object]{objectSize}} \tab Gets the size of the Object in bytes.\cr \tab \code{\link[R.oo:print.Object]{print}} \tab Prints an Object.\cr \tab \code{\link[R.oo:save.Object]{save}} \tab Saves an Object to a file or a connection.\cr \tab \code{\link[R.oo:staticCode.Object]{staticCode}} \tab Method that will be call each time a new instance of a class is created.\cr } } \section{Defining static fields}{ To define a static field of an Object class, use a private field \code{<.field>} and then create a virtual field \code{} by defining methods \code{get()} and \code{set()}. These methods should retrieve and assign the value of the field \code{<.field>} of the \emph{static} instance of the class. The second example below shows how to do this. The example modifies also the static field already in the constructor, which is something that otherwise may be tricky. } \examples{ ######################################################################### # Defines the class Person with private fields .name and .age, and # with methods print(), getName(), setName(), getAge() and setAge(). ######################################################################### setConstructorS3("Person", function(name, age) { if (missing(name)) name <- NA; if (missing(age)) age <- NA; extend(Object(), "Person", .name=name, .age=age ) }) setMethodS3("as.character", "Person", function(this, ...) { paste(this$.name, "is", as.integer(this$.age), "years old."); }) setMethodS3("equals", "Person", function(this, obj, ...) { ( identical(data.class(this), data.class(obj)) && identical(this$getName(), obj$getName()) && identical(this$getAge() , obj$getAge() ) ); }) setMethodS3("hashCode", "Person", function(this, ...) { # Get the hashCode() of the '.name' and the '.age' fields # using hashCode.default(). hashCode(this$.name) * hashCode(this$.age); }) setMethodS3("getName", "Person", function(this, ...) { this$.name; }) setMethodS3("setName", "Person", function(this, newName, ...) { throw("It is not possible to change the name of a Person."); }) setMethodS3("getAge", "Person", function(this, ...) { this$.age; }) setMethodS3("setAge", "Person", function(this, newAge, ...) { if (!is.numeric(newAge)) throw("Age must be numeric: ", newAge); if (newAge < 0) throw("Trying to set a negative age: ", newAge); this$.age <- newAge; }) ######################################################################### # Code demonstrating different properties of the Object class using # the example class Person. ######################################################################### # Create an object (instance of) the class Person. p1 <- Person("Dalai Lama", 67) # 'p1' is an Object of class Person. print(data.class(p1)) # "Person" # Prints information about the Person object. print(p1) # "Dalai Lama is 67 years old." # or equivalent (except that no generic method has to exist): p1$print() # "Dalai Lama is 67 years old." # Shows that no generic method is required if the \$ operator is used: print(p1$getName()) # "Dalai Lama" # The following will call p1$getName() since there exists a get-() # method for the 'name' property. print(p1$name) # "Dalai Lama" # and equivalent when using the [[ operator. print(p1[["name"]]) # "Dalai Lama" # The following shows that p1$setName(68) is called, simply because # there exists a set-() method for the 'name' property. p1$age <- 68 # Will call p1$setAge(68) # Shows that the age of the Person has been updated: print(p1) # "Dalai Lama is 68 years old." # If there would not exists such a set-() method or field a new # field would be created: p1$country <- "Tibet" # Lists all (non-private) members of the Person object: print(ll(p1)) # which gives # member class mode typeof length dim bytes # 1 country NULL character character 1 NULL 44 # The following will call p1$setName("Lalai Dama") which will # throw an exception saying one can not change the name of # a Person. tryCatch(p1$name <- "Lalai Dama", error=print) # The following will call p1$setAge(-4) which will throw an # exception saying that the age must be a non-negative number. tryCatch(p1$age <- -100, error=print) # Attaches Object 'p1' to the search path. attach(p1) # Accesses the newly created field 'country'. print(country) # "Tibet" # Detaches Object 'p1' from the search path. Note that all # modifications to 'country' are lost. country <- "Sweden" detach(p1) print(p1$country) # "Tibet" # Saves the Person object to a tempory file. filename <- tempfile("R.methodsS3.example") save(p1, filename) # Deletes the object rm(p1) # Loads an Object (of "unknown" class) from file using the # static method load() of class Object. obj <- Object$load(filename) # Prints information about the new Object. print(obj) # Lists all (non-private) members of the new Object. print(ll(obj)) ###################################################################### # Example illustrating how to "emulate" static fields using virtual # fields, i.e. get- and set-methods. Here we use a private static # field '.count' of the static class instance 'MyClass', i.e. # MyClass$.count. Then we define a virtual field 'count' via method # getCount() to access this static field. This will make all queries # for 'count' of any object to use the static field instead. In the # same way is assignment controlled via the setCount() method. A # side effect of this way of coding is that all MyClass instances will # also have the private field '.count' (set to zero except for the # static field that is). ###################################################################### setConstructorS3("MyClass", function(...) { # Create an instance (the static class instance included) this <- extend(Object(), "MyClass", .count = 0 ) # In order for a static field to be updated in the # constructor it has to be done after extend(). this$count <- this$count + 1; # Return the object this; }) setMethodS3("as.character", "MyClass", function(this, ...) { paste(class(this)[1], ": Number of instances: ", this$count, sep=""); }) # Get virtual field 'count', e.g. obj$count. setMethodS3("getCount", "MyClass", function(this, ...) { MyClass$.count; }) # Set virtual field 'count', e.g. obj$count <- value. setMethodS3("setCount", "MyClass", function(this, value, ...) { MyClass$.count <- value; }) # Create four instances of class 'MyClass' obj <- lapply(1:4, MyClass) print(obj) print(MyClass$count) print(obj[[1]]$count) stopifnot(obj[[1]]$count == length(obj)) stopifnot(MyClass$count == length(obj)) } \author{Henrik Bengtsson} \references{ [1] H. Bengtsson, \emph{The R.oo package - Object-Oriented Programming with References Using Standard R Code}, In Kurt Hornik, Friedrich Leisch and Achim Zeileis, editors, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), March 20-22, Vienna, Austria. \url{https://www.r-project.org/conferences/DSC-2003/Proceedings/} \cr } \keyword{programming} \keyword{methods} \keyword{classes} R.oo/man/isReferable.Object.Rd0000755000177400001440000000163013005563375015765 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isReferable.Object} \alias{isReferable.Object} \alias{Object.isReferable} \alias{isReferable,Object-method} \title{Checks if the object is referable or not} \description{ Checks if the object is referable or not. } \usage{ \method{isReferable}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{logical}} value, which by default is \code{\link[base:logical]{TRUE}} for all \code{\link[R.oo]{Object}}'s. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getSource.RdocException.Rd0000755000177400001440000000144413005563401017033 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % RdocException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getSource.RdocException} \alias{getSource.RdocException} \alias{RdocException.getSource} \alias{getSource,RdocException-method} \title{Gets the source of the exception} \description{ . } \usage{ \method{getSource}{RdocException}(x, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns the source. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{RdocException}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/showChangeLog.Package.Rd0000755000177400001440000000233713005563400016411 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{showChangeLog.Package} \alias{showChangeLog.Package} \alias{Package.showChangeLog} \alias{showChangeLog,Package-method} \alias{Package.showHistory} \alias{showHistory.Package} \alias{showHistory,Package-method} \alias{Package.showNews} \alias{showNews.Package} \alias{showNews,Package-method} \title{Show the change log of this package} \description{ Show the change log of this package. If the change log file does not exist, an exception is thrown. } \usage{ \method{showChangeLog}{Package}(this, filenames=c("NEWS", "HISTORY", "ChangeLog"), ...) } \arguments{ \item{filenames}{A \code{\link[base]{character}} \code{\link[base]{vector}} of (non-case sensitive) filenames to be searched for.} \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getChangeLog.Package]{*getChangeLog}()}. For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/as.character.BasicObject.Rd0000755000177400001440000000154513005563377017051 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{as.character.BasicObject} \alias{as.character.BasicObject} \alias{BasicObject.as.character} \alias{as.character,BasicObject-method} \title{Gets a character string representing the object} \description{ Gets a character string representing the object. } \usage{ \method{as.character}{BasicObject}(x, ...) } \value{ Returns a \code{\link[base]{character}} string representation of the object. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getStackTrace.Exception.Rd0000755000177400001440000000221713005563377017022 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getStackTrace.Exception} \alias{getStackTrace.Exception} \alias{Exception.getStackTrace} \alias{getStackTrace,Exception-method} \title{Gets the stack trace saved when the exception was created} \description{ . } \usage{ \method{getStackTrace}{Exception}(this, cleanup=getOption("R.oo::Exception/getStackTrace/args/cleanup", TRUE), ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{list}} containing the stack trace. } \examples{\dontrun{For a complete example see help(Exception).}} \seealso{ \code{\link[R.oo:printStackTrace.Exception]{*printStackTrace}()}. \code{\link[utils:debugger]{dump.frames}()}. \code{\link[base:conditions]{tryCatch}()}. For more information see \code{\link{Exception}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/getFieldModifiers.Object.Rd0000644000177400001440000000155513005563375017132 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getFieldModifiers.Object} \alias{getFieldModifiers.Object} \alias{Object.getFieldModifiers} \alias{getFieldModifiers,Object-method} \alias{Object.getFieldModifier} \alias{getFieldModifier.Object} \alias{getFieldModifier,Object-method} \title{Gets all types of field modifiers} \description{ Gets all types of field modifiers, if any. } \usage{ \method{getFieldModifiers}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a named \code{\link[base]{list}}. } \author{Henrik Bengtsson} \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/showDescriptionFile.Package.Rd0000755000177400001440000000156013005563400017642 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{showDescriptionFile.Package} \alias{showDescriptionFile.Package} \alias{Package.showDescriptionFile} \alias{showDescriptionFile,Package-method} \title{Show the DESCRIPTION file of this package} \description{ Show the DESCRIPTION file of this package. If the \code{DESCRIPTION} file does not exist, an exception is thrown. } \usage{ \method{showDescriptionFile}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/setManPath.Rdoc.Rd0000755000177400001440000000217013005563401015255 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$setManPath} \alias{Rdoc$setManPath} \alias{setManPath.Rdoc} \alias{Rdoc.setManPath} \alias{setManPath,Rdoc-method} \title{Sets the path to the directory where the Rd files should be saved} \description{ Sets the path to the directory where the Rd files should be saved. By default the path is \code{../man/} assuming that the current directory is \code{../R/}, which is where source files commonly are placed. } \usage{ ## Static method (use this): ## Rdoc$setManPath(path="../man/", ...) ## Don't use the below: \method{setManPath}{Rdoc}(this, path="../man/", ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getManPath.Rdoc]{*getManPath}()} For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/forName.Class.Rd0000755000177400001440000000211013005563376014763 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Class$forName} \alias{Class$forName} \alias{forName.Class} \alias{Class.forName} \alias{forName,Class-method} \title{Gets a Class object by a name of a class} \description{ Gets a Class object by a name of a class. If no such class exists and exception is thrown. } \usage{ ## Static method (use this): ## Class$forName(name, ...) ## Don't use the below: \method{forName}{Class}(static, name, ...) } \arguments{ \item{...}{Optional arguments passed to internal lookup function.} } \value{ Returns a \code{\link{Class}}. } \examples{ print(Class$forName("Exception")) } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{class}}(). \code{\link{setConstructorS3}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/as.character.Object.Rd0000755000177400001440000000213713005563375016103 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{as.character.Object} \alias{as.character.Object} \alias{Object.as.character} \alias{as.character,Object-method} \title{Gets a character string representing the object} \description{ Gets a character string representing the object. In the class Object, this method simply returns the class name and the hashCode() value of the object. } \usage{ \method{as.character}{Object}(x, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string representation of the Object. By default it is "\{class name\}: \{hash code\}". } \examples{ obj <- Object() as.character(obj) # "Object: 0x000000000ab6a7a8" } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/abort.Rd0000644000177400001440000000423613005563401013434 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % abort.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{abort} \alias{abort.default} \alias{abort} \alias{abort.condition} \title{Aborts the current expression call} \description{ Aborts the current expression call and returns to the top level prompt/browser \emph{without signalling a condition}. } \usage{ \method{abort}{default}(..., call.=TRUE, domain=NULL) } \arguments{ \item{...}{(optional) Objects coerced to \code{\link[base]{character}} and pasted together without a separator, or a @condition object. If no object are given, no message is printed.} \item{call.}{If \code{\link[base:logical]{TRUE}}, the call is added to the message, otherwise not.} \item{domain}{Used to translate the message (see \code{\link[base]{gettext}}()). If \code{\link[base]{NA}}, messages will not be translated.} } \value{ Returns nothing. } \details{ There are still cases where one can "catch" the abort and undo it, cf. [1]. } \examples{\dontrun{ foo <- function() { cat("foo()...\n") on.exit(cat("foo()...done\n")) tryCatch({ stop("Woops!") }, error = function(ex) { cat("An error was caught: ", ex$message, "\n", sep="") }) cat("Continuing...\n") } bar <- function() { cat("bar()...\n") on.exit(cat("bar()...done\n")) tryCatch({ abort("Woops!") }, error = function(ex) { cat("An error was caught: ", ex$message, "\n", sep="") }) cat("This message will never be displayed...\n") } # An error generated by stop() can be caught foo() # ...which is not possible when using abort() bar() # This expression is never reached cat("This line will never be outputted.\n") }} \author{Henrik Bengtsson} \seealso{ \code{\link{throw}}(). \code{\link[base]{stop}}(). Internally, \code{\link[base]{invokeRestart}}()\code{("abort")} is utilized. } \references{ [1] R-devel thread '', Sept 11, 2012, \url{https://stat.ethz.ch/pipermail/r-devel/2012-September/064838.html}.\cr } \keyword{error} \keyword{internal} R.oo/man/clearCache.Object.Rd0000755000177400001440000000503313005563375015555 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{clearCache.Object} \alias{clearCache.Object} \alias{Object.clearCache} \alias{clearCache,Object-method} \title{Clear fields that are defined to have cached values} \description{ Clear fields that are defined to have cached values by assigning \code{\link[base]{NULL}} to these fields. } \usage{ \method{clearCache}{Object}(this, recursive=TRUE, gc=FALSE, ...) } \arguments{ \item{recursive}{If \code{\link[base:logical]{TRUE}}, the same method is called also on all fields that are \code{\link{Object}}:s. Circular dependencies can exists.} \item{gc}{If \code{\link[base:logical]{TRUE}}, the garbage collector is called, otherwise not.} \item{...}{Not used.} } \value{ Returns itself (invisible). } \examples{ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Defining a class with a 'cached' fields # - - - - - - - - - - - - - - - - - - - - - - - - - - - - setConstructorS3("CachedObject", function(...) { extend(Object(), "CachedObject", ... ) }) setMethodS3("as.character", "CachedObject", function(this, ...) { s <- NextMethod("as.character", this, ...) s <- sprintf("\%s RAM: \%.2fkb.", s, objectSize(this)/1024) s }) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Example of clearing a cache fields, reassigning it, # and then clearing it again # - - - - - - - - - - - - - - - - - - - - - - - - - - - - obj <- CachedObject(a=1, b=1:10^5, "cached:c"=1:10^6) print(obj) print(ll(obj)) clearCache(obj, gc=TRUE) print(obj) print(ll(obj)) obj$c <- 1:10^6 print(obj) print(ll(obj)) clearCache(obj, gc=TRUE) print(obj) print(ll(obj)) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Clearing cached fields recursively and make sure it # avoids race conditions due to circular dependences # - - - - - - - - - - - - - - - - - - - - - - - - - - - - objA <- CachedObject(a=2, "cached:c"=1:10^6, prev=NULL) print(ll(objA)) objB <- CachedObject(a=2, "cached:c"=1:10^6, prev=objA) print(ll(objB)) objC <- CachedObject(a=3, "cached:c"=1:10^6, prev=objB) print(ll(objC)) objA$prev <- objC; clearCache(objA, gc=TRUE) print(ll(objA)) print(ll(objB)) print(ll(objC)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/getClasses.Package.Rd0000644000177400001440000000154413005563400015752 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getClasses.Package} \alias{getClasses.Package} \alias{Package.getClasses} \alias{getClasses,Package-method} \title{Gets all classes of a package} \description{ Gets all classes of a package. } \usage{ \method{getClasses}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} \code{\link[base]{vector}} of class names. } \examples{ pkg <- Package("R.oo") print(getClasses(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getDetails.Class.Rd0000755000177400001440000000151713005563376015473 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getDetails.Class} \alias{getDetails.Class} \alias{Class.getDetails} \alias{getDetails,Class-method} \title{Lists the fields and methods of a class} \description{ Lists the fields and methods of a class (or an object). } \usage{ \method{getDetails}{Class}(this, private=FALSE, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns an invisible \code{\link[base]{character}} string of the class information. } \examples{ getDetails(Exception) } \author{Henrik Bengtsson} \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/getDescription.Package.Rd0000755000177400001440000000213613005563400016641 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getDescription.Package} \alias{getDescription.Package} \alias{Package.getDescription} \alias{getDescription,Package-method} \title{Gets the description of the package} \description{ Gets the description of the package. Not to be mixed up with \code{\link[R.oo:getDescriptionFile.Package]{*getDescriptionFile}()}. } \usage{ \method{getDescription}{Package}(this, replaceNewlines=" ", ...) } \arguments{ \item{replaceNewlines}{If a \code{\link[base]{character}} string, all newline characters are replaced with this string. Otherwise not.} \item{...}{Not used.} } \value{ A \code{\link[base]{character}} string. } \examples{ pkg <- Package("base") print(getDescription(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getManPath.Rdoc.Rd0000755000177400001440000000174313005563401015246 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$getManPath} \alias{Rdoc$getManPath} \alias{getManPath.Rdoc} \alias{Rdoc.getManPath} \alias{getManPath,Rdoc-method} \title{Gets the path to the directory where the Rd files will be saved} \description{ Gets the path to the directory where the Rd files will be saved. } \usage{ ## Static method (use this): ## Rdoc$getManPath(...) ## Don't use the below: \method{getManPath}{Rdoc}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:setManPath.Rdoc]{*setManPath}()} For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getMessage.Exception.Rd0000755000177400001440000000162013005563377016357 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getMessage.Exception} \alias{getMessage.Exception} \alias{Exception.getMessage} \alias{getMessage,Exception-method} \title{Gets the message of the Exception} \description{ Gets the message of the Exception. } \usage{ \method{getMessage}{Exception}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{\dontrun{For a complete example see help(Exception).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Exception}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/getKnownSubclasses.classRepresentation.Rd0000755000177400001440000000134613005563401022202 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % classRepresentation.misc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getKnownSubclasses.classRepresentation} \alias{getKnownSubclasses.classRepresentation} \title{Gets the known subclasses} \description{ Gets the known subclasses. } \usage{ \method{getKnownSubclasses}{classRepresentation}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \keyword{methods} \keyword{internal} \keyword{documentation} R.oo/man/objectSize.Object.Rd0000755000177400001440000000232113005563375015641 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{objectSize.Object} \alias{objectSize.Object} \alias{Object.objectSize} \alias{objectSize,Object-method} \title{Gets the size of the Object in bytes} \description{ Gets the size of the Object in bytes by summing the sizes of all its members. For this reason, the size of memory the Object actually allocates might vary slighty. } \usage{ \method{objectSize}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns an \code{\link[base]{integer}} specifying the size of the object in number of bytes. } \examples{ obj <- Object() obj$x <- 1:100 obj$y <- 100:1 objectSize(obj) # 856 } \author{Henrik Bengtsson} \seealso{ To clear fields that are declared \code{cached}, see \code{\link[R.oo:clearCache.Object]{*clearCache}()}. \code{\link[utils]{object.size}}. For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getRdMethods.Class.Rd0000755000177400001440000000172013005563377015774 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Class.misc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getRdMethods.Class} \alias{getRdMethods.Class} \alias{Class.getRdMethods} \alias{getRdMethods,Class-method} \title{Gets the methods of a class in Rd format} \description{ Gets the methods of a class in Rd format. } \usage{ \method{getRdMethods}{Class}(class, visibilities=c("private", "protected", "public"), ...) } \arguments{ \item{visibilities}{A \code{\link[base]{character}} string specifying what types of methods to return.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/newInstance.BasicObject.Rd0000644000177400001440000000206413005563377016763 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{newInstance.BasicObject} \alias{newInstance.BasicObject} \alias{BasicObject.newInstance} \alias{newInstance,BasicObject-method} \title{Creates a new instance of the same class as this object} \description{ Creates a new instance of the same class as this object. } \usage{ \method{newInstance}{BasicObject}(this, ...) } \arguments{ \item{...}{Arguments passed to the constructor of the corresponding \code{\link{BasicObject}} class.} } \value{ Returns a reference to an instance of \code{\link{BasicObject}} or a subclass thereof. } \author{Henrik Bengtsson} \seealso{ \code{\link{newInstance.Object}}(). \code{\link{newInstance.Class}}(). For more information see \code{\link{BasicObject}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/getPackage.Class.Rd0000755000177400001440000000164213005563376015440 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getPackage.Class} \alias{getPackage.Class} \alias{Class.getPackage} \alias{getPackage,Class-method} \title{Gets the package to which the class belongs} \description{ Gets the package to which the class belongs. } \usage{ \method{getPackage}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link{Package}}. } \examples{ print(getPackage(Object)) } \author{Henrik Bengtsson} \seealso{ \code{\link{Package}}. \code{\link[base]{class}}(). \code{\link{setConstructorS3}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/hashCode.Object.Rd0000755000177400001440000000307613005563375015266 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{hashCode.Object} \alias{hashCode.Object} \alias{Object.hashCode} \alias{hashCode,Object-method} \title{Gets a hash code for the Object} \description{ Gets a hash code for the Object. This makes it possible to put any \code{\link[R.oo]{Object}} in a hash table. The hash code returned must: 1) be \emph{consistent}, i.e. \code{hashCode(obj)} should return the same value on multiple invocations as long as nothing has changed. 2) tell same same thing as \code{equals()}, if \code{equals(o1,o2)} is \code{\link[base:logical]{TRUE}}, then \code{hashCode(o1) == hashCode(o2)} should also be \code{\link[base:logical]{TRUE}}. Note that if \code{equals(o1,o2)} is \code{\link[base:logical]{FALSE}}, \code{hashCode(o1)} \code{hashCode(o2)} may be \emph{either} equal or non-equal. By default, the method returns the internal memory address where the Object is located. } \usage{ \method{hashCode}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{double}}. } \examples{ obj <- Object() hashCode(obj) # 26979608 } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:equals.Object]{*equals}()} For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getWhen.Exception.Rd0000755000177400001440000000163013005563377015675 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getWhen.Exception} \alias{getWhen.Exception} \alias{Exception.getWhen} \alias{getWhen,Exception-method} \title{Gets the time when the Exception was created} \description{ Gets the time, as a POSIX object, when the Exception was created. } \usage{ \method{getWhen}{Exception}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a POSIX time object. } \examples{\dontrun{For a complete example see help(Exception).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Exception}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/getLicense.Package.Rd0000755000177400001440000000156313005563400015743 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getLicense.Package} \alias{getLicense.Package} \alias{Package.getLicense} \alias{getLicense,Package-method} \title{Gets the License of this package} \description{ Gets the License of this package as specified by the \code{DESCRIPTION} file. } \usage{ \method{getLicense}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{ pkg <- Package("R.oo") print(getLicense(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/novirtual.Object.Rd0000755000177400001440000000155013005563375015566 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{novirtual.Object} \alias{novirtual.Object} \alias{Object.novirtual} \alias{novirtual,Object-method} \title{Returns a reference to the same Object with virtual fields turned off} \description{ Returns a reference to the same Object with virtual fields turned off. } \usage{ \method{novirtual}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns an \code{\link[R.oo]{Object}}. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getInstantiationTime.Object.Rd0000644000177400001440000000246213005563375017706 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getInstantiationTime.Object} \alias{getInstantiationTime.Object} \alias{Object.getInstantiationTime} \alias{getInstantiationTime,Object-method} \title{Gets the time when the object was instantiated} \description{ Gets the time when the object was instantiated (created) as a POSIXt object. } \usage{ \method{getInstantiationTime}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a POSIXt object, which extends class POSIXct. } \details{ The instantiation time stamp is set when the object is created, and only of option \code{"R.oo::BasicObject/instantiationTime"} is \code{\link[base:logical]{TRUE}}. } \examples{ oopts <- options("R.oo::Object/instantiationTime"=TRUE) obj <- Object() print(getInstantiationTime(obj)) options(oopts) } \seealso{ For more about time formats and POSIX see \code{\link[base]{DateTimeClasses}}. For more information see \code{\link{Object}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/detach.Object.Rd0000755000177400001440000000224513005563375014775 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{detach.Object} \alias{detach.Object} \alias{Object.detach} \alias{detach,Object-method} \title{Detach an Object from the R search path} \description{ Detach, from the \R search path, an Object that has previously been attached. If the Object was not attached, a \code{\link[base]{warning}} will be generated and nothing will be done. } \usage{ \method{detach}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the Object was detached, otherwise \code{\link[base:logical]{FALSE}}. } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:attach.Object]{*attach}()} and \code{\link[base]{attach}}(), \code{\link[base]{detach}}(). For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getPackage.InternalErrorException.Rd0000755000177400001440000000171313005563377021040 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % InternalErrorException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getPackage.InternalErrorException} \alias{getPackage.InternalErrorException} \alias{InternalErrorException.getPackage} \alias{getPackage,InternalErrorException-method} \title{Gets the suspicious package likely to contain an error} \description{ Gets the suspicious package likely to contain an error. } \usage{ \method{getPackage}{InternalErrorException}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link{Package}} object. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{InternalErrorException}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/unload.Package.Rd0000755000177400001440000000204713005563400015141 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{unload.Package} \alias{unload.Package} \alias{Package.unload} \alias{unload,Package-method} \title{Unloads a package} \description{ Unloads a package. This is an alternative way to use \code{detach()} to unload a package. If the package is not loaded, it will quietly return. } \usage{ \method{unload}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \examples{\dontrun{ pkg <- Package("boot") load(pkg) print(isLoaded(pkg)) unload(pkg) print(isLoaded(pkg)) }} \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:load.Package]{*load}()}. \code{\link[R.oo:isLoaded.Package]{*isLoaded}()}. \code{\link[base]{search}}(). For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getDevelUrl.Package.Rd0000755000177400001440000000210413005563400016073 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getDevelUrl.Package} \alias{getDevelUrl.Package} \alias{Package.getDevelUrl} \alias{getDevelUrl,Package-method} \title{Gets the URL(s) from where the developers version of this package can be installed} \description{ Gets the URL(s) from where the developers version of this package can be installed by looking for comma or semicolon separated URLs at the optional \code{DevelURL} line in the \code{DESCRIPTION} file of the package. } \usage{ \method{getDevelUrl}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a vector of \code{\link[base]{character}} strings. } \examples{ pkg <- Package("R.oo") print(getDevelUrl(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/DOLLAR.Class.Rd0000755000177400001440000000430613005563376014362 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{DOLLAR.Class} \alias{$.Class} \alias{Class.$} \alias{$,Class-method} \alias{Class.[[} \alias{[[.Class} \alias{[[,Class-method} \title{Makes the fields and methods of an Class accessable via the \$ and the [[ operator} \usage{ \method{$}{Class}(this, name) \method{[[}{Class}(this, name, exact=TRUE) } \description{ Makes the fields and methods of an Class accessable via the \code{$} operator. This method is never called explicitly, but through an indirect usage of the \code{$} operator, e.g. \code{obj$name} or \code{obj$getValue()}. \enumerate{ \item This method will first search for a \code{get()} method, e.g. if name has the value \code{"age"}, a \code{getAge()} will be looked for. If such a method exists it will be called with the Class as the first and only argument, e.g. \code{getAge(this)}. A \code{get()} is only looked for if \code{} is not a private field. A private field is a name \emph{beginning} with a \code{.} (period). The rational for this naming convention is to be consistent with how \code{\link[base]{ls}()} works, which will not list such members by default. \item If no such method exists, first then, this method will look a field in the Class can has the name \code{name}. \item If such neither exists, a method with name \code{name} will be searched for and returned. \item If no fields or methods are found at all, \code{\link[base]{NULL}} is returned. } } \arguments{ \item{name}{The name of the field or method to be accessed.} \item{...}{Not used.} } \value{ Returns the value of a field or a method (\code{\link[base]{function}}). If no such field or method exists, \code{\link[base]{NULL}} is returned. } \examples{\dontrun{For a complete example see help(Class).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/Package.Rd0000755000177400001440000001505013005563400013656 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Package} \docType{class} \alias{Package} \title{The Package class provides methods for accessing package information} \description{ Package: R.oo \cr \bold{Class Package}\cr \code{\link[R.oo]{Object}}\cr \code{~~|}\cr \code{~~+--}\code{Package}\cr \bold{Directly known subclasses:}\cr \cr public class \bold{Package}\cr extends \link[R.oo]{Object}\cr Creates a Package that can be thrown and caught. The \code{Package} class is the root class of all other \code{Package} classes. } \usage{ Package(name=NULL) } \arguments{ \item{name}{Name of the package.} } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{\link[R.oo:as.character.Package]{as.character}} \tab Gets a string representation of this package.\cr \tab \code{\link[R.oo:getAuthor.Package]{getAuthor}} \tab Gets the Author of this package.\cr \tab \code{\link[R.oo:getBundle.Package]{getBundle}} \tab Gets the Bundle that this package might belong to.\cr \tab \code{\link[R.oo:getBundlePackages.Package]{getBundlePackages}} \tab Gets the names of the other packages that is in the same bundle as this package.\cr \tab \code{\link[R.oo:getChangeLog.Package]{getChangeLog}} \tab Gets the change log of this package.\cr \tab \code{\link[R.oo:getClasses.Package]{getClasses}} \tab Gets all classes of a package.\cr \tab \code{\link[R.oo:getContents.Package]{getContents}} \tab Gets the contents of this package.\cr \tab \code{\link[R.oo:getContribUrl.Package]{getContribUrl}} \tab Gets the URL(s) from where this package can be installed.\cr \tab \code{\link[R.oo:getDataPath.Package]{getDataPath}} \tab Gets the path to the data (data/) directory of this package.\cr \tab \code{\link[R.oo:getDate.Package]{getDate}} \tab Gets the date when package was build.\cr \tab \code{\link[R.oo:getDescription.Package]{getDescription}} \tab Gets the description of the package.\cr \tab \code{\link[R.oo:getDescriptionFile.Package]{getDescriptionFile}} \tab Gets the description file of this package.\cr \tab \code{\link[R.oo:getDevelUrl.Package]{getDevelUrl}} \tab Gets the URL(s) from where the developers version of this package can be installed.\cr \tab \code{\link[R.oo:getDocPath.Package]{getDocPath}} \tab Gets the path to the accompanying documentation (doc/) directory of this package.\cr \tab \code{\link[R.oo:getEnvironment.Package]{getEnvironment}} \tab Gets the environment of a loaded package.\cr \tab \code{\link[R.oo:getExamplePath.Package]{getExamplePath}} \tab Gets the path to the example (R-ex/) directory of this package.\cr \tab \code{getHistory} \tab -\cr \tab \code{\link[R.oo:getHowToCite.Package]{getHowToCite}} \tab Gets the citation of this package.\cr \tab \code{\link[R.oo:getLicense.Package]{getLicense}} \tab Gets the License of this package.\cr \tab \code{\link[R.oo:getMaintainer.Package]{getMaintainer}} \tab Gets the Maintainer of this package.\cr \tab \code{\link[R.oo:getName.Package]{getName}} \tab Gets the name of this package.\cr \tab \code{getNews} \tab -\cr \tab \code{\link[R.oo:getPath.Package]{getPath}} \tab Gets the library (system) path to this package.\cr \tab \code{\link[R.oo:getPosition.Package]{getPosition}} \tab Gets the search path position of the package.\cr \tab \code{\link[R.oo:getTitle.Package]{getTitle}} \tab Gets the Title of this package.\cr \tab \code{\link[R.oo:getUrl.Package]{getUrl}} \tab Gets the URL of this package.\cr \tab \code{\link[R.oo:getVersion.Package]{getVersion}} \tab Gets the version of this package.\cr \tab \code{\link[R.oo:isLoaded.Package]{isLoaded}} \tab Checks if the package is installed on the search path or not.\cr \tab \code{\link[R.oo:isOlderThan.Package]{isOlderThan}} \tab Checks if the package is older than a given version.\cr \tab \code{\link[R.oo:ll.Package]{ll}} \tab Generates a list of informative properties of all members of the package.\cr \tab \code{\link[R.oo:load.Package]{load}} \tab Loads a package.\cr \tab \code{\link[R.oo:showChangeLog.Package]{showChangeLog}} \tab Show the change log of this package.\cr \tab \code{\link[R.oo:showContents.Package]{showContents}} \tab Show the CONTENTS file of this package.\cr \tab \code{\link[R.oo:showDescriptionFile.Package]{showDescriptionFile}} \tab Show the DESCRIPTION file of this package.\cr \tab \code{showHistory} \tab -\cr \tab \code{\link[R.oo:showHowToCite.Package]{showHowToCite}} \tab Show the HOWTOCITE file of this package.\cr \tab \code{showNews} \tab -\cr \tab \code{\link[R.oo:startupMessage.Package]{startupMessage}} \tab Generates a 'package successfully loaded' package startup message.\cr \tab \code{\link[R.oo:unload.Package]{unload}} \tab Unloads a package.\cr } \bold{Methods inherited from Object}:\cr $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save } \examples{\dontrun{# By defining .onAttach() as follows in zzz.R for a package, an # instance of class Package with the same name as the package will # be made available on the search path. More over, the code below # will also inform the user that the package has been loaded: # # > library(R.oo) # R.oo v0.52 (2003/04/13) was successfully loaded. # .onAttach <- function(libname, pkgname) { pkg <- Package(pkgname); assign(pkgname, pkg, pos=getPosition(pkg)); cat(getName(pkg), " v", getVersion(pkg), " (", getDate(pkg), ")", " was successfully loaded.\n", sep=""); } # The Package class works for any packages, loaded or not. # Some information about the base package pkg <- Package("base") print(pkg) # [1] "Package: base v1.6.2 (NA) is loaded (pos=5). The official webpage # is NA and the maintainer is R Core Team . The # package is installed in c:/PROGRA~1/R/rw1062/library/base/." print(list.files(Package("base")$dataPath)) # Some information about the R.oo package print(R.oo::R.oo) # [1] "Package: R.oo v0.52 (2003/04/13) is loaded (pos=2). The official # webpage is http://www.braju.com/R/ and the maintainer is Henrik # Bengtsson . The package is installed in # c:/PROGRA~1/R/rw1062/library/R.oo/." }} \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{classes} R.oo/man/getChangeLog.Package.Rd0000755000177400001440000000304713005563400016207 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getChangeLog.Package} \alias{getChangeLog.Package} \alias{Package.getChangeLog} \alias{getChangeLog,Package-method} \alias{Package.getNews} \alias{getNews.Package} \alias{getNews,Package-method} \alias{Package.getHistory} \alias{getHistory.Package} \alias{getHistory,Package-method} \title{Gets the change log of this package} \description{ Gets the change log of this package, that is, (by default) the \code{NEWS} (then the \code{HISTORY} and \code{ChangeLog}) file, which should is expected to be located in the root directory of the package, i.e. \code{\link[R.oo:getPath.Package]{*getPath}()}. } \usage{ \method{getChangeLog}{Package}(this, filenames=c("NEWS", "HISTORY", "ChangeLog"), newline="\n", ...) } \arguments{ \item{filenames}{A \code{\link[base]{character}} \code{\link[base]{vector}} of (non-case sensitive) filenames to be searched for.} \item{newline}{The \code{\link[base]{character}} string to collapse lines in the file.} \item{...}{Not used.} } \value{ Returns the complete contents of the change log file as a \code{\link[base]{character}} string. If not found, \code{\link[base]{NULL}} is returned. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/dimension.Rd0000755000177400001440000000242513005563401014313 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % dimension.default.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{dimension} \alias{dimension.default} \alias{dimension} \title{Gets the dimension of the object} \description{ Gets the dimension of the object similar to what \code{dim()} does, but instead of \code{\link[base]{NULL}} it will return the length of a vector. If a function is passed, \code{\link[base]{NULL}} is returned. } \usage{ \method{dimension}{default}(object, ...) } \arguments{ \item{object}{The object for which the dimension should be obtained.} \item{...}{Not used.} } \value{ Returns an \code{\link[base]{integer}} \code{\link[base]{vector}} or \code{\link[base]{NULL}}. } \examples{ dimension(matrix(1:100, ncol=10)) # 10 10 dimension(1:14) # 14 dimension(data.frame(a=1:10, b=10:1)) # 10 2 dimension(print) # NULL } \author{Henrik Bengtsson} \seealso{ \code{\link{ll.default}}(). \code{\link[base]{dim}}() and \code{\link[base]{length}}(). } \keyword{attribute} \keyword{utilities} \keyword{internal} R.oo/man/clearLookupCache.Object.Rd0000644000177400001440000000166513005563375016753 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{clearLookupCache.Object} \alias{clearLookupCache.Object} \alias{Object.clearLookupCache} \alias{clearLookupCache,Object-method} \title{Clear internal fields used for faster lookup} \description{ Clear internal fields used for faster lookup by removing these fields. This method is called whenever \code{\link[R.oo:gc.Object]{*gc}()} is called on the object. } \usage{ \method{clearLookupCache}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns itself (invisible). } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/objectSize.environment.Rd0000644000177400001440000000154313005563401016767 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % objectSize.environment.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{objectSize.environment} \alias{objectSize.environment} \title{Gets the size of an environment in bytes} \description{ Gets the size of an environment in bytes. } \usage{ \method{objectSize}{environment}(envir, ...) } \arguments{ \item{envir}{An \code{\link[base]{environment}}().} \item{...}{Arguments passed to \code{\link[base]{ls}}().} } \value{ Returns an \code{\link[base]{integer}}. } \author{Henrik Bengtsson} \seealso{ Internally \code{\link[utils]{object.size}} is used. } \keyword{attribute} \keyword{utilities} \keyword{methods} R.oo/man/Class.Rd0000755000177400001440000001067013005563376013407 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Class} \docType{class} \alias{Class} \title{The Class class describes an Object class} \description{ Package: R.oo \cr \bold{Class Class}\cr \code{\link[R.oo]{Object}}\cr \code{~~|}\cr \code{~~+--}\code{Class}\cr \bold{Directly known subclasses:}\cr \cr public static class \bold{Class}\cr extends \link[R.oo]{Object}\cr The Class class describes an Object class. First of all, this class is most commonly used \emph{internally} and neither the end user nor the programmer need to no about the class Class. } \usage{ Class(name=NULL, constructor=NULL) } \arguments{ \item{name}{Name of the class.} \item{constructor}{Constructor (\code{\link[base]{function}}) of any Object class.} } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{$} \tab -\cr \tab \code{$<-} \tab -\cr \tab \code{.DollarNames} \tab -\cr \tab \code{.subset2Internal} \tab -\cr \tab \code{[[} \tab -\cr \tab \code{[[<-} \tab -\cr \tab \code{\link[R.oo:argsToString.Class]{argsToString}} \tab Gets the arguments of a function as a character string.\cr \tab \code{\link[R.oo:as.character.Class]{as.character}} \tab Returns a short string describing the class.\cr \tab \code{\link[R.oo:forName.Class]{forName}} \tab Gets a Class object by a name of a class.\cr \tab \code{\link[R.oo:getDetails.Class]{getDetails}} \tab Lists the fields and methods of a class.\cr \tab \code{\link[R.oo:getFields.Class]{getFields}} \tab Returns the field names of a class.\cr \tab \code{\link[R.oo:getKnownSubclasses.Class]{getKnownSubclasses}} \tab Gets all subclasses that are currently loaded.\cr \tab \code{\link[R.oo:getMethods.Class]{getMethods}} \tab Returns the method names of class and its super classes.\cr \tab \code{\link[R.oo:getName.Class]{getName}} \tab Gets the name of the class.\cr \tab \code{\link[R.oo:getPackage.Class]{getPackage}} \tab Gets the package to which the class belongs.\cr \tab \code{\link[R.oo:getRdDeclaration.Class]{getRdDeclaration}} \tab Gets the class declaraction in Rd format.\cr \tab \code{\link[R.oo:getRdHierarchy.Class]{getRdHierarchy}} \tab Gets the class hierarchy in Rd format.\cr \tab \code{\link[R.oo:getRdMethods.Class]{getRdMethods}} \tab Gets the methods of a class in Rd format.\cr \tab \code{\link[R.oo:getStaticInstance.Class]{getStaticInstance}} \tab Gets the static instance of this class.\cr \tab \code{\link[R.oo:getSuperclasses.Class]{getSuperclasses}} \tab Gets the super classes of this class.\cr \tab \code{\link[R.oo:isAbstract.Class]{isAbstract}} \tab Checks if a class is abstract or not.\cr \tab \code{\link[R.oo:isBeingCreated.Class]{isBeingCreated}} \tab Checks if a class is currently being initiated initiated.\cr \tab \code{\link[R.oo:isDeprecated.Class]{isDeprecated}} \tab Checks if a class is deprecated or not.\cr \tab \code{\link[R.oo:isPrivate.Class]{isPrivate}} \tab Checks if a class is defined private or not.\cr \tab \code{\link[R.oo:isProtected.Class]{isProtected}} \tab Checks if a class is defined protected or not.\cr \tab \code{\link[R.oo:isPublic.Class]{isPublic}} \tab Checks if a class is defined public or not.\cr \tab \code{\link[R.oo:isStatic.Class]{isStatic}} \tab Checks if a class is static or not.\cr \tab \code{\link[R.oo:newInstance.Class]{newInstance}} \tab Creates a new instance of this class.\cr \tab \code{\link[R.oo:print.Class]{print}} \tab Prints detailed information about the class and its fields and methods.\cr } \bold{Methods inherited from Object}:\cr $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save } \details{ The class Class describes the Object class or one of its subclasses. All classes and constructors created by \code{setConstructorS3()} will be of class Class. Its methods provide ways of accessing static fields and static methods. Its \emph{print()} method will print detailed information about the class and its fields and methods. } \author{Henrik Bengtsson} \keyword{classes} \keyword{programming} \keyword{methods} R.oo/man/getSuperclasses.classRepresentation.Rd0000755000177400001440000000132313005563401021525 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % classRepresentation.misc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getSuperclasses.classRepresentation} \alias{getSuperclasses.classRepresentation} \title{Gets the superclasses} \description{ Gets the superclasses. } \usage{ \method{getSuperclasses}{classRepresentation}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \keyword{methods} \keyword{internal} \keyword{documentation} R.oo/man/getFields.BasicObject.Rd0000755000177400001440000000216313005563377016416 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getFields.BasicObject} \alias{getFields.BasicObject} \alias{BasicObject.getFields} \alias{getFields,BasicObject-method} \title{Returns the field names of an BasicObject} \description{ Returns the field names of an BasicObject. } \usage{ \method{getFields}{BasicObject}(this, private=FALSE, ...) } \arguments{ \item{private}{If \code{\link[base:logical]{TRUE}}, private fields will also be returned, otherwise only public fields are returned.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} \code{\link[base]{vector}} of field names. } \author{Henrik Bengtsson} \seealso{ To check if a field exists or not, see \code{\link[R.oo:hasField.BasicObject]{*hasField}()}. For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getRdHierarchy.classRepresentation.Rd0000755000177400001440000000136013005563401021256 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % classRepresentation.misc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getRdHierarchy.classRepresentation} \alias{getRdHierarchy.classRepresentation} \title{Gets the class hierarchy in Rd format} \description{ Gets the class hierarchy in Rd format. } \usage{ \method{getRdHierarchy}{classRepresentation}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \keyword{methods} \keyword{internal} \keyword{documentation} R.oo/man/print.Interface.Rd0000644000177400001440000000146113005563377015371 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Interface.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{print.Interface} \alias{print.Interface} \alias{Interface.print} \alias{print,Interface-method} \title{Prints an Interface} \description{ For all objects of class \code{\link{Interface}}, this method will print the value of \code{as.character()} of the object. } \usage{ \method{print}{Interface}(x, ...) } \arguments{ \item{...}{Not used.} } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Interface}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getRdDeclaration.classRepresentation.Rd0000755000177400001440000000137213005563401021570 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % classRepresentation.misc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getRdDeclaration.classRepresentation} \alias{getRdDeclaration.classRepresentation} \title{Gets the class declaration in Rd format} \description{ Gets the class declaration in Rd format. } \usage{ \method{getRdDeclaration}{classRepresentation}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \keyword{methods} \keyword{internal} \keyword{documentation} R.oo/man/registerFinalizer.Object.Rd0000644000177400001440000000216212726216524017230 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 999.DEPRECATED.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{registerFinalizer.Object} \alias{registerFinalizer.Object} \alias{Object.registerFinalizer} \alias{registerFinalizer,Object-method} \title{Deprecated: Registers a finalizer hook for the object [DEFUNCT]} \description{ Deprecated: Registers a finalizer hook for the object [DEFUNCT]. The finalizer hook calls \code{\link[R.oo:finalize.Object]{*finalize}()} on the \code{\link{Object}} when it is garbage collected. This method is only intended to be called inside the constructor, if at all. } \usage{ \method{registerFinalizer}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ Internally, \code{\link[base]{reg.finalizer}}() is used. For more information see \code{\link{Object}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/getBundle.Package.Rd0000755000177400001440000000230113005563400015561 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getBundle.Package} \alias{getBundle.Package} \alias{Package.getBundle} \alias{getBundle,Package-method} \title{Gets the Bundle that this package might belong to} \description{ Gets the Bundle that this package might belong to as specified by the \code{DESCRIPTION} file. } \usage{ \method{getBundle}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ If the package is part of a bundle, the name of the bundle is returned. Otherwise, \code{\link[base]{NULL}} is returned. } \details{ The first call to this method is normally slow because all installed packages are scanned. The result of this first call is cached and used as the return value for all subsequent calls, which are then much faster. } \examples{ pkg <- Package("R.oo") print(getBundle(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/isOlderThan.Package.Rd0000644000177400001440000000201713005563400016065 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isOlderThan.Package} \alias{isOlderThan.Package} \alias{Package.isOlderThan} \alias{isOlderThan,Package-method} \title{Checks if the package is older than a given version} \description{ Checks if the package is older than a given version. } \usage{ \method{isOlderThan}{Package}(this, version, ...) } \arguments{ \item{version}{A \code{\link[base]{character}} string specifying a version to compare with.} \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the version of the package is less than the specified version. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. \code{\link[R.oo:getVersion.Package]{*getVersion}()}. } \keyword{internal} \keyword{methods} R.oo/man/attach.BasicObject.Rd0000755000177400001440000000265013005563377015755 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{attach.BasicObject} \alias{attach.BasicObject} \alias{BasicObject.attach} \alias{attach,BasicObject-method} \title{Attach an BasicObject to the R search path} \description{ Attach the members of an BasicObject to the \R search path. If trying to attach the same BasicObject twice without detaching it inbetween, a \code{\link[base]{warning}} will be generated and nothing will be done. } \usage{ \method{attach}{BasicObject}(this, private=FALSE, pos=2, ...) } \arguments{ \item{private}{If \code{\link[base:logical]{TRUE}}, private fields will also be attached, otherwise not.} \item{pos}{The position at in search path where the BasicObject should be inserted.} \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the \code{\link{BasicObject}} was attached, otherwise \code{\link[base:logical]{FALSE}}. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:detach.BasicObject]{*detach}()} and \code{\link[base]{attach}}(), \code{\link[base]{detach}}(). For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/ll.Object.Rd0000755000177400001440000000226213005563375014153 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{ll.Object} \alias{ll.Object} \alias{Object.ll} \alias{ll,Object-method} \title{Generates a list of informative properties of all members of an Object} \description{ Generates a list of informative properties of all members of an Object. } \usage{ \method{ll}{Object}(this, ...) } \arguments{ \item{...}{Any arguments accepted by the underlying function \code{ll()}.} } \value{ Returns a \code{\link[base]{data.frame}} containing information about all the members. } \examples{ obj <- Object() obj$x <- 1:100 obj$y <- 100:1 ll(obj) \dontrun{ gives: member data.class dimension objectSize 1 x numeric 100 424 2 y numeric 100 424 } } \author{Henrik Bengtsson} \seealso{ \code{\link{ll.default}}(). For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/load.Package.Rd0000755000177400001440000000200613005563400014571 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{load.Package} \alias{load.Package} \alias{Package.load} \alias{load,Package-method} \title{Loads a package} \description{ Loads a package. This is an alternative way to use \code{library()} to load a package. } \usage{ \method{load}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ \code{\link[base:logical]{TRUE}} if the packages is loaded, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ pkg <- Package("base") print(load(pkg)) } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:unload.Package]{*unload}()}. \code{\link[R.oo:isLoaded.Package]{*isLoaded}()}. \code{\link[base]{search}}(). For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/attachLocally.Object.Rd0000755000177400001440000000425713005563375016336 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{attachLocally.Object} \alias{attachLocally.Object} \alias{Object.attachLocally} \alias{attachLocally,Object-method} \title{Attaches an Object locally to an environment} \usage{ \method{attachLocally}{Object}(this, private=FALSE, fields=NULL, excludeFields=NULL, overwrite=TRUE, envir=parent.frame(), ...) } \description{ Attaches an Object locally to an environment. By default, the fields of the Object are attached to the parent frame, that is, the calling environment. } \arguments{ \item{private}{If \code{\link[base:logical]{TRUE}}, private fields are included, otherwise not. This is only effective if \code{fields==NULL}.} \item{fields}{A \code{\link[base]{character}} \code{\link[base]{vector}} specifying elements to be copied. If \code{\link[base]{NULL}}, all elements are considered.} \item{excludeFields}{A \code{\link[base]{character}} \code{\link[base]{vector}} specifying elements not to be copied. This has higher priority than \code{fields}.} \item{overwrite}{If \code{\link[base:logical]{FALSE}}, fields that already exists will not be copied.} \item{envir}{The \code{\link[base]{environment}} where fields are copied to.} \item{...}{Not used.} } \value{ Returns (invisibly) a \code{\link[base]{character}} \code{\link[base]{vector}} of the fields copied. } \examples{ foo <- function(object, arg1="some value", ...) { cat("Local objects in foo():\n") print(ls()) attachLocally(object) cat("\nLocal objects in foo():\n") print(ls()) for (name in ls()) { cat("\nObject '", name, "':\n", sep="") print(get(name, inherits=FALSE)) } } a <- "A string" obj <- Object() obj$a <- "Another string" obj$b <- NA foo(obj) print(a) } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:attach.Object]{*attach}()} For more information see \code{\link{Object}}. } \keyword{internal} \keyword{methods} \keyword{utilities} \keyword{programming} R.oo/man/000.makeObjectFinalizer.Rd0000644000177400001440000000307513005563375016545 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 020.makeObjectFinalizer,private.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{.makeObjectFinalizer} \alias{.makeObjectFinalizer} \title{Creates a standalone finalizer function for Object} \description{ Creates a standalone finalizer function for Object, which assumes only that the \pkg{base} package is available. } \usage{ .makeObjectFinalizer(this, reloadRoo=TRUE) } \arguments{ \item{this}{The \code{\link[R.oo]{Object}} to be finalized.} \item{reloadRoo}{If \code{\link[base:logical]{TRUE}}, the finalizer will try to temporary reload the \pkg{R.oo} package if not loaded.} } \value{ Returns a \code{\link[base]{function}} that can be passed to \code{\link[base]{reg.finalizer}}(). } \details{ The created finalizer is reentrant. This is always the case when the \pkg{R.oo} package is already loaded when the finalizer is called. It is also always the case on R v2.15.2 Patched r61487 and beyond. In other cases, the finalizer inspects the call stack (via \code{\link{sys.calls}}()) to check whether \code{\link[base]{parse}}() has been called or not. If it is on the call stack, it indicates that \code{\link[base]{parse}}() triggered the garbage collection, and the \pkg{R.oo} package will \emph{not} be reloaded in order to avoid risking \code{\link[base]{parse}}() being called again. } \keyword{internal} R.oo/man/R.oo-package.Rd0000755000177400001440000000726613005563376014557 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 999.package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{R.oo-package} \alias{R.oo-package} \alias{R.oo} \docType{package} \title{Package R.oo} \description{ Methods and classes for object-oriented programming in R with or without references. Large effort has been made on making definition of methods as simple as possible with a minimum of maintenance for package developers. The package has been developed since 2001 and is now considered very stable. This is a cross-platform package implemented in pure R that defines standard S3 classes without any tricks. Please note that the Rdoc syntax/grammar used to convert Rdoc comments in code into Rd files is not strictly defined and is modified by the need of the author. Ideally, there will be a well defined Rdoc language one day. } \section{Installation and updates}{ To install this package do\cr \code{install.packages("R.oo")} } \section{Dependancies and other requirements}{ This package requires a standard \R installation and the \pkg{R.methodsS3} package. } \section{To get started}{ To get started,It is very useful to understand that: \enumerate{ \item The \code{\link[R.methodsS3]{setMethodS3}}() function, which is defined in the \pkg{R.methodsS3} package (used to be part of \pkg{R.oo}), is nothing but a conveniency wrapper for setting up S3 methods, and automatically create an S3 generic function, if missing. For more information, see the help of \pkg{R.methodsS3}. \item The \code{\link{Object}} class is a top-level "root" class that provides support for \emph{reference variables}. Any class inheriting from this class supports reference variables. \item The \code{\link{Object}} class is basically a wrapper around an \code{\link[base]{environment}}, which some additional accessors etc. It is the environment data type that provides the "emulation" of reference variables - the Object class structure makes it easier to extends this class and adds some level of coding protection. The Object class features is not intended for referencing individual elements of basic \R data types, but rather for the whole variable of such. For instance, you can reassign a whole matrix \code{X} part of the object this way, but you cannot reassign \code{X[1,1]} without creating a completely new copy. } } \section{Further readings}{ For a detailed introduction to the package see [1] (part of the package distribution). } \section{How to cite this package}{ Whenever using this package, please cite [1] as\cr \preformatted{ Bengtsson, H. The R.oo package - Object-Oriented Programming with References Using Standard R Code, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), ISSN 1609-395X, Hornik, K.; Leisch, F. & Zeileis, A. (ed.), 2003 } \emph{} } \author{Henrik Bengtsson} \section{License}{ The releases of this package is licensed under LGPL version 2.1 or newer. } \references{ [1] H. Bengtsson, \emph{The R.oo package - Object-Oriented Programming with References Using Standard R Code}, In Kurt Hornik, Friedrich Leisch and Achim Zeileis, editors, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), March 20-22, Vienna, Austria. \url{https://www.r-project.org/conferences/DSC-2003/Proceedings/} \cr } \seealso{ People interested in \pkg{R.oo} may also be interested in packages \pkg{proto} and \pkg{mutatr}. } \keyword{package} R.oo/man/save.Object.Rd0000755000177400001440000000322213005563375014477 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{save.Object} \alias{save.Object} \alias{Object.save} \alias{save,Object-method} \title{Saves an Object to a file or a connection} \description{ Saves an Object to a file or a connection. } \usage{ \method{save}{Object}(this, file=NULL, path=NULL, compress=TRUE, ..., safe=TRUE) } \arguments{ \item{file}{Filename or \code{\link[base:connections]{connection}} to which the Object should be saved. If \code{\link[base]{NULL}}, the Object will be save to a file named "\{class name\}.\{memory location\}.RData", e.g. "Object.26979608.RData".} \item{path}{The path where the file should be saved.} \item{compress}{If \code{\link[base:logical]{TRUE}}, the file is compressed to, otherwise not.} \item{...}{Other arguments accepted by \code{save()} in the base package.} \item{safe}{If \code{\link[base:logical]{TRUE}} and \code{file} is a file, then, in order to lower the risk for incomplete files, the object is first written to a temporary file, which is then renamed to the final name.} } \value{ Returns nothing. } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:load.Object]{*load}()} and \code{\link[base]{save}}(), \code{\link[base]{load}}(). For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{IO} \keyword{internal} \keyword{methods} R.oo/man/getDataPath.Package.Rd0000755000177400001440000000150213005563400016040 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getDataPath.Package} \alias{getDataPath.Package} \alias{Package.getDataPath} \alias{getDataPath,Package-method} \title{Gets the path to the data (data/) directory of this package} \description{ Gets the path to the data (data/) directory of this package. } \usage{ \method{getDataPath}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/isPublic.Class.Rd0000755000177400001440000000211713005563376015155 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isPublic.Class} \alias{isPublic.Class} \alias{Class.isPublic} \alias{isPublic,Class-method} \title{Checks if a class is defined public or not} \description{ Checks if a class is defined public or not. A class is public if it is neither private nor protected. } \usage{ \method{isPublic}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the class is public, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ if (!isPublic(RccViolationException)) throw("The class RccViolationException should be public.") } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{class}}(). \code{\link{setConstructorS3}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/as.character.RdocException.Rd0000755000177400001440000000155013005563401017427 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % RdocException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{as.character.RdocException} \alias{as.character.RdocException} \alias{RdocException.as.character} \alias{as.character,RdocException-method} \title{Gets a character string representing of the RdocException} \description{ . } \usage{ \method{as.character}{RdocException}(x, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{RdocException}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/getCalls.Exception.Rd0000644000177400001440000000212713005563377016031 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getCalls.Exception} \alias{getCalls.Exception} \alias{Exception.getCalls} \alias{getCalls,Exception-method} \alias{Exception.getCall} \alias{getCall.Exception} \alias{getCall,Exception-method} \title{Gets the active calls saved when the exception was created} \description{ . } \usage{ \method{getCalls}{Exception}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns an unnamed \code{\link[base]{list}} with @language elements. } \examples{\dontrun{For a complete example see help(Exception).}} \seealso{ \code{\link[R.oo:getStackTrace.Exception]{*getStackTrace}()}. \code{\link[utils:debugger]{sys.calls}()}. For more information see \code{\link{Exception}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/Interface.Rd0000644000177400001440000000224013005563377014232 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Interface.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Interface} \docType{class} \alias{Interface} \title{The Interface class} \description{ Package: R.oo \cr \bold{Class Interface}\cr \code{+--}\code{Interface}\cr \bold{Directly known subclasses:}\cr \cr public class \bold{Interface}\cr This class represents a special set of classes whose purpose is to provide methods (but not fields) shared by multiple different classes. } \usage{ Interface(core=NA, ...) } \arguments{ \item{core}{The core value.} \item{...}{Not used.} } \section{Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{\link[R.oo:extend.Interface]{extend}} \tab Extends another Interface class.\cr \tab \code{\link[R.oo:print.Interface]{print}} \tab Prints an Interface.\cr \tab \code{\link[R.oo:uses.Interface]{uses}} \tab Specifies that an object uses this Interface.\cr } } \author{Henrik Bengtsson} \keyword{classes} \keyword{internal} R.oo/man/getRdDeclaration.Class.Rd0000755000177400001440000000150713005563377016621 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Class.misc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getRdDeclaration.Class} \alias{getRdDeclaration.Class} \alias{Class.getRdDeclaration} \alias{getRdDeclaration,Class-method} \title{Gets the class declaraction in Rd format} \description{ Gets the class declaraction in Rd format. } \usage{ \method{getRdDeclaration}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getVersion.Package.Rd0000755000177400001440000000150113005563400015776 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getVersion.Package} \alias{getVersion.Package} \alias{Package.getVersion} \alias{getVersion,Package-method} \title{Gets the version of this package} \description{ Gets the version of this package. } \usage{ \method{getVersion}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. \code{\link[R.oo:isOlderThan.Package]{*isOlderThan}()}. } \keyword{internal} \keyword{methods} R.oo/man/startupMessage.Package.Rd0000644000177400001440000000161613005563400016664 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{startupMessage.Package} \alias{startupMessage.Package} \alias{Package.startupMessage} \alias{startupMessage,Package-method} \title{Generates a 'package successfully loaded' package startup message} \description{ Generates a 'package successfully loaded' package startup message. } \usage{ \method{startupMessage}{Package}(this, ...) } \arguments{ \item{...}{Additional arguments passed to \code{\link[R.methodsS3]{pkgStartupMessage}}.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getRccUrl.RccViolationException.Rd0000755000177400001440000000240213005563400020464 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % RccViolationException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{RccViolationException$getRccUrl} \alias{RccViolationException$getRccUrl} \alias{getRccUrl.RccViolationException} \alias{RccViolationException.getRccUrl} \alias{getRccUrl,RccViolationException-method} \title{Static method to get a URL where the RCC can be found} \description{ Static method to get a URL where one can find details about the R Code Convention (RCC). Currently the URL is \url{http://aroma-project.org/developers/RCC/}. } \usage{ ## Static method (use this): ## RccViolationException$getRccUrl(...) ## Don't use the below: \method{getRccUrl}{RccViolationException}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{\dontrun{For a complete example see help(RccViolationException).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{RccViolationException}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/getFields.Class.Rd0000755000177400001440000000177413005563376015321 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getFields.Class} \alias{getFields.Class} \alias{Class.getFields} \alias{getFields,Class-method} \title{Returns the field names of a class} \description{ Returns the field names of a class. } \arguments{ \item{private}{If \code{\link[base:logical]{TRUE}}, private fields will also be returned, otherwise only public fields are returned.} \item{...}{Not used.} } \usage{ \method{getFields}{Class}(this, private=FALSE, ...) } \value{ Returns a \code{\link[base]{character}} \code{\link[base]{vector}} of field names. } \examples{ print(getFields(Exception)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/ll.Package.Rd0000755000177400001440000000271613005563400014271 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{ll.Package} \alias{ll.Package} \alias{Package.ll} \alias{ll,Package-method} \title{Generates a list of informative properties of all members of the package} \description{ Generates a list of informative properties of all members of the package. If the package is not loaded, it will be loaded, the members will be retrieved and then the package will be unloaded again. } \usage{ \method{ll}{Package}(this, envir=pos.to.env(getPosition(this)), ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{data.frame}}. } \details{ Note the difference from the default definition of \code{ll()} as inherited from the \code{\link[R.oo]{Object}} class. Here \code{ll()} has been redefined to list the members of the package, i.e. the members in the environment on search path that belongs to the package, whereas the original usage was to list the members of the Object. However, since the internal members of Package object is not of interest we decided on this definition instead. } \examples{ \dontrun{ll(R.oo)} } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/RdocException.Rd0000755000177400001440000000507513005563401015100 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % RdocException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{RdocException} \docType{class} \alias{RdocException} \title{RdocException are thrown by the Rdoc compiler} \description{ Package: R.oo \cr \bold{Class RdocException}\cr \code{\link[R.oo]{Object}}\cr \code{~~|}\cr \code{~~+--}\code{try-error}\cr \code{~~~~~~~|}\cr \code{~~~~~~~+--}\code{condition}\cr \code{~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~+--}\code{error}\cr \code{~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~+--}\code{simpleError}\cr \code{~~~~~~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~~~~~~+--}\code{\link[R.oo]{Exception}}\cr \code{~~~~~~~~~~~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~~~~~~~~~~~+--}\code{RdocException}\cr \bold{Directly known subclasses:}\cr \cr public static class \bold{RdocException}\cr extends \link[R.oo]{Exception}\cr RdocException are thrown by the Rdoc compiler when it fails to generate a Rd file from an Rdoc comment. } \usage{ RdocException(..., source=NULL) } \arguments{ \item{...}{Any arguments accepted by \code{\link[R.oo]{Exception}}}. \item{source}{Object specifying the source where the Rdoc error occured. This is commonly a filename \code{\link[base]{character}} string.}. } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{\link[R.oo:as.character.RdocException]{as.character}} \tab Gets a character string representing of the RdocException.\cr \tab \code{\link[R.oo:getSource.RdocException]{getSource}} \tab Gets the source of the exception.\cr } \bold{Methods inherited from Exception}:\cr as.character, getCall, getCalls, getLastException, getMessage, getStackTrace, getWhen, print, printStackTrace, throw \bold{Methods inherited from error}:\cr as.character, throw \bold{Methods inherited from condition}:\cr abort, as.character, conditionCall, conditionMessage, print \bold{Methods inherited from Object}:\cr $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save } \author{Henrik Bengtsson} \seealso{ For detailed information about exceptions see \code{\link[R.oo]{Exception}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{classes} R.oo/man/ASCII.Rd0000755000177400001440000000144213005563376013167 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % ASCII.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{ASCII} \alias{ASCII} \alias{ASCII.BEL} \alias{ASCII.BS} \alias{ASCII.HT} \alias{ASCII.LF} \alias{ASCII.FF} \alias{ASCII.CR} \alias{ASCII.SO} \alias{ASCII.SI} \alias{ASCII.DC1} \alias{ASCII.DC3} \alias{ASCII.ESC} \title{8-bit ASCII table} \description{ ASCII is the 8-bit ASCII table with ASCII characters from 0-255. } \examples{ ch <- ASCII[65+1]; # ch == "A" } \author{Henrik Bengtsson} \seealso{ \code{\link{charToInt}}() \code{\link{intToChar}}() } \keyword{character} \keyword{internal} R.oo/man/trim.Rd0000755000177400001440000000145013005563401013276 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % trim.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{trim} \alias{trim.default} \alias{trim} \title{Converts to a string and removes leading and trailing whitespace} \description{ Converts to a string and removes leading and trailing whitespace. } \usage{ \method{trim}{default}(object, ...) } \arguments{ \item{object}{A \code{\link[base]{vector}} of \R objects to be trimmed.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{vector}} of \code{\link[base]{character}} strings. } \author{Henrik Bengtsson} \keyword{character} \keyword{internal} R.oo/man/declaration.Rdoc.Rd0000755000177400001440000000157213005563401015503 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$declaration} \alias{Rdoc$declaration} \alias{declaration.Rdoc} \alias{Rdoc.declaration} \alias{declaration,Rdoc-method} \title{Gets the class declaration} \description{ Gets the class declaration. } \usage{ ## Static method (use this): ## Rdoc$declaration(class, ...) ## Don't use the below: \method{declaration}{Rdoc}(this, class, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getClassS4Usage.Rdoc.Rd0000755000177400001440000000174113005563401016155 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$getClassS4Usage} \alias{Rdoc$getClassS4Usage} \alias{getClassS4Usage.Rdoc} \alias{Rdoc.getClassS4Usage} \alias{getClassS4Usage,Rdoc-method} \title{Gets the usage of a S4 class} \description{ Gets the usage of a S4 class. } \usage{ ## Static method (use this): ## Rdoc$getClassS4Usage(class, ...) ## Don't use the below: \method{getClassS4Usage}{Rdoc}(static, class, ...) } \arguments{ \item{class}{A class name (\code{\link[base]{character}} string).} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/typeOfClass.Rd0000755000177400001440000000142313005563401014557 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % typeOfClass.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{typeOfClass} \alias{typeOfClass.default} \alias{typeOfClass} \title{Gets the type of a class (S3 or S4)} \description{ Gets the type of a class (S3 or S4). } \usage{ \method{typeOfClass}{default}(object, ...) } \arguments{ \item{object}{The object to be checks.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string \code{"S3"}, \code{"S3-Object"} or \code{"S4"}, or \code{\link[base]{NA}} if neither. } \author{Henrik Bengtsson} \keyword{character} R.oo/man/getUsage.Rdoc.Rd0000755000177400001440000000232213005563401014754 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$getUsage} \alias{Rdoc$getUsage} \alias{getUsage.Rdoc} \alias{Rdoc.getUsage} \alias{getUsage,Rdoc-method} \title{Gets the usage of a method} \description{ Gets the usage of a method. } \usage{ ## Static method (use this): ## Rdoc$getUsage(method, class=NULL, wrap=90L, indent=2L, ...) ## Don't use the below: \method{getUsage}{Rdoc}(static, method, class=NULL, wrap=90L, indent=2L, ...) } \arguments{ \item{method}{A method name (\code{\link[base]{character}} string).} \item{class}{An optional class name (\code{\link[base]{character}} string).} \item{wrap}{An \code{\link[base]{integer}} specifying the maximum number of characters per line. Longer lines will be wrapped with newlines.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getDescriptionFile.Package.Rd0000755000177400001440000000211713005563400017440 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getDescriptionFile.Package} \alias{getDescriptionFile.Package} \alias{Package.getDescriptionFile} \alias{getDescriptionFile,Package-method} \title{Gets the description file of this package} \description{ Gets the description file of this package, i.e. the parsed \code{DESCRIPTION} file. } \usage{ \method{getDescriptionFile}{Package}(this, fields=NULL, ...) } \arguments{ \item{fields}{A \code{\link[base]{vector}} of \code{\link[base]{character}} strings of fields to be returned. If \code{\link[base]{NULL}}, all available fields are returned.} \item{...}{Not used.} } \value{ Returns named \code{\link[base]{vector}} of \code{\link[base]{character}} strings. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/equals.BasicObject.Rd0000755000177400001440000000365013005563377016004 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{equals.BasicObject} \alias{equals.BasicObject} \alias{BasicObject.equals} \alias{equals,BasicObject-method} \title{Compares an object with another} \description{ Compares an object with another and returns \code{\link[base:logical]{TRUE}} if they are equal. The equal property must be 1) \emph{reflexive}, i.e. \code{equals(o1,o1)} should be \code{\link[base:logical]{TRUE}}. 2) \emph{symmetric}, i.e. \code{equals(o1,o2)} is \code{\link[base:logical]{TRUE}} if and only if \code{equals(o2,o1)} is \code{\link[base:logical]{TRUE}}. 3) \emph{transitive}, i.e. \code{equals(o1,o2)} is \code{\link[base:logical]{TRUE}} and \code{equals(o2,o3)} is \code{\link[base:logical]{TRUE}}, then \code{equals(o1,o3)} should be \code{\link[base:logical]{TRUE}}. 5) \emph{consistent}, i.e. \code{equals(o1,o2)} should return the same result on multiple invocations as long as noting has changed. 6) \code{equals(o1,NULL)} should return \code{\link[base:logical]{FALSE}}. By default, the method returns \code{\link[base:logical]{TRUE}} if and only if the two references compared refer to the same \code{\link{BasicObject}}, i.e. \code{( !is.null(obj) && (hashCode(this) == hashCode(obj)) )}. } \usage{ \method{equals}{BasicObject}(this, other, ...) } \arguments{ \item{other}{The other object this object should be compared to.} \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the objects are equal, otherwise \code{\link[base:logical]{FALSE}}. } \seealso{ For more information see \code{\link{BasicObject}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/throw.Exception.Rd0000755000177400001440000000204113005563377015434 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{throw.Exception} \alias{throw.Exception} \alias{Exception.throw} \alias{throw,Exception-method} \title{Throws an Exception that can be caught} \description{ Throws an Exception that can be caught by \code{tryCatch()}. } \usage{ \method{throw}{Exception}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \examples{\dontrun{For a complete example see help(Exception).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Exception}}. See also \code{\link[base:conditions]{tryCatch}()}. This method overrides (and is fully backward compatible with) the one defined in the \pkg{R.methodsS3} package. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/as.character.Exception.Rd0000755000177400001440000000173013005563377016633 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{as.character.Exception} \alias{as.character.Exception} \alias{Exception.as.character} \alias{as.character,Exception-method} \title{Gets a character string representing of the Exception} \description{ . By default the format is: "[\{POSIX date string\}] \{class name\}: \{msg\}". } \usage{ \method{as.character}{Exception}(x, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{\dontrun{For a complete example see help(Exception).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Exception}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/extend.Rd0000755000177400001440000000413513005563401013615 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % extend.default.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{extend} \alias{extend.default} \alias{extend} \title{Extends a object} \description{ via a mechanism known as "parasitic inheritance". Simply speaking this method "extends" the class of an object. What is actually happening is that it creates an instance of class name \code{...className}, by taking another object and add \code{...className} to the class list and also add all the named values in \code{...} as attributes. The method should be used by the constructor of a class and nowhere else. } \usage{ \method{extend}{default}(this, ...className, ...) } \arguments{ \item{this}{Object to be extended.} \item{...className}{The name of new class.} \item{...}{Attribute fields of the new class.} } \value{ Returns an object of class \code{...className}. } \author{Henrik Bengtsson} \examples{ setConstructorS3("MyDouble", function(value=0, ...) { extend(as.double(value), "MyDouble", ...) }) setMethodS3("as.character", "MyDouble", function(object, ...) { fmtstr <- attr(object, "fmtstr") if (is.null(fmtstr)) fmtstr <- "\%.6f" sprintf(fmtstr, object) }) setMethodS3("print", "MyDouble", function(object, ...) { print(as.character(object), ...) }) x <- MyDouble(3.1415926) print(x) x <- MyDouble(3.1415926, fmtstr="\%3.2f") print(x) attr(x, "fmtstr") <- "\%e" print(x) setConstructorS3("MyList", function(value=0, ...) { extend(list(value=value, ...), "MyList") }) setMethodS3("as.character", "MyList", function(object, ...) { fmtstr <- object$fmtstr if (is.null(fmtstr)) fmtstr <- "\%.6f" sprintf(fmtstr, object$value) }) setMethodS3("print", "MyList", function(object, ...) { print(as.character(object), ...) }) x <- MyList(3.1415926) print(x) x <- MyList(3.1415926, fmtstr="\%3.2f") print(x) x$fmtstr <- "\%e" print(x) } \keyword{programming} \keyword{methods} R.oo/man/compile.Rdoc.Rd0000755000177400001440000000461313005563401014645 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$compile} \alias{Rdoc$compile} \alias{compile.Rdoc} \alias{Rdoc.compile} \alias{compile,Rdoc-method} \title{Compile source code files containing Rdoc comments into Rd files} \description{ Compile source code files containing Rdoc comments into Rd files. \emph{Note, the class and methods to be compiled have to be loaded into \R by for instance \code{library()} or \code{source()} before calling this method.} } \usage{ ## Static method (use this): ## Rdoc$compile(filename=".*[.]R$", destPath=getManPath(this), showDeprecated=FALSE, ## addTimestamp=FALSE, locale="C", verbose=FALSE, source=FALSE, check=TRUE, ## debug=FALSE, ...) ## Don't use the below: \method{compile}{Rdoc}(this, filename=".*[.]R$", destPath=getManPath(this), showDeprecated=FALSE, addTimestamp=FALSE, locale="C", verbose=FALSE, source=FALSE, check=TRUE, debug=FALSE, ...) } \arguments{ \item{filename}{The pathname or filename pattern of the Rdoc files to be compiled.} \item{destPath}{The path where the generated Rd files should be saved.} \item{showDeprecated}{If \code{\link[base:logical]{TRUE}}, Rd files are generated for deprecated objects too, otherwise not.} \item{addTimestamp}{If \code{\link[base:logical]{TRUE}}, a date and time stamp is added to the Rd header comments. This timestamp might be confusing for version control systems, which is why it can be turned off with \code{\link[base:logical]{FALSE}}.} \item{locale}{The locale to be set/used when compiling Rdoc comments. This help assuring strings are sorted the same way across systems.} \item{source}{If \code{\link[base:logical]{TRUE}}, the Rdoc files will be \code{source()}:ed first. This work of course only for Rdoc files that are R source files.} \item{verbose}{If \code{\link[base:logical]{TRUE}}, detailed compilation information is printed.} \item{debug}{If \code{\link[base:logical]{TRUE}}, extra debug information is printed.} \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getAuthor.Package.Rd0000755000177400001440000000241013005563400015613 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getAuthor.Package} \alias{getAuthor.Package} \alias{Package.getAuthor} \alias{getAuthor,Package-method} \title{Gets the Author of this package} \description{ Gets the Author of this package as specified by the \code{DESCRIPTION} file. } \usage{ \method{getAuthor}{Package}(this, as=c("character", "person"), include=c("given", "family"), ...) } \arguments{ \item{as}{A \code{\link[base]{character}} string specifying the return format.} \item{include}{A \code{\link[base]{character}} \code{\link[base]{vector}} specifying which person fields to include if returning a \code{\link[base]{character}} string.} \item{...}{Optional arguments passed to \code{\link[utils]{format.person}}.} } \value{ Returns a \code{\link[base]{character}} string or a \code{\link[utils]{person}} object. } \examples{ pkg <- Package("R.oo") print(getAuthor(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getExamplePath.Package.Rd0000755000177400001440000000152713005563400016571 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getExamplePath.Package} \alias{getExamplePath.Package} \alias{Package.getExamplePath} \alias{getExamplePath,Package-method} \title{Gets the path to the example (R-ex/) directory of this package} \description{ Gets the path to the example (R-ex/) directory of this package. } \usage{ \method{getExamplePath}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getPackageNameOf.Rdoc.Rd0000755000177400001440000000242113005563401016331 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$getPackageNameOf} \alias{Rdoc$getPackageNameOf} \alias{getPackageNameOf.Rdoc} \alias{Rdoc.getPackageNameOf} \alias{getPackageNameOf,Rdoc-method} \title{Gets the package of a method or an object} \description{ Gets the package of a method or an object. } \usage{ ## Static method (use this): ## Rdoc$getPackageNameOf(objectName, mode="any", unique=TRUE, ...) ## Don't use the below: \method{getPackageNameOf}{Rdoc}(static, objectName, mode="any", unique=TRUE, ...) } \arguments{ \item{objectName}{An method or object name (\code{\link[base]{character}} string).} \item{mode}{Mode of object (\code{\link[base]{character}} string).} \item{unique}{If \code{\link[base:logical]{TRUE}}, only the first matching package is returned if more than one is found.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/isProtected.Class.Rd0000755000177400001440000000206613005563376015673 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isProtected.Class} \alias{isProtected.Class} \alias{Class.isProtected} \alias{isProtected,Class-method} \title{Checks if a class is defined protected or not} \description{ Checks if a class is defined protected or not. } \usage{ \method{isProtected}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the class is protected, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ if (isProtected(RccViolationException)) throw("The class RccViolationException should NOT be protected.") } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{class}}(). \code{\link{setConstructorS3}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/setConstructorS3.Rd0000755000177400001440000001042613005563375015607 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 040.setConstructorS3.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{setConstructorS3} \alias{setConstructorS3.default} \alias{setConstructorS3} \title{Defines a class in S3/UseMethod style} \description{ Defines a class in R.oo/S3 style. What this function currently does is simply creating a constructor function for the class. } \usage{ \method{setConstructorS3}{default}(name, definition, private=FALSE, protected=FALSE, export=TRUE, static=FALSE, abstract=FALSE, trial=FALSE, deprecated=FALSE, envir=parent.frame(), enforceRCC=TRUE, ...) } \arguments{ \item{name}{The name of the class.} \item{definition}{The constructor defintion. \emph{Note: The constructor must be able to be called with no arguments, i.e. use default values for all arguments or make sure you use \code{missing()} or similar!}} \item{static}{If \code{\link[base:logical]{TRUE}} this class is defined to be static, otherwise not. Currently this has no effect expect as an indicator.} \item{abstract}{If \code{\link[base:logical]{TRUE}} this class is defined to be abstract, otherwise not. Currently this has no effect expect as an indicator.} \item{private}{If \code{\link[base:logical]{TRUE}} this class is defined to be private.} \item{protected}{If \code{\link[base:logical]{TRUE}} this class is defined to be protected.} \item{export}{A \code{\link[base]{logical}} setting attribute \code{"export"}.} \item{trial}{If \code{\link[base:logical]{TRUE}} this class is defined to be a trial class, otherwise not. A trial class is a class that is introduced to be tried out and it might be modified, replaced or even removed in a future release. Some people prefer to call trial versions, beta version. Currently this has no effect expect as an indicator.} \item{deprecated}{If \code{\link[base:logical]{TRUE}} this class is defined to be deprecated, otherwise not. Currently this has no effect expect as an indicator.} \item{envir}{The environment for where the class (constructor function) should be stored.} \item{enforceRCC}{If \code{\link[base:logical]{TRUE}}, only class names following the R Coding Convention is accepted. If the RCC is violated an RccViolationException is thrown.} \item{...}{Not used.} Note: If a constructor is not declared to be private nor protected, it will be declared to be public. } \section{A constructor must be callable without arguments}{ The requirement that a constructor function should be callable without arguments (e.g. \code{MyConstructor()}) is because that call is used to create the static instance of a class. The reason for this is that a static instance of the class is created automatically when the constructor is called \emph{the first time} (only), that is, when the first of object of that class is created. All classes have to have a static instance. To make a constructor callable without arguments, one can either make sure all arguments have default values or one can test for missing arguments using \code{missing()}. For instance the following defintion is \emph{not} correct: \code{setConstructorS3("Foo", function(x) extend(Object(), "Foo", x=x))} whereas this one is \code{setConstructorS3("Foo", function(x=NA) extend(Object(), "Foo", x=x))} } \section{Code validation}{ If argument \code{enforceRCC} is \code{\link[base:logical]{TRUE}}, the class name is validated so it starts with a letter and it also gives a \code{\link[base]{warning}} if its first letter is \emph{not} captial. The reason for this is to enforce a naming convention that names classes with upper-case initial letters and methods with lower-case initial letters (this is also the case in for instance Java). } \examples{\dontrun{For a complete example see help(Object).}} \seealso{ To define a method see \code{\link[R.methodsS3]{setMethodS3}}. For information about the R Coding Conventions, see \code{\link{RccViolationException}}. For a thorough example of how to use this method see \code{\link{Object}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} R.oo/man/as.character.Interface.Rd0000644000177400001440000000150013005563377016565 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Interface.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{as.character.Interface} \alias{as.character.Interface} \alias{Interface.as.character} \alias{as.character,Interface-method} \title{Gets a character string representing the Interface} \description{ Gets a character string representing the Interface. } \usage{ \method{as.character}{Interface}(x, ...) } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Interface}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/finalize.Object.Rd0000755000177400001440000000355713005563375015355 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{finalize.Object} \alias{finalize.Object} \alias{Object.finalize} \alias{finalize,Object-method} \title{Finalizer methods called when object is clean out} \description{ Finalizer methods are called just the moment before the object is about to be deleted by the garbage collector. \bold{If creating a custom \code{finalize()} method for a subclass in a package, then it needs to be exported in the NAMESPACE of that package. If not, it will not be found nor called and there will be no error message.} \bold{A finalizer method should never be called explicitly!} } \usage{ \method{finalize}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \examples{ setConstructorS3("MyClass", function() { extend(Object(), "MyClass") }) setMethodS3("finalize", "MyClass", function(this, ...) { cat(as.character(this), "is about to be removed from the memory!\n") }) o <- MyClass() o <- MyClass() o <- MyClass() o <- MyClass() gc() ## MyClass: 0x01BE602C is about to be removed from the memory! ## MyClass: 0x01BFF634 is about to be removed from the memory! ## MyClass: 0x01C13584 is about to be removed from the memory! ## used (Mb) gc trigger (Mb) ## Ncells 229903 6.2 467875 12.5 ## Vcells 53725 0.5 786432 6.0 rm(o) ## MyClass: 0x01C578B0 is about to be removed from the memory! ## used (Mb) gc trigger (Mb) ## Ncells 229903 6.1 467875 12.3 ## Vcells 53725 0.5 786432 6.0 } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/isKeyword.Rdoc.Rd0000755000177400001440000000164313005563401015175 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$isKeyword} \alias{Rdoc$isKeyword} \alias{isKeyword.Rdoc} \alias{Rdoc.isKeyword} \alias{isKeyword,Rdoc-method} \title{Checks if a word is a Rd keyword} \description{ Checks if a word is a Rd keyword. } \usage{ ## Static method (use this): ## Rdoc$isKeyword(word, ...) ## Don't use the below: \method{isKeyword}{Rdoc}(this, word, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{logical}}. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getKeywords.Rdoc]{*getKeywords}()} For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getEnvironment.Package.Rd0000755000177400001440000000163313005563400016663 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getEnvironment.Package} \alias{getEnvironment.Package} \alias{Package.getEnvironment} \alias{getEnvironment,Package-method} \title{Gets the environment of a loaded package} \description{ Gets the environment of a loaded package. } \usage{ \method{getEnvironment}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{environment}}, or \code{\link[base]{NULL}} if the package was not loaded. } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getPosition.Package]{*getPosition}()}. For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getDate.Package.Rd0000755000177400001440000000164113005563400015233 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getDate.Package} \alias{getDate.Package} \alias{Package.getDate} \alias{getDate,Package-method} \title{Gets the date when package was build} \description{ Checks if the package is loaded onto the search path or not. } \usage{ \method{getDate}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ \code{\link[base:logical]{TRUE}} if the packages has been loaded, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ pkg <- Package("base") print(isLoaded(pkg)) # TRUE } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/DOLLARLT_-.Object.Rd0000755000177400001440000000476713005563375015211 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{DOLLAR< -.Object} \alias{$<-.Object} \alias{Object.$<-} \alias{$<-,Object-method} \alias{Object.[[<-} \alias{[[<-.Object} \alias{[[<-,Object-method} \title{Makes the fields and methods of an Object assignable via the \$<- and the [[<- operator} \description{ Makes the fields and methods of an Object assignable via the \code{$<-} operator. This method is never called explicitly, but through an indirect usage of the \code{$<-} operator, e.g. \code{obj$name <- "foo"}. 1) This method will first search for a \code{set()} method, e.g. if name has the value \code{"age"}, a \code{setAge()} will be looked for. If such a method exists it will be called with the Object as the first argument and \code{value} as the second, e.g. \code{setAge(this, value)}. A \code{set()} is only looked for if \code{} is a non-private field. A private field is a name \emph{beginning} with a \code{.} (period). The rational for this naming convention is to be consistent with how \code{\link[base]{ls}}() works, which will not list such members by default. Moreover, excluding private fields for the search of a \code{set()} will decrease the overhead for such field. 2) If no such method exists the \code{value} will be assigned to an existing field named \code{name}, if such exists. 3) Otherwise, the value will be assigned to a static field, if such exists. 4) In all other case, the value is assigned to a new field. Because any \code{set()} is called first, it is possible to \emph{encapsulate} (hide away) fields with certain names or to put restrictions to what values can be assigned to them. } \usage{ \method{$}{Object}(this, name) <- value \method{[[}{Object}(this, name) <- value } \arguments{ \item{name}{The name of the \code{set()} method or the name of the field to be assigned the new value.} \item{value}{The value to be assigned.} } \value{ Returns itself, i.e. \code{this}, as all \code{$<-} methods must do. } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/objectSize.Rd0000644000177400001440000000151513005563401014423 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % objectSize.default.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{objectSize} \alias{objectSize.default} \alias{objectSize} \title{Gets the size of the object in bytes} \description{ Gets the size of the object in bytes. This method is just a wrapper for \code{\link[utils]{object.size}}. } \usage{ \method{objectSize}{default}(...) } \arguments{ \item{...}{Arguments passed to \code{\link[utils]{object.size}}.} } \value{ Returns an \code{\link[base]{integer}}. } \author{Henrik Bengtsson} \seealso{ Internally \code{\link[utils]{object.size}}. } \keyword{attribute} \keyword{utilities} R.oo/man/print.BasicObject.Rd0000755000177400001440000000172513005563377015647 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % BasicObject.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{print.BasicObject} \alias{print.BasicObject} \alias{BasicObject.print} \alias{print,BasicObject-method} \title{Prints an BasicObject} \description{ For all objects of class \code{\link{BasicObject}}, this method will print the value of \code{as.character()} of the object. Note that this function is not called if the argument is not an object of class \code{\link{BasicObject}}. } \usage{ \method{print}{BasicObject}(x, ...) } \arguments{ \item{...}{Not used.} } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{print.default}}() For more information see \code{\link{BasicObject}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/as.character.Package.Rd0000755000177400001440000000147613005563400016222 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{as.character.Package} \alias{as.character.Package} \alias{Package.as.character} \alias{as.character,Package-method} \title{Gets a string representation of this package} \description{ Gets a string representation of this package. } \usage{ \method{as.character}{Package}(x, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{print(R.oo)} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/check.Rdoc.Rd0000755000177400001440000000201313005563401014262 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{check.Rdoc} \alias{check.Rdoc} \alias{Rdoc.check} \alias{check,Rdoc-method} \title{Checks the compiled Rd files} \description{ Checks the compiled Rd files. } \usage{ \method{check}{Rdoc}(this, manPath=getManPath(this), verbose=FALSE, ...) } \arguments{ \item{manPath}{The path to the Rd files (\code{\link[base]{character}} string).} \item{verbose}{If \code{\link[base:logical]{TRUE}}, extra information is outputted.} \item{...}{Not used.} } \value{ Returns a printable object, which, if non-empty will show the errors. } \details{ Internally the \code{tools} package is used. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/InternalErrorException.Rd0000755000177400001440000000563513005563377017015 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % InternalErrorException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{InternalErrorException} \docType{class} \alias{InternalErrorException} \title{InternalErrorException represents internal errors} \description{ Package: R.oo \cr \bold{Class InternalErrorException}\cr \code{\link[R.oo]{Object}}\cr \code{~~|}\cr \code{~~+--}\code{try-error}\cr \code{~~~~~~~|}\cr \code{~~~~~~~+--}\code{condition}\cr \code{~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~+--}\code{error}\cr \code{~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~+--}\code{simpleError}\cr \code{~~~~~~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~~~~~~+--}\code{\link[R.oo]{Exception}}\cr \code{~~~~~~~~~~~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~~~~~~~~~~~+--}\code{InternalErrorException}\cr \bold{Directly known subclasses:}\cr \cr public static class \bold{InternalErrorException}\cr extends \link[R.oo]{Exception}\cr InternalErrorException represents internal errors that are likely to be due to implementation errors done by the author of a specific package and not because the user made an error. Errors that are due to unexpected input to functions etc falls under this error type. } \usage{ InternalErrorException(..., package=NULL) } \arguments{ \item{...}{Any arguments accepted by \code{\link{Exception}}}. \item{package}{The name (\code{\link[base]{character}} string) of the package where the error exists. Can also be a \code{\link{Package}} object. If \code{\link[base]{NULL}}, the source of the error is assumed to be unknown.} } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{\link[R.oo:getMessage.InternalErrorException]{getMessage}} \tab Gets the message of the exception.\cr \tab \code{\link[R.oo:getPackage.InternalErrorException]{getPackage}} \tab Gets the suspicious package likely to contain an error.\cr } \bold{Methods inherited from Exception}:\cr as.character, getCall, getCalls, getLastException, getMessage, getStackTrace, getWhen, print, printStackTrace, throw \bold{Methods inherited from error}:\cr as.character, throw \bold{Methods inherited from condition}:\cr abort, as.character, conditionCall, conditionMessage, print \bold{Methods inherited from Object}:\cr $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save } \author{Henrik Bengtsson} \seealso{ For detailed information about exceptions see \code{\link{Exception}}. } \keyword{programming} \keyword{methods} \keyword{error} \keyword{classes} R.oo/man/getLastException.Exception.Rd0000755000177400001440000000217413005563377017562 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Exception$getLastException} \alias{Exception$getLastException} \alias{getLastException.Exception} \alias{Exception.getLastException} \alias{getLastException,Exception-method} \title{Static method to get the last Exception thrown} \description{ Static method to get the last Exception instanciated. } \usage{ ## Static method (use this): ## Exception$getLastException(...) ## Don't use the below: \method{getLastException}{Exception}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns an \code{\link{Exception}} object. } \examples{\dontrun{For a complete example see help(Exception).}} \seealso{ For more information see \code{\link{Exception}}. See also \code{\link[base:conditions]{tryCatch}()}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/attach.Object.Rd0000755000177400001440000000266213005563375015014 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{attach.Object} \alias{attach.Object} \alias{Object.attach} \alias{attach,Object-method} \title{Attaches an Object to the R search path} \description{ Attach the members of an Object to the \R search path. If trying to attach the same Object twice without detaching it inbetween, a \code{\link[base]{warning}} will be generated and nothing will be done. } \usage{ \method{attach}{Object}(this, private=FALSE, pos=2, ...) } \arguments{ \item{private}{If \code{\link[base:logical]{TRUE}}, private fields will also be attached, otherwise not.} \item{pos}{The position at in search path where the Object should be inserted.} \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the \code{\link[R.oo]{Object}} was attached, otherwise \code{\link[base:logical]{FALSE}}. } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:detach.Object]{*detach}()} and \code{\link[base]{attach}}(), \code{\link[base]{detach}}(). For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/isStatic.Class.Rd0000755000177400001440000000203513005563376015165 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isStatic.Class} \alias{isStatic.Class} \alias{Class.isStatic} \alias{isStatic,Class-method} \title{Checks if a class is static or not} \description{ Checks if a class is static or not. A class is static if it has static methods. } \usage{ \method{isStatic}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the class is static, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ if (!isStatic(RccViolationException)) throw("RccViolationException should be static because Exception is.") } \author{Henrik Bengtsson} \seealso{ \code{\link{setConstructorS3}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/gc.Object.Rd0000755000177400001440000000313012726216524014130 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 999.DEPRECATED.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{gc.Object} \alias{gc.Object} \alias{Object.gc} \alias{gc,Object-method} \title{Deprecated: Clear cached fields and calls the garbage collector} \description{ Deprecated: Clear cached fields and calls the garbage collector. Cached fields are set to \code{\link[base]{NULL}} when cleared. \emph{This method is deprecated. Please use \code{clearCache(..., gc=TRUE)} instead.} } \usage{ \method{gc}{Object}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \examples{ setConstructorS3("CachedObject", function(...) { extend(Object(), "CachedObject", ... ) }) setMethodS3("as.character", "CachedObject", function(this, ...) { s <- NextMethod("as.character", this, ...) s <- sprintf("\%s. RAM: \%.2fkb.", s, objectSize(this)/1024) s }) obj <- CachedObject(a=1, b=1:10^5, "cached:c"=1:10^6) print(ll(obj)) print(obj) # [1] "CachedObject: 0x02466E28. RAM: 4297.16kb." clearCache(obj, gc=TRUE) # Clear all cached fields print(ll(obj)) print(obj) # [1] "CachedObject: 0x02466E28. RAM: 391.05kb." } \author{Henrik Bengtsson} \seealso{ To clear the fields without calling the garbage collector, see \code{\link[R.oo:clearCache.Object]{*clearCache}()}. For more information see \code{\link{Object}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/isBeingCreated.Class.Rd0000755000177400001440000000342213005563376016253 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isBeingCreated.Class} \alias{isBeingCreated.Class} \alias{Class.isBeingCreated} \alias{isBeingCreated,Class-method} \title{Checks if a class is currently being initiated initiated} \description{ Checks if a class is currently being initiated initiated. When extending a class for the first time, which is typically done in a constructor, a static instance of the class is created by calling the constructor without parameters. This method provides a way to detect that second call inside the constructor. } \usage{ \method{isBeingCreated}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if a static instance exists, otherwise \code{\link[base:logical]{FALSE}}. } \examples{ setConstructorS3("Car", function(brand=NULL, nbrOfWheels=0) { if(!isBeingCreated(Car)) { if (is.null(brand)) throw("A car must have a brand") if (nbrOfWheels <= 0) throw("A car must have one or more wheels: ", nbrOfWheels) } extend(Object(), "Car", .brand = brand, .nbrOfWheels = nbrOfWheels ) }) setMethodS3("as.character", "Car", function(this, ...) { cat(class(this)[1], ":", this$.brand, " with ", this$.nbrOfWheels, " wheels.", sep=""); }) print(Car("Volvo", 4)) print(Car("BMW", 4)) print(Car("Tyrrell P34", 6)) print(Car("T-Rex", 3)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/RccViolationException.Rd0000755000177400001440000000664313005563400016606 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % RccViolationException.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{RccViolationException} \docType{class} \alias{RccViolationException} \title{An RccViolationException indicates a violation of the R Coding Conventions (RCC)} \description{ Package: R.oo \cr \bold{Class RccViolationException}\cr \code{\link[R.oo]{Object}}\cr \code{~~|}\cr \code{~~+--}\code{try-error}\cr \code{~~~~~~~|}\cr \code{~~~~~~~+--}\code{condition}\cr \code{~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~+--}\code{error}\cr \code{~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~+--}\code{simpleError}\cr \code{~~~~~~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~~~~~~+--}\code{\link[R.oo]{Exception}}\cr \code{~~~~~~~~~~~~~~~~~~~~~~~~~~~|}\cr \code{~~~~~~~~~~~~~~~~~~~~~~~~~~~+--}\code{RccViolationException}\cr \bold{Directly known subclasses:}\cr \cr public static class \bold{RccViolationException}\cr extends \link[R.oo]{Exception}\cr An RccViolationException indicates a violation of the R Coding Conventions (RCC). It is generated by \code{setConstructorS3()} and \code{setMethodS3()}. It is \emph{not} meant to be caught, but instead the source code that violates the RCC should be fixed. For more information about RCC, see references below. } \usage{ RccViolationException(...) } \arguments{ \item{...}{Any arguments accepted by the constructor of Exception, i.e. one or several \code{\link[base]{character}} strings, which will be concatenated and contain informative message about why the RCC was violated.} } \section{Fields and Methods}{ \bold{Methods:}\cr \tabular{rll}{ \tab \code{\link[R.oo:as.character.RccViolationException]{as.character}} \tab Gets a string representing of the RCC violation.\cr \tab \code{\link[R.oo:getRccUrl.RccViolationException]{getRccUrl}} \tab Static method to get a URL where the RCC can be found.\cr } \bold{Methods inherited from Exception}:\cr as.character, getCall, getCalls, getLastException, getMessage, getStackTrace, getWhen, print, printStackTrace, throw \bold{Methods inherited from error}:\cr as.character, throw \bold{Methods inherited from condition}:\cr abort, as.character, conditionCall, conditionMessage, print \bold{Methods inherited from Object}:\cr $, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save } \details{ Since it is not possible to assert that the RCC is followed during the parsing of the source code, but first only when the source code is actually executed. } \examples{ \dontrun{ setConstructorS3("myClass", function() { extends(Object(), .value=0) }) setMethodS3("MyMethod", "myClass", function(this) { "Hullo!" }) } } \author{Henrik Bengtsson} \seealso{ See also \code{\link[base]{try}}() and \code{\link[base:conditions]{tryCatch}()}. For detailed information about exceptions see \code{\link{Exception}}. The R Coding Conventions (RCC) can be found at \url{http://aroma-project.org/developers/RCC/}. } \keyword{classes} \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} R.oo/man/getContribUrl.Package.Rd0000755000177400001440000000212513005563400016437 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getContribUrl.Package} \alias{getContribUrl.Package} \alias{Package.getContribUrl} \alias{getContribUrl,Package-method} \title{Gets the URL(s) from where this package can be installed} \description{ Gets the URL(s) from where this package can be installed by first looking for comma or semicolon separated URLs at the optional \code{ContribURL} line in the \code{DESCRIPTION} file of the package. If no such line exists, \code{getUrl()} is used. } \usage{ \method{getContribUrl}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a vector of \code{\link[base]{character}} strings. } \examples{ pkg <- Package("R.oo") print(getContribUrl(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getKnownSubclasses.Class.Rd0000755000177400001440000000260713005563376017233 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getKnownSubclasses.Class} \alias{getKnownSubclasses.Class} \alias{Class.getKnownSubclasses} \alias{getKnownSubclasses,Class-method} \title{Gets all subclasses that are currently loaded} \description{ Gets all subclasses that are currently loaded. } \usage{ \method{getKnownSubclasses}{Class}(this, sort=TRUE, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{vector}} of \code{\link[base]{character}} strings. } \examples{ \dontrun{ # Due to a bug in R CMD check (R v1.7.1) the MicroarrayData$read() call # below will call getKnownSubclasses(), which will generate # "Error in exists(objectName, mode = "function") : # [2003-07-07 23:32:41] Exception: F used instead of FALSE" # Note that the example still work, just not in R CMD check print(getKnownSubclasses(Exception)) } \dontrun{ returns [1] "Exception" "try-error" "Object" } } \author{Henrik Bengtsson} \seealso{ \code{\link[R.oo:getSuperclasses.Class]{*getSuperclasses}()}. For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/DOLLAR.Object.Rd0000755000177400001440000000432713005563375014525 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{DOLLAR.Object} \alias{$.Object} \alias{Object.$} \alias{$,Object-method} \alias{Object.[[} \alias{[[.Object} \alias{[[,Object-method} \title{Makes the fields and methods of an Object accessable via the \$ and the [[ operator} \description{ Makes the fields and methods of an Object accessable via the \code{$} operator. This method is never called explicitly, but through an indirect usage of the \code{$} operator, e.g. \code{obj$name} or \code{obj$getValue()}. 1) This method will first search for a \code{get()} method, e.g. if name has the value \code{"age"}, a \code{getAge()} will be looked for. If such a method exists it will be called with the Object as the first and only argument, e.g. \code{getAge(this)}. A \code{get()} is only looked for if \code{} is not a private field. A private field is a name \emph{beginning} with a \code{.} (period). The rational for this naming convention is to be consistent with how \code{\link[base]{ls}}() works, which will not list such members by default. 2) If no such method exists, first then, this method will look a field in the Object can has the name \code{name}. 3) If such neither exists, a method with name \code{name} will be searched for and returned. 4) Otherwise, a static field will be looked for. 5) If no fields or methods are found at all, \code{\link[base]{NULL}} is returned. } \usage{ \method{$}{Object}(this, name) \method{[[}{Object}(this, name, exact=TRUE) } \arguments{ \item{name}{The name of the field or method to be accessed.} } \value{ Returns the value of a field or a method (\code{\link[base]{function}}). If no such field or method exists, \code{\link[base]{NULL}} is returned. } \examples{\dontrun{For a complete example see help(Object).}} \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getTitle.Package.Rd0000755000177400001440000000154313005563400015440 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getTitle.Package} \alias{getTitle.Package} \alias{Package.getTitle} \alias{getTitle,Package-method} \title{Gets the Title of this package} \description{ Gets the Title of this package as specified by the \code{DESCRIPTION} file. } \usage{ \method{getTitle}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{ pkg <- Package("R.oo") print(getTitle(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/isDeprecated.Class.Rd0000755000177400001440000000166013005563376016001 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{isDeprecated.Class} \alias{isDeprecated.Class} \alias{Class.isDeprecated} \alias{isDeprecated,Class-method} \title{Checks if a class is deprecated or not} \description{ Checks if a class is deprecated or not. } \usage{ \method{isDeprecated}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the class is deprecated, otherwise \code{\link[base:logical]{FALSE}}. } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{class}}(). \code{\link{setConstructorS3}}(). For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/getFields.Interface.Rd0000644000177400001440000000140213005563377016136 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Interface.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getFields.Interface} \alias{getFields.Interface} \alias{Interface.getFields} \alias{getFields,Interface-method} \title{Returns NULL} \description{ Returns NULL. } \usage{ \method{getFields}{Interface}(...) } \arguments{ \item{...}{Ignored.} } \value{ Always returns \code{\link[base]{NULL}}. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Interface}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/equals.Rd0000755000177400001440000000333313005563401013617 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % equals.default.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{equals} \alias{equals.default} \alias{equals} \title{Compares an object with another} \description{ Compares an object with another and returns \code{\link[base:logical]{TRUE}} if they are equal. The equal property must be 1) \emph{reflexive}, i.e. \code{equals(o1,o1)} should be \code{\link[base:logical]{TRUE}}. 2) \emph{symmetric}, i.e. \code{equals(o1,o2)} is \code{\link[base:logical]{TRUE}} if and only if \code{equals(o2,o1)} is \code{\link[base:logical]{TRUE}}. 3) \emph{transitive}, i.e. \code{equals(o1,o2)} is \code{\link[base:logical]{TRUE}} and \code{equals(o2,o3)} is \code{\link[base:logical]{TRUE}}, then \code{equals(o1,o3)} should be \code{\link[base:logical]{TRUE}}. 5) \emph{consistent}, i.e. \code{equals(o1,o2)} should return the same result on multiple invocations as long as nothing has changed. 6) \code{equals(o1,}\code{\link[base]{NULL}}\code{)} should return \code{\link[base:logical]{FALSE}}, unless \code{o1} is also \code{\link[base]{NULL}}. By default \code{\link[base]{identical}}() is used. } \usage{ \method{equals}{default}(object, other, ...) } \arguments{ \item{object, other}{Objects to be compared.} \item{...}{Not used.} } \value{ Returns \code{\link[base:logical]{TRUE}} if the objects are equal, otherwise \code{\link[base:logical]{FALSE}}. } \author{Henrik Bengtsson} \seealso{ \code{\link[base]{identical}}(). } \keyword{attribute} \keyword{utilities} \keyword{internal} R.oo/man/getRdTitle.Rdoc.Rd0000755000177400001440000000207013005563401015257 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$getRdTitle} \alias{Rdoc$getRdTitle} \alias{getRdTitle.Rdoc} \alias{Rdoc.getRdTitle} \alias{getRdTitle,Rdoc-method} \title{Extracts the title string of a Rd file} \description{ Extracts the title string of a Rd file corresponding the the specified method of the specified class. } \usage{ ## Static method (use this): ## Rdoc$getRdTitle(class, method, ...) ## Don't use the below: \method{getRdTitle}{Rdoc}(this, class, method, ...) } \arguments{ \item{method}{The method to be search for.} \item{class}{The class the method belongs to.} \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/getName.Package.Rd0000755000177400001440000000136213005563400015236 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getName.Package} \alias{getName.Package} \alias{Package.getName} \alias{getName,Package-method} \title{Gets the name of this package} \description{ Gets the name of this package. } \usage{ \method{getName}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getBundlePackages.Package.Rd0000755000177400001440000000243313005563400017226 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getBundlePackages.Package} \alias{getBundlePackages.Package} \alias{Package.getBundlePackages} \alias{getBundlePackages,Package-method} \title{Gets the names of the other packages that is in the same bundle as this package} \description{ Gets the names of the other packages that is in the same bundle as this package as specified by the \code{DESCRIPTION} file. } \usage{ \method{getBundlePackages}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} \code{\link[base]{vector}} of package names or \code{\link[base]{NULL}}. } \details{ The first call to this method is normally slow because all installed packages are scanned. The result of this first call is cached and used as the return value for all subsequent calls, which are then much faster. } \examples{ pkg <- Package("R.oo") print(getBundle(pkg)) } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/getInternalAddress.Object.Rd0000755000177400001440000000250713005563375017330 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 050.Object.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getInternalAddress.Object} \alias{getInternalAddress.Object} \alias{Object.getInternalAddress} \alias{getInternalAddress,Object-method} \title{Gets the memory location where the Object resides} \description{ Gets the memory location where the Object resides. } \usage{ \method{getInternalAddress}{Object}(this, format=c("numeric", "hexstring"), ...) } \arguments{ \item{format}{A \code{\link[base]{character}} string specifying what format to return.} \item{...}{Not used.} } \value{ The address is returned as a \code{\link[base]{numeric}} integer if \code{format == "numeric"}, and as a \code{\link[base]{character}} string if \code{format == "hexstring"}. } \examples{ obj <- Object() getInternalAddress(obj, format="numeric") # 179742632 getInternalAddress(obj, format="hexstring") # "0x000000000ab6a7a8" } \author{Henrik Bengtsson} \seealso{ \code{\link[=getName.environment]{getName()}}. For more information see \code{\link{Object}}. } \keyword{programming} \keyword{methods} \keyword{internal} \keyword{methods} R.oo/man/getName.Class.Rd0000755000177400001440000000152313005563376014763 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{getName.Class} \alias{getName.Class} \alias{Class.getName} \alias{getName,Class-method} \title{Gets the name of the class} \description{ Gets the name of the class. } \usage{ \method{getName}{Class}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{ print(getName(Object)) # "Object" print(getName(Class)) # "Class" } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/showHowToCite.Package.Rd0000755000177400001440000000161713005563400016427 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Package.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{showHowToCite.Package} \alias{showHowToCite.Package} \alias{Package.showHowToCite} \alias{showHowToCite,Package-method} \title{Show the HOWTOCITE file of this package} \description{ Show the HOWTOCITE file of this package. See also \code{\link[R.oo:getHowToCite.Package]{*getHowToCite}()}. If the \code{HOWTOCITE} file does not exist, an exception is thrown. } \usage{ \method{showHowToCite}{Package}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Package}}. } \keyword{internal} \keyword{methods} R.oo/man/printStackTrace.Exception.Rd0000755000177400001440000000176113005563377017402 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Exception.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{printStackTrace.Exception} \alias{printStackTrace.Exception} \alias{Exception.printStackTrace} \alias{printStackTrace,Exception-method} \title{Prints the stack trace saved when the exception was created} \description{ . } \usage{ \method{printStackTrace}{Exception}(this, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns nothing. } \examples{\dontrun{For a complete example see help(Exception).}} \seealso{ \code{\link[R.oo:getStackTrace.Exception]{*getStackTrace}()}. \code{\link[base:conditions]{tryCatch}()}. For more information see \code{\link{Exception}}. } \author{Henrik Bengtsson} \keyword{programming} \keyword{methods} \keyword{error} \keyword{internal} \keyword{methods} R.oo/man/as.character.Class.Rd0000755000177400001440000000163613005563376015746 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 060.Class.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{as.character.Class} \alias{as.character.Class} \alias{Class.as.character} \alias{as.character,Class-method} \title{Returns a short string describing the class} \description{ Returns a short string describing the class. } \usage{ \method{as.character}{Class}(x, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \examples{ print(as.character(Object)) # gives: "Class Object: no fields, 8 methods (no inherited)" } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Class}}. } \keyword{internal} \keyword{methods} \keyword{programming} R.oo/man/methodsInheritedFrom.Rdoc.Rd0000755000177400001440000000233013005563401017332 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % Rdoc.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Rdoc$methodsInheritedFrom} \alias{Rdoc$methodsInheritedFrom} \alias{methodsInheritedFrom.Rdoc} \alias{Rdoc.methodsInheritedFrom} \alias{methodsInheritedFrom,Rdoc-method} \title{Gets all methods inherited from a class in Rd format} \description{ Gets all methods inherited from a class in Rd format. } \usage{ ## Static method (use this): ## Rdoc$methodsInheritedFrom(class, visibility=c("public", "protected", "private"), ## showDeprecated=FALSE, inheritedFrom=NULL, sort=TRUE, trial=FALSE, ...) ## Don't use the below: \method{methodsInheritedFrom}{Rdoc}(this, class, visibility=c("public", "protected", "private"), showDeprecated=FALSE, inheritedFrom=NULL, sort=TRUE, trial=FALSE, ...) } \arguments{ \item{...}{Not used.} } \value{ Returns a \code{\link[base]{character}} string. } \author{Henrik Bengtsson} \seealso{ For more information see \code{\link{Rdoc}}. } \keyword{internal} \keyword{methods} \keyword{documentation} R.oo/man/Non-documented_objects.Rd0000755000177400001440000000722113005563376016730 0ustar murdochusers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Do not modify this file since it was automatically generated from: % % 999.NonDocumentedObjects.R % % by the Rdoc compiler part of the R.oo package. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \name{Non-documented objects} \alias{Non-documented objects} \title{Non-documented objects} % The BasicObject class \alias{getInstanciationTime.default} \alias{isReferable} % The Class class \alias{forName} \alias{getDetails} \alias{getKnownSubclasses} \alias{getMethods} \alias{getMethods.default} \alias{getName} \alias{getPackage} \alias{getStaticInstance} \alias{getSuperclasses} \alias{isAbstract} \alias{isBeingCreated} \alias{isDeprecated} \alias{isPrivate} \alias{isProtected} \alias{isPublic} \alias{isStatic} \alias{newInstance} % The Exception class \alias{getCalls} \alias{getCall} \alias{getLastException} \alias{getMessage} \alias{getStackTrace} \alias{getStackTraceString} \alias{getWhen} \alias{printStackTrace} % The Object class \alias{attach} \alias{attach.default} \alias{attachLocally} \alias{clone} \alias{clearLookupCache} \alias{clearCache} \alias{detach} \alias{detach.default} \alias{finalize} \alias{gc} \alias{getFields} \alias{getInstanciationTime} \alias{getInstanciationTime.default} \alias{getInstantiationTime} \alias{getInternalAddress} \alias{getFieldModifier} \alias{getFieldModifiers} \alias{hasField} \alias{load} \alias{load.default} \alias{novirtual} \alias{registerFinalizer} \alias{save} \alias{save.default} \alias{staticCode} % The Package class \alias{getAuthor} \alias{getBundle} \alias{getBundlePackages} \alias{getChangeLog} \alias{getClasses} \alias{getClasses.default} \alias{getContribUrl} \alias{getContents} \alias{getDataPath} \alias{getDate} \alias{getDescription} \alias{getDescriptionFile} \alias{getDevelUrl} \alias{getDocPath} \alias{getEnvironment} \alias{getExamplePath} \alias{getHistory} \alias{getHowToCite} \alias{getLicense} \alias{getMaintainer} \alias{getManPath} \alias{getNews} \alias{getPath} \alias{getPosition} \alias{getTitle} \alias{getUrl} \alias{getVersion} \alias{isLoaded} \alias{isOlderThan} \alias{showChangeLog} \alias{showContents} \alias{showDescriptionFile} \alias{showHistory} \alias{showHowToCite} \alias{showNews} \alias{startupMessage} \alias{unload} % The RccViolationException class \alias{getRccUrl} % The Rdoc class \alias{argsToString} \alias{check} \alias{compile} \alias{createManPath} \alias{createName} \alias{declaration} \alias{escapeRdFilename} \alias{getClassS4Usage} \alias{getKeywords} \alias{getNameFormat} \alias{getObject} \alias{getObject.Rdoc} \alias{getPackageNameOf} \alias{getRdDeclaration} \alias{getRdHierarchy} \alias{getRdMethods} \alias{getRdTitle} \alias{getUsage} \alias{hierarchy} \alias{isKeyword} \alias{isVisible} \alias{methodsInheritedFrom} \alias{setManPath} \alias{setNameFormat} % The RdocException class \alias{getSource} % Trial functions \alias{gc.default} \alias{callSuperMethodS3} \alias{callSuperMethodS3.default} % Deprecated functions \alias{setClassS3} \alias{setClassS3.default} \alias{getClass.BasicObject} \alias{getClass.default} \description{ This page contains aliases for all "non-documented" objects that \code{R CMD check} detects in this package. Almost all of them are \emph{generic} functions that have specific document for the corresponding method coupled to a specific class. Other functions are re-defined by \code{setMethodS3()} to \emph{default} methods. Neither of these two classes are non-documented in reality. The rest are deprecated methods. } \author{Henrik Bengtsson} \keyword{internal} \keyword{methods} \keyword{documentation}