File: AAA.R

package info (click to toggle)
r-cran-sp 1%3A0.9-66-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,696 kB
  • ctags: 123
  • sloc: ansic: 1,475; sh: 6; makefile: 5
file content (29 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#require(methods)
#
#.First.lib <- function(libname, pkgname){
#    library.dynam("sp", pkgname, libname)
#}
#EJP--uncomment, so setMethod("[", etc ) and as(x, "data.frame") will work:
#.noGenerics <- TRUE 

.onLoad <- function(lib, pkg) {
	require(methods)
}


.onUnload <- function(libpath)
    library.dynam.unload("sp", libpath)

if (!exists("is.R")) {
  is.R = function() {
 	exists("version") && !is.null(vl <- version$language) && vl == "R"
  }
  which.max = function(x) {
  	ix = 1:length(x)
	mx = ix[x == max(x)]
	mx[1]
  }
  NCOL = function(x) {
  	if (is.array(x) && length(dim(x)) > 1 || is.data.frame(x)) ncol(x) else as.integer(1)
  }
}