R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > y <- c(10723.8,13938.9,13979.8,13807.4,12973.9,12509.8,12934.1,14908.3,13772.1,13012.6,14049.9,11816.5,11593.2,14466.2,13615.9,14733.9,13880.7,13527.5,13584,16170.2,13260.6,14741.9,15486.5,13154.5,12621.2,15031.6,15452.4,15428,13105.9,14716.8,14180,16202.2,14392.4,15140.6,15960.1,14351.3,13230.2,15202.1,17056,16077.7,13348.2,16402.4,16559.1,16579,17561.2,16129.6,18484.3,16402.6,14032.3,17109.1,17157.2,13879.8,12362.4,12683.5,12608.8,13583.7,12846.3,12347.1,13967,13114.3) > x <- c(10414.9,12476.8,12384.6,12266.7,12919.9,11497.3,12142,13919.4,12656.8,12034.1,13199.7,10881.3,11301.2,13643.9,12517,13981.1,14275.7,13435,13565.7,16216.3,12970,14079.9,14235,12213.4,12581,14130.4,14210.8,14378.5,13142.8,13714.7,13621.9,15379.8,13306.3,14391.2,14909.9,14025.4,12951.2,14344.3,16093.4,15413.6,14705.7,15972.8,16241.4,16626.4,17136.2,15622.9,18003.9,16136.1,14423.7,16789.4,16782.2,14133.8,12607,12004.5,12175.4,13268,12299.3,11800.6,13873.3,12269.6) > par7 = 'Y' > par6 = 'Y' > par5 = '0' > par4 = '0' > par3 = '0' > par2 = '50' > par1 = '50' > ylab = 'y' > xlab = 'x' > main = 'Bivariate Kernel Density' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 ## > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR#S#, #YEAR#, YOUR SOFTWARE TITLE #vNUMBER# in Free Statistics Software #v$_version#, Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description #don't use hard returns!# > par1 <- as#par1,'numeric'# > par2 <- as#par2,'numeric'# > par3 <- as#par3,'numeric'# > par4 <- as#par4,'numeric'# > par5 <- as#par5,'numeric'# > library#'GenKern'# function (package, help, pos = 2, lib.loc = NULL, character.only = FALSE, logical.return = FALSE, warn.conflicts = TRUE, keep.source = getOption("keep.source.pkgs"), verbose = getOption("verbose")) { paste0 <- function(...) paste(..., sep = "") testRversion <- function(pkgInfo, pkgname, pkgpath) { current <- getRversion() if (length(Rdeps <- pkgInfo$Rdepends2)) { for (dep in Rdeps) if (length(dep) > 1L) { target <- as.numeric_version(dep$version) res <- eval(parse(text = paste("current", dep$op, "target"))) if (!res) stop(gettextf("This is R %s, package '%s' needs %s %s", current, pkgname, dep$op, target), call. = FALSE, domain = NA) } } else if (length(Rdeps <- pkgInfo$Rdepends) > 1L) { target <- as.numeric_version(Rdeps$version) res <- eval(parse(text = paste("current", Rdeps$op, "target"))) if (!res) stop(gettextf("This is R %s, package '%s' needs %s %s", current, pkgname, Rdeps$op, target), call. = FALSE, domain = NA) } if (!is.null(built <- pkgInfo$Built)) { R_version_built_under <- as.numeric_version(built$R) if (R_version_built_under < "2.0.0") stop(gettextf("package '%s' was built before R 2.0.0: please re-install it", pkgname), call. = FALSE, domain = NA) if (R_version_built_under > current) warning(gettextf("package '%s' was built under R version %s", pkgname, as.character(built$R)), call. = FALSE, domain = NA) if (.Platform$OS.type == "unix") { platform <- built$Platform r_arch <- .Platform$r_arch if (!nzchar(r_arch) && length(grep("\\w", platform)) && !testPlatformEquivalence(platform, R.version$platform)) stop(gettextf("package '%s' was built for %s", pkgname, platform), call. = FALSE, domain = NA) if (nzchar(r_arch) && file.exists(file.path(pkgpath, "libs")) && !file.exists(file.path(pkgpath, "libs", r_arch))) stop(gettextf("package '%s' is not installed for 'arch=%s'", pkgname, r_arch), call. = FALSE, domain = NA) } } else stop(gettextf("package '%s' has not been installed properly\n", pkgname), gettext("See the Note in ?library"), call. = FALSE, domain = NA) } checkNoGenerics <- function(env, pkg) { nenv <- env ns <- .Internal(getRegisteredNamespace(as.name(pkg))) if (!is.null(ns)) nenv <- asNamespace(ns) if (exists(".noGenerics", envir = nenv, inherits = FALSE)) TRUE else { length(objects(env, pattern = "^\\.__[MT]", all.names = TRUE)) == 0L } } checkConflicts <- function(package, pkgname, pkgpath, nogenerics, env) { dont.mind <- c("last.dump", "last.warning", ".Last.value", ".Random.seed", ".First.lib", ".Last.lib", ".packageName", ".noGenerics", ".required", ".no_S3_generics") sp <- search() lib.pos <- match(pkgname, sp) ob <- objects(lib.pos, all.names = TRUE) if (!nogenerics) { these <- objects(lib.pos, all.names = TRUE) these <- these[substr(these, 1L, 6L) == ".__T__"] gen <- gsub(".__T__(.*):([^:]+)", "\\1", these) from <- gsub(".__T__(.*):([^:]+)", "\\2", these) gen <- gen[from != package] ob <- ob[!(ob %in% gen)] } fst <- TRUE ipos <- seq_along(sp)[-c(lib.pos, match(c("Autoloads", "CheckExEnv"), sp, 0L))] for (i in ipos) { obj.same <- match(objects(i, all.names = TRUE), ob, nomatch = 0L) if (any(obj.same > 0)) { same <- ob[obj.same] same <- same[!(same %in% dont.mind)] Classobjs <- grep("^\\.__", same) if (length(Classobjs)) same <- same[-Classobjs] same.isFn <- function(where) sapply(same, exists, where = where, mode = "function", inherits = FALSE) same <- same[same.isFn(i) == same.isFn(lib.pos)] if (length(same)) same <- same[sapply(same, function(.) !identical(get(., i), get(., lib.pos)))] if (length(same)) { if (fst) { fst <- FALSE packageStartupMessage(gettextf("\nAttaching package: '%s'\n", package), domain = NA) } packageStartupMessage(paste("\n\tThe following object(s) are masked", if (i < lib.pos) "_by_" else "from", sp[i], ":\n\n\t", paste(same, collapse = ",\n\t "), "\n")) } } } } runUserHook <- function(pkgname, pkgpath) { hook <- getHook(packageEvent(pkgname, "attach")) for (fun in hook) try(fun(pkgname, pkgpath)) } bindTranslations <- function(pkgname, pkgpath) { popath <- file.path(pkgpath, "po") if (!file.exists(popath)) return() bindtextdomain(pkgname, popath) bindtextdomain(paste("R", pkgname, sep = "-"), popath) } if (!missing(package)) { if (is.null(lib.loc)) lib.loc <- .libPaths() lib.loc <- lib.loc[file.info(lib.loc)$isdir %in% TRUE] if (!character.only) package <- as.character(substitute(package)) if (length(package) != 1L) stop("'package' must be of length 1") if (is.na(package) || (package == "")) stop("invalid package name") pkgname <- paste("package", package, sep = ":") newpackage <- is.na(match(pkgname, search())) if (newpackage) { pkgpath <- .find.package(package, lib.loc, quiet = TRUE, verbose = verbose) if (length(pkgpath) == 0L) { txt <- if (length(lib.loc)) gettextf("there is no package called '%s'", package) else gettext("no library trees found in 'lib.loc'") if (logical.return) { warning(txt, domain = NA) return(FALSE) } else stop(txt, domain = NA) } which.lib.loc <- dirname(pkgpath) pfile <- system.file("Meta", "package.rds", package = package, lib.loc = which.lib.loc) if (!nzchar(pfile)) stop(gettextf("'%s' is not a valid installed package", package), domain = NA) pkgInfo <- .readRDS(pfile) testRversion(pkgInfo, package, pkgpath) if (is.character(pos)) { npos <- match(pos, search()) if (is.na(npos)) { warning(gettextf("'%s' not found on search path, using pos = 2", pos), domain = NA) pos <- 2 } else pos <- npos } .getRequiredPackages2(pkgInfo) if (packageHasNamespace(package, which.lib.loc)) { tt <- try({ ns <- loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) dataPath <- file.path(which.lib.loc, package, "data") env <- attachNamespace(ns, pos = pos, dataPath = dataPath) }) if (inherits(tt, "try-error")) if (logical.return) return(FALSE) else stop(gettextf("package/namespace load failed for '%s'", package), call. = FALSE, domain = NA) else { on.exit(do.call("detach", list(name = pkgname))) nogenerics <- !.isMethodsDispatchOn() || checkNoGenerics(env, package) if (warn.conflicts && !exists(".conflicts.OK", envir = env, inherits = FALSE)) checkConflicts(package, pkgname, pkgpath, nogenerics, ns) runUserHook(package, pkgpath) on.exit() if (logical.return) return(TRUE) else return(invisible(.packages())) } } dependsMethods <- "methods" %in% names(pkgInfo$Depends) if (dependsMethods && pkgInfo$Built$R < "2.4.0") stop("package was installed prior to 2.4.0 and must be re-installed") codeFile <- file.path(which.lib.loc, package, "R", package) loadenv <- new.env(hash = TRUE, parent = .GlobalEnv) assign(".packageName", package, envir = loadenv) if (file.exists(codeFile)) { res <- try(sys.source(codeFile, loadenv, keep.source = keep.source)) if (inherits(res, "try-error")) stop(gettextf("unable to load R code in package '%s'", package), call. = FALSE, domain = NA) } else if (verbose) warning(gettextf("package '%s' contains no R code", package), domain = NA) dbbase <- file.path(which.lib.loc, package, "data", "Rdata") if (file.exists(paste0(dbbase, ".rdb"))) lazyLoad(dbbase, loadenv) dbbase <- file.path(which.lib.loc, package, "R", "sysdata") if (file.exists(paste0(dbbase, ".rdb"))) lazyLoad(dbbase, loadenv) env <- attach(NULL, pos = pos, name = pkgname) on.exit(do.call("detach", list(name = pkgname))) attr(env, "path") <- file.path(which.lib.loc, package) .Internal(lib.fixup(loadenv, env)) bindTranslations(package, pkgpath) if (exists(".First.lib", mode = "function", envir = env, inherits = FALSE)) { firstlib <- get(".First.lib", mode = "function", envir = env, inherits = FALSE) tt <- try(firstlib(which.lib.loc, package)) if (inherits(tt, "try-error")) if (logical.return) return(FALSE) else stop(gettextf(".First.lib failed for '%s'", package), domain = NA) } if (!is.null(firstlib <- getOption(".First.lib")[[package]])) { tt <- try(firstlib(which.lib.loc, package)) if (inherits(tt, "try-error")) if (logical.return) return(FALSE) else stop(gettextf(".First.lib failed for '%s'", package), domain = NA) } nogenerics <- !.isMethodsDispatchOn() || checkNoGenerics(env, package) if (warn.conflicts && !exists(".conflicts.OK", envir = env, inherits = FALSE)) checkConflicts(package, pkgname, pkgpath, nogenerics, env) if (!nogenerics) methods::cacheMetaData(env, TRUE, searchWhere = .GlobalEnv) runUserHook(package, pkgpath) on.exit() } if (verbose && !newpackage) warning(gettextf("package '%s' already present in search()", package), domain = NA) } else if (!missing(help)) { if (!character.only) help <- as.character(substitute(help)) pkgName <- help[1L] pkgPath <- .find.package(pkgName, lib.loc, verbose = verbose) docFiles <- c(file.path(pkgPath, "Meta", "package.rds"), file.path(pkgPath, "INDEX")) if (file.exists(vignetteIndexRDS <- file.path(pkgPath, "Meta", "vignette.rds"))) docFiles <- c(docFiles, vignetteIndexRDS) pkgInfo <- vector(length = 3L, mode = "list") readDocFile <- function(f) { if (basename(f) %in% "package.rds") { txt <- .readRDS(f)$DESCRIPTION if ("Encoding" %in% names(txt)) { to <- if (Sys.getlocale("LC_CTYPE") == "C") "ASCII//TRANSLIT" else "" tmp <- try(iconv(txt, from = txt["Encoding"], to = to)) if (!inherits(tmp, "try-error")) txt <- tmp else warning("'DESCRIPTION' has 'Encoding' field and re-encoding is not possible", call. = FALSE) } nm <- paste0(names(txt), ":") formatDL(nm, txt, indent = max(nchar(nm, "w")) + 3) } else if (basename(f) %in% "vignette.rds") { txt <- .readRDS(f) if (is.data.frame(txt) && nrow(txt)) cbind(basename(gsub("\\.[[:alpha:]]+$", "", txt$File)), paste(txt$Title, paste0(rep.int("(source", NROW(txt)), ifelse(txt$PDF != "", ", pdf", ""), ")"))) else NULL } else readLines(f) } for (i in which(file.exists(docFiles))) pkgInfo[[i]] <- readDocFile(docFiles[i]) y <- list(name = pkgName, path = pkgPath, info = pkgInfo) class(y) <- "packageInfo" return(y) } else { if (is.null(lib.loc)) lib.loc <- .libPaths() db <- matrix(character(0L), nrow = 0L, ncol = 3L) nopkgs <- character(0L) for (lib in lib.loc) { a <- .packages(all.available = TRUE, lib.loc = lib) for (i in sort(a)) { file <- system.file("Meta", "package.rds", package = i, lib.loc = lib) title <- if (file != "") { txt <- .readRDS(file) if (is.list(txt)) txt <- txt$DESCRIPTION if ("Encoding" %in% names(txt)) { to <- if (Sys.getlocale("LC_CTYPE") == "C") "ASCII//TRANSLIT" else "" tmp <- try(iconv(txt, txt["Encoding"], to, "?")) if (!inherits(tmp, "try-error")) txt <- tmp else warning("'DESCRIPTION' has 'Encoding' field and re-encoding is not possible", call. = FALSE) } txt["Title"] } else NA if (is.na(title)) title <- " ** No title available ** " db <- rbind(db, cbind(i, lib, title)) } if (length(a) == 0L) nopkgs <- c(nopkgs, lib) } dimnames(db) <- list(NULL, c("Package", "LibPath", "Title")) if (length(nopkgs) && !missing(lib.loc)) { pkglist <- paste(sQuote(nopkgs), collapse = ", ") msg <- sprintf(ngettext(length(nopkgs), "library %s contains no packages", "libraries %s contain no packages"), pkglist) warning(msg, domain = NA) } y <- list(header = NULL, results = db, footer = NULL) class(y) <- "libraryIQR" return(y) } if (logical.return) TRUE else invisible(.packages()) } > if #par3##0# par3 <- dpik#x# + if #par4##0# par4 <- dpik#y# Error: unexpected 'if' in: "if #par3##0# par3 <- dpik#x# if" Execution halted