├── src ├── date.ts ├── matrix.ts ├── data.frame.ts ├── formula.ts ├── timeseries.ts ├── types.ts ├── logger.ts ├── checks.ts ├── list.ts ├── public.ts ├── factor.ts ├── helpers.ts └── s3.ts ├── webpack.config.js ├── README.md ├── misc.md ├── .npmignore.json ├── index.ts ├── .nycrc ├── .travis.yml ├── spell.json ├── .github └── ISSUE_TEMPLATE │ ├── Feature_request.md │ └── Bug_report.md ├── na.md ├── CONTRIBUTING.md ├── tsconfig.json ├── .gitignore ├── package.json ├── tslint.json ├── system.md ├── r-base-list.txt ├── list-copy-paste.md └── LICENSE /src/date.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/matrix.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/data.frame.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/formula.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/timeseries.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # r-base 2 | r::base port to Javascript/Typescript 3 | -------------------------------------------------------------------------------- /misc.md: -------------------------------------------------------------------------------- 1 | 2 | base::q _quit_ 3 | base::getNativeSymbolInfo 4 | base::computeRestarts 5 | -------------------------------------------------------------------------------- /.npmignore.json: -------------------------------------------------------------------------------- 1 | src 2 | !dist/src 3 | docs 4 | config 5 | coverage 6 | nyc.md 7 | .* 8 | *.f 9 | spell.json 10 | tsconfig.json 11 | tslint.json 12 | yarn.lock 13 | package-lock.json 14 | test 15 | node_modules 16 | scratch-pad 17 | *.exe 18 | notes.md 19 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | export type ScalarType = number | string | boolean; 2 | export type ScalarFunc = () => ScalarType; 3 | export type FactorType = ScalarType | ScalarFunc | null; 4 | export type TYPESASSTRINGS = "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" | "array" | "null"; -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | //import { Renhance, $class, $attr, UseMethod, $matrix, $list, $vector, $default } from './src/s3'; 2 | import { gl } from './src/factor' 3 | import { $buildIn, $levels, $class } from './src/s3'; 4 | 5 | const l1 =gl(3,4, 16); 6 | const l2 = gl(3,4, 16, ['one', 'two', 'red', 'green']) 7 | console.log(l1) 8 | console.log(l2[$buildIn][$levels], l2[$buildIn][$class]) -------------------------------------------------------------------------------- /.nycrc: -------------------------------------------------------------------------------- 1 | { 2 | "check-coverage": false, 3 | "clean": true, 4 | "compact": true, 5 | "extension": [ 6 | ".ts", 7 | ".js" 8 | ], 9 | "include": [ 10 | "src/**/*.ts" 11 | ], 12 | "instrument": true, 13 | "preserve-comments": false, 14 | "reporter": [ 15 | "lcov", 16 | "text" 17 | ], 18 | "require": [ 19 | "ts-node/register" 20 | ], 21 | "show-process-tree": true, 22 | "sourceMap": true 23 | } -------------------------------------------------------------------------------- /src/logger.ts: -------------------------------------------------------------------------------- 1 | import * as debug from 'debug'; 2 | 3 | export function getLogger(name: string){ 4 | const printer = debug(name); 5 | return { 6 | warning: printer, 7 | error: printer, 8 | trace: printer, 9 | debug: printer, 10 | errorAndThrow(errorType: TypeErrorConstructor, msg, ...args){ 11 | this.error(msg, ...args); 12 | throw new errorType(msg); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | { 2 | "language": "node_js", 3 | "node_js": "node", 4 | "cache": { 5 | "directories": [ 6 | "node_modules" 7 | ] 8 | }, 9 | "before_install": [ 10 | "npm i -g npm@latest" 11 | ], 12 | "install": [ 13 | "npm install" 14 | ], 15 | "script": [ 16 | "npm run test" 17 | ], 18 | "after_success": [ 19 | "npm run codecov" 20 | ], 21 | "group": "stable", 22 | "dist": "trusty", 23 | "os": "linux" 24 | } -------------------------------------------------------------------------------- /spell.json: -------------------------------------------------------------------------------- 1 | { 2 | "mistakeTypeToStatus": { 3 | "Spelling": "Error", 4 | "Passive voice": "Hint", 5 | "Complex Expression": "Disable", 6 | "Hidden Verbs": "Information", 7 | "Hyphen Required": "Disable", 8 | "Redundant Expression": "Disable", 9 | "Did you mean...": "Disable", 10 | "Repeated Word": "Warning", 11 | "Missing apostrophe": "Warning", 12 | "Cliches": "Disable", 13 | "Missing Word": "Disable", 14 | "Make I uppercase": "Warning" 15 | }, 16 | "ignoreWordsList": [ 17 | "decl", 18 | "BLAS", 19 | "BLASjs" 20 | ] 21 | } -------------------------------------------------------------------------------- /src/checks.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { isArray } = Array; 4 | 5 | export function assertValidIdentifier(name: string) { 6 | if (!/[a-zA-Z]+[_$a-zA-Z0-9]*/.test(name)) 7 | throw new Error(`invalid identifier ${name}`); 8 | } 9 | export function assertNonEmptyString(value: string) { 10 | if (typeof value !== 'string') { 11 | throw new Error(`${value} not a string`) 12 | } 13 | if (!value.trim()) { 14 | throw new Error(`${value} cannot be empty string`) 15 | } 16 | } 17 | export function isDefined(value: any) { 18 | return !(value === null || value === undefined || value === '' || (isArray(value) && value.length === 0)); 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Prioritize a specific port of R functionality or extra added feature 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /na.md: -------------------------------------------------------------------------------- 1 | base::traceback _stack trace_ 2 | base::dynGet 3 | 4 | base::find.package 5 | base::autoloader _on demand loading of packages_ 6 | base::untracemem _trace copying of objects_ 7 | base::sys.call _functions to access the call stack_ 8 | base::attach _attach to search path for resultion of R source files_ 9 | base::tracingState _debug into a function_ 10 | base::getCallingDLL 11 | base::detach _detach objects from search path_ 12 | base::bindingIsActive _environment_ 13 | base::[.DLLInfoList 14 | base::srcref _reference to source files and code_ 15 | base::as.character.srcref _reference to source files and codes_ 16 | base::findRestart 17 | base::conflicts _find for conflicting names in the search path_ 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | * Steps to reproduce the behavior. 12 | * Please include the environment / route configuration you are using if you can (route, response type, headers, body, etc) 13 | 14 | **Expected behavior** 15 | * A clear and concise description of what you expected to happen. 16 | 17 | **Screenshots** 18 | If applicable, add screenshots to help explain your problem. 19 | 20 | **r-base version:** 21 | 1.0.0, 1.1.2, etc 22 | 23 | **OS / OS version:** 24 | Windows 10, Mac OS, Linux Ubuntu 18.xx, etc 25 | 26 | **Browser and version:** 27 | examples: 28 | * Chrome Version 69.0.3497.100 (Official Build) (64-bit) 29 | * Firefox 30 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | We're really glad you're reading this, because we need volunteer developers to help this project come to fruition. 👏 2 | 3 | ## Instructions 4 | 5 | These steps will guide you through contributing to this project: 6 | 7 | - Fork the repo 8 | - Clone it and install dependencies 9 | 10 | git clone https://github.com/YOUR-USERNAME/r-base 11 | npm install 12 | 13 | Keep in mind that after running `npm install` the git repo is reset. So a good way to cope with this is to have a copy of the folder to push the changes, and the other to try them. 14 | 15 | Make and commit your changes. Make sure the commands npm run build and npm run test:prod are working. 16 | 17 | Finally send a [GitHub Pull Request](https://github.com/jacobbogers/r-base/compare?expand=1) with a clear list of what you've done (read more [about pull requests](https://help.github.com/articles/about-pull-requests/)). Make sure all of your commits are atomic (one feature per commit). -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strictPropertyInitialization": false, 4 | "noImplicitAny": false, 5 | "noLib": false, 6 | "noUnusedLocals": true, 7 | "newLine": "LF", 8 | "noEmit": false, 9 | "listEmittedFiles": true, 10 | "declarationDir": "dist", 11 | "declaration": true, 12 | "removeComments": true, 13 | "allowUnreachableCode": true, 14 | "baseUrl": "./", 15 | "experimentalDecorators": true, 16 | "jsx": "react", 17 | "lib": [ 18 | "es2018", 19 | "dom", 20 | "esnext.asynciterable" 21 | ], 22 | "module": "commonjs", 23 | "target": "es5", 24 | "moduleResolution": "node", 25 | "outDir": "dist", 26 | "rootDir": "", 27 | "sourceMap": true, 28 | "strict": true 29 | }, 30 | "exclude": [ 31 | "node_modules" 32 | ], 33 | "include": [ 34 | "src/**/*.ts", 35 | "src/**/*.tsx" 36 | ] 37 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE 2 | .vscode 3 | .idea 4 | # project 5 | dist/ 6 | # Logs 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # Optional npm cache directory 48 | .npm 49 | 50 | # Optional eslint cache 51 | .eslintcache 52 | 53 | # Optional REPL history 54 | .node_repl_history 55 | 56 | # Output of 'npm pack' 57 | *.tgz 58 | 59 | # Yarn Integrity file 60 | .yarn-integrity 61 | 62 | # dotenv environment variables file 63 | .env 64 | 65 | # next.js build output 66 | .next 67 | -------------------------------------------------------------------------------- /src/list.ts: -------------------------------------------------------------------------------- 1 | import { getLogger } from './logger'; 2 | import { $class, $attr, $list, $listProps, Renhance, UseMethod, $buildIn, $default } from './s3'; 3 | import { asSymbol, extractSymbolName, duplicates } from './helpers'; 4 | 5 | // R - list are more like R objects 6 | // collection of arrays (if they are numeric use Float64ArrayIn) 7 | // for integers use Uint32Array or just numeric with Number.isInteger check on creation 8 | // different sections can have unequal length? -> yes 9 | 10 | const logger = getLogger('list') 11 | 12 | const list = UseMethod('list') 13 | 14 | list[$default] = function(args: object) { 15 | 16 | 17 | const col1 = Object.keys(args) // because an array would return 'length' if used with getOwnPropertyNames() 18 | const col2 = Object.getOwnPropertySymbols(args); 19 | const allProps = col1.concat(col2); 20 | 21 | // check of name does not exist as Symbol.for(name) elsewhere 22 | const dups = duplicates(allProps); 23 | if (dups.length){ 24 | const errMsg = 'Duplicate names found in "list" elements:'+dups.map(asSymbol).map(extractSymbolName).join(','); 25 | logger.errorAndThrow(TypeError, errMsg) 26 | } 27 | const robj = Renhance({}, $buildIn); 28 | const listprops = robj[$attr][$listProps] = new Map(); 29 | for (const key in allProps) { 30 | listprops.set(asSymbol(key), allProps[key]); 31 | } 32 | robj[$buildIn][$class] = [$list] //hidden class 33 | } 34 | 35 | export { list } 36 | 37 | 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Jacob Bogers", 3 | "bugs": { 4 | "url": "https://github.com/jacobbogers/r-base/issues" 5 | }, 6 | "dependencies": {}, 7 | "description": "Functions from the R-package \"base\"", 8 | "devDependencies": { 9 | "@types/chai": "^4.1.6", 10 | "@types/clone": "^0.1.30", 11 | "@types/debug": "0.0.31", 12 | "@types/mocha": "^5.2.5", 13 | "@types/node": "^10.12.0", 14 | "chai": "^4.2.0", 15 | "clean-webpack-plugin": "^0.1.19", 16 | "clone": "^2.1.2", 17 | "codecov": "^3.1.0", 18 | "cross-env": "^5.2.0", 19 | "debug": "^4.1.0", 20 | "istanbul": "^0.4.5", 21 | "jshint": "^2.9.6", 22 | "lodash.clonedeep": "^4.5.0", 23 | "lodash.defaults": "^4.2.0", 24 | "lodash.merge": "^4.6.1", 25 | "markdown-it": "^8.4.2", 26 | "markdown-it-katex": "^2.0.3", 27 | "mocha": "^5.2.0", 28 | "mocha-lcov-reporter": "^1.3.0", 29 | "nyc": "^13.1.0", 30 | "shx": "^0.3.2", 31 | "source-map-support": "^0.5.9", 32 | "sshpk": "^1.15.1", 33 | "ts-node": "^7.0.1", 34 | "tslint": "^5.11.0", 35 | "tslint-loader": "^3.5.4", 36 | "typescript": "^3.1.3", 37 | "uglifyjs-webpack-plugin": "^2.0.1", 38 | "webpack": "^4.20.2", 39 | "webpack-cli": "^3.1.2", 40 | "webpack-node-externals": "^1.7.2" 41 | }, 42 | "homepage": "https://github.com/jacobbogers/r-base#readme", 43 | "keywords": [ 44 | "R", 45 | "base", 46 | "statistics", 47 | "base.package" 48 | ], 49 | "license": "GPL3", 50 | "main": "dist/lib/r-base", 51 | "name": "r-base", 52 | "repository": { 53 | "type": "git", 54 | "url": "git+https://github.com/jacobbogers/r-base.git" 55 | }, 56 | "scripts": {}, 57 | "version": "1.0.0" 58 | } 59 | -------------------------------------------------------------------------------- /src/public.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { UseMethod, Rclass, /* $default, */ $ordered, $list, $df, $int, $string, $double, $logical, $jsArray } from "./s3"; 4 | import { multiplexer } from './helpers'; 5 | 6 | function seq_len(length: number, offset = 1) { 7 | return Array.from({ length }).map((_, i) => i + offset); 8 | } 9 | 10 | const repInt = UseMethod('rep$int') 11 | 12 | 13 | repInt[$list] = function () { throw new TypeError(`List is not implemented for ${this.name}`); } 14 | repInt[$df] = function () { throw new TypeError(`dataFrame is not implemented for ${this.name}`); } 15 | repInt[$int] = repInt[$string] = repInt[$logical] = repInt[$double] = function (x, times) { 16 | return Array.from({ length: times }).fill(x); 17 | } 18 | 19 | repInt[$jsArray] = Rcycle(repInt[$int]);/* function(x: any[], times){ 20 | if (typeof times !== 'number' || times <= 0) return []; 21 | const flattened = flatten(x); 22 | const length = flattened.length * times; 23 | const rc = Array.from({length}); 24 | for (let i = 0; i < times; i += flattened.length){ 25 | for (let j = 0; j < flattened.length; j++){ 26 | rc[i+j] = flattened[j] 27 | } 28 | } 29 | }*/ 30 | 31 | const rep_len = UseMethod('rep_len'); 32 | rep_len[$int] = rep_len[$string] = repInt[$logical] = repInt[$double] = function (x, times) { 33 | return Array.from({ length: times }).fill(x); 34 | } 35 | rep_len[$jsArray] = function (x: any, length: number) { 36 | let rc = x.slice() 37 | if (length === rc.length) { 38 | return rc; 39 | } 40 | if (length < rc.length) { 41 | rc.length = length 42 | return rc; 43 | } 44 | rc = Array.from({ length }); 45 | for (let i = 0; i < rc.length; i++) { 46 | rc[i] = x[i % x.length] 47 | } 48 | return rc; 49 | } 50 | 51 | 52 | function Rcycle(fn: (...rest: (any | any[])[]) => any) { 53 | return function (...rest: (any | any[])[]) { 54 | return multiplexer(...rest)(fn); 55 | }; 56 | } 57 | 58 | function isOrdered(x: any) { 59 | const classNames: symbol[] = Rclass(x); 60 | return classNames.includes($ordered) 61 | } 62 | 63 | 64 | export { repInt, rep_len, seq_len, Rcycle, isOrdered } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "arrow-parens": false, 4 | "class-name": true, 5 | "eofline": true, 6 | "indent": [ 7 | true, 8 | "spaces" 9 | ], 10 | "linebreak-style": [ 11 | false, 12 | "LF" 13 | ], 14 | "new-parens": true, 15 | "no-construct": true, 16 | "no-unused-variable": true, 17 | "no-use-before-declare": true, 18 | "no-var-keyword": true, 19 | "object-literal-key-quotes": false, 20 | "one-variable-per-declaration": false, 21 | "ordered-imports": [ 22 | true, 23 | { 24 | "import-sources-order": "case-insensitive", 25 | "named-imports-order": "case-insensitive" 26 | } 27 | ], 28 | "quotemark": [ 29 | false 30 | ], 31 | "semicolon": [ 32 | false, 33 | "always" 34 | ], 35 | "space-before-function-paren": [ 36 | true, 37 | { 38 | "anonymous": "never", 39 | "asyncArrow": "always", 40 | "constructor": "never", 41 | "method": "never", 42 | "named": "never" 43 | } 44 | ], 45 | "switch-default": true, 46 | "triple-equals": [ 47 | true, 48 | "allow-null-check" 49 | ], 50 | "typedef-whitespace": [ 51 | true, 52 | { 53 | "call-signature": "nospace", 54 | "index-signature": "nospace", 55 | "parameter": "nospace", 56 | "property-declaration": "nospace", 57 | "variable-declaration": "nospace" 58 | }, 59 | { 60 | "call-signature": "onespace", 61 | "index-signature": "onespace", 62 | "parameter": "onespace", 63 | "property-declaration": "onespace", 64 | "variable-declaration": "onespace" 65 | } 66 | ], 67 | "variable-name": [ 68 | false, 69 | "check-format", 70 | "allow-leading-underscore", 71 | "allow-pascal-case" 72 | ], 73 | "whitespace": [ 74 | true, 75 | "check-branch", 76 | "check-decl", 77 | "check-operator", 78 | "check-separator", 79 | "check-module" 80 | ] 81 | } 82 | } -------------------------------------------------------------------------------- /system.md: -------------------------------------------------------------------------------- 1 | ### to work with R source file, not applicable 2 | ```R 3 | base::makeActiveBinding 4 | base::print.srcfile 5 | base::condition 6 | base::conditionMessage.condition 7 | # The condition system 8 | # 9 | # tryCatch(expr, ..., finally) 10 | # withCallingHandlers(expr, ...) 11 | # signalCondition(cond) 12 | # simpleCondition(message, call = NULL) 13 | # simpleError (message, call = NULL) 14 | # simpleWarning (message, call = NULL) 15 | # simpleMessage (message, call = NULL) 16 | base::isRestart 17 | base::simpleError 18 | base::warnings 19 | base::close.srcfile 20 | base::debug 21 | base::commandArgs 22 | base::print.libraryIQR 23 | base::getDLLRegisteredRoutines 24 | base::print.packageInfo 25 | base::c.warnings 26 | base::[.warnings 27 | base::getNamespaceUsers 28 | base::env.profile 29 | base::last.warning 30 | base::loadedNamespaces 31 | base::setTimeLimit 32 | base::getHook 33 | base::print.restart 34 | base::system.time 35 | base::pos.to.env 36 | base::signalCondition 37 | base::require 38 | base::library.dynam 39 | base::unique.warnings 40 | base::rm #remove identifier from environment 41 | base::retracemem #marks an object if any function "copies" it 42 | base::sys.parents #access function call-stack 43 | base::sys.parent 44 | base::format.libraryIQR #loading attaching listing of packages 45 | base::getLoadedDLLs #get dll's loaded in current session 46 | base::[.Dlist 47 | base::standardGeneric #S4 methods 48 | base::dyn.unload 49 | base::Sys.unsetenv 50 | base::tracemem 51 | base::Sys.which 52 | base::format.packageInfo 53 | base::callCC 54 | base::trace 55 | base::suspendInterrupts 56 | base::print.NativeRoutineList 57 | base::print.DLLRegisteredRoutines 58 | base::allowInterrupts 59 | base::icuGetCollate 60 | base::getNamespaceExports 61 | base::invokeRestartInteractively 62 | base::libcurlVersion 63 | base::system 64 | base::print.DLLInfoList 65 | base::Sys.setenv 66 | base::untrace 67 | base::taskCallbackManager 68 | base::sys.frames 69 | base::namespaceImportFrom 70 | base::searchpaths 71 | base::loadNamespace 72 | base::getDLLRegisteredRoutines.DLLInfo 73 | base::on.exit 74 | base::Sys.getpid 75 | base::requireNamespace 76 | base::getExportedValue 77 | base::system2 78 | base::autoload 79 | base::namespaceImportMethods 80 | base::sys.on.exit 81 | base::setNamespaceInfo 82 | base::La_library # lapack library? 83 | base::attachNamespace 84 | base::addTaskCallback 85 | base::gcinfo 86 | base::gc.time 87 | base::sys.status 88 | base::sys.nframe 89 | base::[.noquote 90 | base::getTaskCallbackNames 91 | base::importIntoEnv 92 | base::namespaceImportClasses 93 | base::[.listof 94 | base::debugonce 95 | base::isNamespaceLoaded 96 | base::returnValue 97 | base::isBaseNamespace 98 | base::isS4 99 | base::isdebugged 100 | base::reg.finalizer 101 | base::missing 102 | base::gctorture 103 | base::namespaceExport 104 | base::parseNamespaceFile 105 | base::::: 106 | base::lockEnvironment 107 | base::globalenv 108 | base::list2env 109 | base::is.environment 110 | base::repeat 111 | base::topenv 112 | base::debug 113 | base::proc.time 114 | base::path.package 115 | base::library 116 | base::chkDots 117 | base::dyn.load 118 | base::sys.calls 119 | base::match.call 120 | base::print.DLLInfo 121 | base::sys.function 122 | base::unloadNamespace 123 | base::stop 124 | base::Cstack_info 125 | base::print.proc_time 126 | base::is.loaded 127 | base::undebug 128 | base::$.DLLInfo 129 | base::gctorture2 130 | base::getDLLRegisteredRoutines.character 131 | base::withAutoprint ## unknown 132 | base::bindingIsLocked 133 | base::suppressPackageStartupMessages #diagnostic 134 | base::loadingNamespaceInfo 135 | base::formals 136 | base::is.language 137 | base::print.srcref 138 | base::library.dynam.unload 139 | base::withRestarts 140 | base::is.call 141 | base::getNamespaceVersion 142 | base::remove # environment 143 | base::getNamespace 144 | ``` -------------------------------------------------------------------------------- /src/factor.ts: -------------------------------------------------------------------------------- 1 | import { promoteArray, flatten, unique, multiplexer } from './helpers'; 2 | import { rep_len, seq_len, repInt, isOrdered } from './public'; 3 | import { FactorType } from './types'; 4 | import { getLogger } from './logger'; 5 | import { Renhance, $jsArray, $class, $fact, $levels, $buildIn, UseMethod, $ordered } from './s3'; 6 | 7 | const _factor = UseMethod('factor'); 8 | const logger = getLogger('factor'); 9 | 10 | _factor[$fact] = function (x: any, levels: string[], labels = levels, exclude: any[] = [], ordered = isOrdered(x)) { 11 | throw new Error(`factor.factor not implemented yet`); 12 | } 13 | 14 | _factor[$jsArray] = function factorDefault(x: FactorType[], levels: FactorType[] = [], labels = levels, exclude: any[] = [], ordered = false, nmax?: number) { 15 | // 16 | // promotion rules 17 | // 18 | const flatX = flatten(x.slice(0)); 19 | const { promoted, type } = promoteArray(flatX); 20 | const promoCode = { string: String, number: Number, boolean: Boolean }[type] || String; 21 | const flatExc = flatten(exclude).map(v => promoCode(v)) 22 | const flatLev = unique(flatten(levels).map(v => promoCode(v))) 23 | 24 | if (flatExc.length || flatLev.length) { 25 | for (let i = 0; i < promoted.length; i++) { 26 | const pi = promoted[i] 27 | promoted[i] = exclude.includes(pi) ? null : pi 28 | promoted[i] = flatLev.length && flatLev.includes(promoted[i]) ? promoted[i] : null 29 | } 30 | } 31 | 32 | const _levels = promoted.filter((v, i, arr) => v !== null && !arr.includes(v, i + 1)); 33 | const flatLab = (labels !== levels) ? unique(flatten(labels)) : []; 34 | 35 | if (flatLab.length && flatLab.length < _levels.length) { 36 | logger.errorAndThrow(Error, `invalid labels; length ${labels.length} should be 1 or ${_levels.length}`) 37 | } 38 | 39 | // optional reformatting of data 40 | // 41 | if (flatLab.length) { 42 | //construct mapper 43 | const mapper1 = multiplexer(flatLab, _levels) 44 | ((lab, lev) => ({ lv:lev, la: lab})) 45 | const mapper2 = mapper1 46 | .reduce((coll: { [index: string]: any }, v) => { 47 | coll[v.lv] = v.la; 48 | return coll; 49 | }, {} as { [index: string]: any }); 50 | 51 | for (let i = 0; i < promoted.length; i++) { 52 | const pi = mapper2[promoted[i]] 53 | promoted[i] = pi; 54 | } 55 | } 56 | 57 | const obj = Renhance(promoted, $buildIn); 58 | obj[$buildIn][$levels] = flatLab.length ? flatLab : _levels 59 | obj[$buildIn][$class] = ordered ? [$ordered, $fact] : [$fact] 60 | 61 | return obj; 62 | } 63 | 64 | export function gl(n: number, k: number, length: number = n * k, labels:FactorType[] = seq_len(n), ordered = false) { 65 | const data = rep_len(repInt(seq_len(n), repInt(k, n)), length) 66 | const fac = _factor(data, undefined, labels, undefined, ordered) 67 | return fac; 68 | } 69 | 70 | /* 71 | ### factors 72 | ### levels 73 | ```R 74 | xx base::gl #Generate factors by specifying the pattern of their levels._ 75 | base::Ops.ordered 76 | base::addNA 77 | base::[<-.factor 78 | base::[[<-.factor 79 | base::as.character.factor 80 | base::[.factor 81 | base::as.factor 82 | base::cut 83 | base::[[.factor 84 | base::Summary.factor 85 | base::droplevels.factor 86 | base::is.factor 87 | base::levels<-.factor 88 | base::Math.factor #not meaningfull for factors, this is a "trap" 89 | 90 | base::cut.default 91 | base::is.na<-.factor 92 | base::ordered 93 | base::all.equal.factor 94 | base::levels 95 | xx base::is.ordered 96 | base::levels.default 97 | xx base::factor 98 | base::nlevels 99 | base::Summary.ordered 100 | base::as.ordered 101 | base::levels<- 102 | base::summary.factor 103 | base::length<-.factor 104 | base::Ops.factor 105 | base::xtfrm.factor #aux function for sorting and ranking 106 | base::format.factor 107 | base::print.factor 108 | ``` 109 | */ 110 | -------------------------------------------------------------------------------- /src/helpers.ts: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import { FactorType, TYPESASSTRINGS } from './types'; 4 | 5 | const { max } = Math; 6 | 7 | export function asSymbol(val: string | symbol | number): symbol { 8 | const rc = typeof val === 'string' ? Symbol.for(val) : typeof val === 'symbol' ? val : undefined; 9 | if (rc === undefined) { 10 | throw new TypeError(`${String(val)} is not of type "string" or "symbol"`) 11 | } 12 | return rc; 13 | } 14 | 15 | export function extractSymbolName(s: symbol | string): string { 16 | const match = s.toString().match(/^Symbol\(([^()]+)\)$/) 17 | if (match === null) throw new Error(`argument "s" is not a symbol: ${String(s)}`) 18 | return match[1] 19 | } 20 | 21 | export function isEqualPropKey(a: PropertyKey, b: PropertyKey) { 22 | // promotion rules 23 | if (typeof a === 'symbol' && typeof b === 'symbol') return a == b; 24 | if (typeof a === 'symbol' && typeof b !== 'symbol') return a == Symbol.for(String(b)); 25 | if (typeof a !== 'symbol' && typeof b === 'symbol') return Symbol.for(String(a)) === b; 26 | /*if (typeof a !== 'symbol' && typeof b !== 'symbol' ) */ 27 | return String(a) === String(b) 28 | } 29 | 30 | export function indexOf(value: PropertyKey, start: number, arr: PropertyKey[]): number { 31 | for (let i = start; i < arr.length; i++) { 32 | if (isEqualPropKey(arr[i], value)) return i; 33 | } 34 | return -1 35 | } 36 | 37 | function _typeOf(v: any): TYPESASSTRINGS { 38 | if (v === null) return 'null'; 39 | if (v instanceof Array) return 'array'; 40 | if (v instanceof Function) return 'function'; 41 | const k = typeof v; 42 | return k; 43 | } 44 | 45 | function createPromotor() { 46 | 47 | let finalpromo = 'boolean'; 48 | 49 | function find(v, i, arr) { 50 | const _type = _typeOf(v); 51 | if (_type === 'string') { 52 | finalpromo = 'string' 53 | return true; 54 | } 55 | if (_type === 'number') { 56 | finalpromo = 'number' 57 | } 58 | if (_type === 'boolean' && finalpromo !== 'number') { 59 | finalpromo = 'boolean' 60 | } 61 | if (_type === 'function') { 62 | return find(v(), i, arr) 63 | } 64 | return false; 65 | } 66 | 67 | return { 68 | find, 69 | code: () => finalpromo 70 | } 71 | } 72 | 73 | export function lowerCaseIfString(v) { 74 | if (typeof v === 'string') { 75 | return v.toLowerCase() 76 | } 77 | return v; 78 | } 79 | 80 | export function isType(s: any, ...tests: TYPESASSTRINGS[]) { 81 | return tests.indexOf(typeof s) >= 0 82 | } 83 | 84 | export function exclude(arr: any[], exclusionList: (string | symbol)[]): any[] { 85 | return arr.filter(v => { 86 | for (const entry of exclusionList) { 87 | if (entry == v) { 88 | return false 89 | } 90 | } 91 | return true 92 | }) 93 | } 94 | 95 | export function duplicates(input: any[]): any[] { 96 | return input.filter((f, i, arr) => indexOf(f, i + 1, arr) >= 0); 97 | } 98 | 99 | export function unique(input: any[]): any[] { 100 | return input.filter((f, i, arr) => indexOf(f, i + 1, arr) === -1); 101 | } 102 | 103 | export function promote(...args: FactorType[]) { 104 | return promoteArray(args); 105 | } 106 | 107 | export function promoteArray(n: FactorType[]) { 108 | const promotor = createPromotor(); 109 | n.find(promotor.find); 110 | const op = promotor.code() === 'string' ? String : promotor.code() === 'number' ? Number : Boolean; 111 | const rc = n.slice(); 112 | for (let i = 0; i < n.length; i++) { 113 | const p = n[i]; 114 | const _type = typeof p; 115 | if (['symbol', 'undefined', 'object'].includes(_type)) { 116 | rc[i] = null 117 | continue; 118 | } 119 | // use typeof because of tslint 120 | if (typeof p === 'function') { 121 | let fn = (p) => { 122 | const an = p() 123 | if (typeof an === 'function') { 124 | return fn(an) 125 | } 126 | return an; 127 | } 128 | rc[i] = op(fn(p)); 129 | continue; 130 | } 131 | rc[i] = op(p); 132 | } 133 | return { promoted: rc, type: promotor.code() }; 134 | } 135 | 136 | export function flatten(...rest: (T | T[])[]): T[] { 137 | let rc: T[] = []; 138 | for (const itm of rest) { 139 | if (Array.isArray(itm)) { 140 | let rc2: T[] = flatten(...itm); 141 | rc.push(...rc2); 142 | continue; 143 | } 144 | rc.push(itm); 145 | } 146 | return rc as any; 147 | } 148 | 149 | export type system = boolean | number | undefined | string | null | symbol; 150 | 151 | export function multiplexer(...rest: (system | system)[]) { 152 | // 153 | // Analyze 154 | // 155 | const analyzed: _t[] = []; 156 | type _t = boolean[] | number[] | undefined[] | string[] | null[] | symbol[] | Array; 157 | 158 | const select = { 159 | ['undefined'](v: null) { analyzed.push([v]); }, 160 | ['null'](v: null) { analyzed.push([v]); }, 161 | ['string'](v: string) { analyzed.push(v.split('')) }, 162 | ['boolean'](v: boolean) { analyzed.push([v]) }, 163 | ['array'](v: _t) { analyzed.push(v) }, 164 | ['object'](v: _t) { throw new Error('Sorry, looping over properties not yet supported'); }, 165 | ['function'](v: _t) { throw new Error('Sorry function arguments are not yet supported'); } 166 | }; 167 | 168 | for (let k = 0; k < rest.length; k++) { 169 | const arg = rest[k]; 170 | const to = _typeOf(arg); 171 | const selector = select[to]; 172 | selector(arg); 173 | }//for 174 | // find the longest array 175 | const _max = max(...analyzed.map(a => a.length)); 176 | return function (fn: (...rest: system[]) => any): any[] { 177 | const rc: any[] = []; 178 | 179 | for (let k = 0; k < _max; k++) { 180 | const result: any[] = []; 181 | for (let j = 0; j < analyzed.length; j++) { 182 | const arr: any[] = analyzed[j]; 183 | const idx = k % arr.length; 184 | result.push(arr[idx]); 185 | } 186 | rc.push(fn(...result)); 187 | } 188 | return flatten(rc); 189 | }; 190 | } 191 | 192 | 193 | -------------------------------------------------------------------------------- /src/s3.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { assertNonEmptyString, assertValidIdentifier, isDefined } from './checks'; 4 | import { getLogger } from './logger'; 5 | import { asSymbol, extractSymbolName, isType, exclude, lowerCaseIfString, unique } from './helpers'; 6 | 7 | 8 | const { isArray } = Array; 9 | const { abs, trunc } = Math; 10 | const { EPSILON } = Number; 11 | const s3logger = getLogger('s3router'); 12 | const elogger = getLogger('Renhance'); 13 | 14 | // instrumentation 15 | 16 | const $buildIn = Symbol.for('buildins'); 17 | const $hiddenAttr = Symbol.for('hiddenAttributes'); 18 | const $s3 = Symbol.for('s3System'); 19 | const $attr = Symbol.for('attributes'); 20 | const $default = Symbol.for('S3-default'); 21 | const $class = Symbol.for('s3class'); 22 | 23 | 24 | export{ $buildIn, $hiddenAttr, $s3, $attr, $default, $class }; 25 | 26 | 27 | //classes 28 | export const $matrix = Symbol.for('matrix'); 29 | export const $arr = Symbol.for('array'); 30 | export const $df = Symbol.for('data.frame'); 31 | export const $num_version = Symbol.for('numeric_version'); 32 | export const $pack_vers = Symbol.for('package_version'); 33 | export const $POSIXlt = Symbol.for('POSIXlt'); 34 | export const $POSIXct = Symbol.for('POSIXct'); 35 | export const $POSIXt = Symbol.for('POSIXt'); 36 | export const $numeric = Symbol.for('numeric'); 37 | export const $fs = Symbol.for('file'); 38 | export const $difftime = Symbol.for('difftime'); 39 | export const $vector = Symbol.for('vector'); 40 | export const $list = Symbol.for('list'); 41 | export const $raw = Symbol.for('raw'); 42 | export const $AsIs = Symbol.for('AsIs'); 43 | export const $fact = Symbol.for('factor'); 44 | export const $cmplx = Symbol.for('complex'); 45 | export const $lan = Symbol.for('language'); 46 | export const $levels = Symbol.for('levels'); 47 | export const $ordered = Symbol.for('ordered'); 48 | export const $NA = Symbol.for('NA'); 49 | 50 | 51 | export const $ts = Symbol.for('ts'); 52 | export const $listProps = Symbol.for('ts'); 53 | export const $noq = Symbol.for('noquote'); 54 | export const $env = Symbol.for('environment'); 55 | export const $form = Symbol.for('formula'); 56 | export const $qr = Symbol.for('qr'); 57 | export const $lm = Symbol.for('lm'); 58 | export const $err = Symbol.for('error'); 59 | export const $glm = Symbol.for('glm'); 60 | 61 | //TODO: remap JS types to these 62 | export const $logical = Symbol.for('logical'); 63 | export const $jsDate = Symbol.for('jsDate'); 64 | export const $double = Symbol.for('double') 65 | export const $int = Symbol.for('integer'); 66 | export const $string = Symbol.for('character'); 67 | export const $undefined = Symbol.for('undefined'); 68 | export const $jsArray = Symbol.for('$jsArray'); 69 | 70 | export const blessed = [$list, $matrix, $arr, $fact]; 71 | 72 | //from specific -> general 73 | export const hierarchy = { 74 | [$matrix]: $arr, // a matrix is also an array 75 | [$df]: $list, // a dataframe is a list 76 | [$POSIXct]: $POSIXt, 77 | [$POSIXlt]: $POSIXt 78 | } 79 | 80 | export const mimicIfNotExist = [ 81 | $buildIn, $hiddenAttr, 82 | ]; 83 | 84 | /*functions: 85 | isR 86 | assertR 87 | Renhance 88 | UseMethod 89 | getClass 90 | */ 91 | 92 | export function isR(obj) { 93 | // was the JS object R-enhanced? 94 | // its on the object but "has" returns false 95 | return obj && !(obj[$attr] == undefined) && !($attr in obj) 96 | } 97 | 98 | export function assertR(obj) { 99 | if (!isR(obj)) { 100 | throw new TypeError(`object is not an R object`) 101 | } 102 | } 103 | 104 | 105 | function createAttribProxy() { 106 | return new Proxy(new Map(), { 107 | get(o, propName: PropertyKey) { 108 | const key = asSymbol(propName); 109 | const found = o.get(key); 110 | return found || []; 111 | }, 112 | set(o, propName: PropertyKey, propValue: Function | string, originalObj) { 113 | const key = asSymbol(propName); 114 | if (isDefined(propValue)) { 115 | if (isArray(propValue)) { 116 | o.set(key, propValue); 117 | } 118 | else { 119 | o.set(key, [propValue]); 120 | } 121 | return true; 122 | } 123 | elogger.warning('will delete:' + String(propName)) 124 | o.delete(key); 125 | return true; 126 | }, 127 | getPrototypeOf(o) { 128 | return null; 129 | }, 130 | setPrototypeOf(o, prototype) { 131 | return false; 132 | }, 133 | isExtensible(o) { 134 | return false; 135 | }, 136 | preventExtensions(o) { 137 | return false; // didnt succeed ot make unextendable 138 | }, 139 | getOwnPropertyDescriptor(o, prop) { 140 | return undefined; 141 | }, 142 | defineProperty(o, prop, descr) { 143 | return false; 144 | }, 145 | has(o, propName: PropertyKey) { 146 | const key = asSymbol(propName); 147 | const found = o.has(key); 148 | return found; 149 | }, 150 | deleteProperty(o, propName: PropertyKey) { 151 | const key = asSymbol(propName); 152 | return o.delete(key); 153 | }, 154 | ownKeys(o) { 155 | return Array.from(o.keys()); 156 | }, 157 | apply(o, thisArg, argumentList) { 158 | throw new TypeError('not a function'); 159 | }, 160 | construct(o, argumentList, newTarget) { 161 | throw new TypeError('this is not a class function'); 162 | } 163 | }) 164 | } 165 | 166 | export function Renhance(obj, ...roots: any[]) { 167 | /* attribute virtual handler is here */ 168 | /** 169 | * Clean up roots, if $attr or "attr" or "$attr" is there remove it 170 | */ 171 | const f1 = roots.filter(r => isDefined(r) || isType(r, 'string', 'symbol')).map(lowerCaseIfString) 172 | if (f1.length !== roots.length) { 173 | const errMsg = `roots must be either symbols or strings`; 174 | elogger.error(errMsg); 175 | throw new TypeError(errMsg); 176 | } 177 | 178 | const f2 = [/* always here */$attr, ...exclude(f1, ['$attr', 'attr', $attr, Symbol.for('attr')]).map(asSymbol)]; 179 | const _roots = new Map(); 180 | f2.forEach(v => _roots.set(v, createAttribProxy())); 181 | 182 | return new Proxy(obj, { 183 | get(o, propName: PropertyKey) { 184 | const symbol = asSymbol(propName); 185 | // intercept if the symbol is in root 186 | const found = _roots.get(symbol); 187 | if (found) { 188 | return found 189 | } 190 | // predefined symbol? 191 | return o[propName]; 192 | }, 193 | set(o, propName: PropertyKey, value, receiver) { 194 | const symbol = asSymbol(propName); 195 | const found = _roots.get(symbol) 196 | if (found) { 197 | return true; 198 | } 199 | o[propName] = value; 200 | return true; 201 | }, 202 | has(o, propName: PropertyKey) { 203 | const symbol = asSymbol(propName); 204 | const found = _roots.get(symbol) 205 | if (found) { 206 | return false 207 | } 208 | return propName in o; 209 | }, 210 | }); 211 | } 212 | 213 | export function getExtendedType(arg: any) { 214 | const otype = typeof arg 215 | switch (otype) { 216 | case 'number': 217 | if (abs(trunc(arg) - arg) < EPSILON) return $int; 218 | return $double; 219 | case 'string': 220 | return $string; 221 | case 'boolean': 222 | return $logical; 223 | case 'undefined': 224 | return $undefined; 225 | default: 226 | if (arg instanceof Array) return $jsArray; 227 | if (arg instanceof Date) return $jsDate; 228 | } 229 | } 230 | 231 | export const UseMethod = (methodName: string) => { 232 | assertNonEmptyString(methodName) 233 | assertValidIdentifier(methodName); 234 | const fns = new Map() 235 | 236 | var fnStub = Function(` 237 | const fn = function ${methodName}() { /* S3 generic function */}; 238 | return fn; 239 | `)(); 240 | 241 | const s3MethodRouter = { 242 | //hidden 243 | _processNonRArguments(o, argumentList) { 244 | const first = argumentList[0]; 245 | const lookupKey = getExtendedType(first); 246 | const fn = fns.get(lookupKey) || fns.get($default) 247 | if (!fn) { 248 | s3logger.errorAndThrow(Error, `No handler for: ${extractSymbolName(lookupKey || $default)} `) 249 | } 250 | return fn.apply(o, argumentList.slice()); 251 | }, 252 | //traps 253 | get(o, propName: PropertyKey) { 254 | switch (propName) { 255 | case 'toString': 256 | return o[propName].bind(o); 257 | case Symbol.toPrimitive: 258 | return o[propName]; 259 | case 'valueOf': 260 | return o[propName] //o[propName]; 261 | default: 262 | break; 263 | } 264 | const symbol = asSymbol(propName); 265 | let fn = fns.get(symbol); 266 | if (fn === undefined) { 267 | fn = fns.get($default); 268 | if (fn === undefined) { 269 | throw new TypeError(`class ${String(propName)} has no handler`) 270 | } 271 | } 272 | return fn; 273 | }, 274 | // 275 | set(o, propName: PropertyKey, propValue: Function | string, originalObj) { 276 | const symbol = asSymbol(propName); 277 | if (propValue === null || propValue === undefined || propValue === '') { 278 | fns.delete(symbol) 279 | return true 280 | } 281 | fns.set(symbol, propValue) 282 | return true; 283 | }, 284 | // actual routing is here 285 | apply(o, thisArg, argumentList) { 286 | const obj = argumentList[0]; 287 | if (!isR(obj)) { 288 | return this._processNonRArguments(o, argumentList); 289 | } 290 | const s3Classes = Rclass(obj); 291 | if (!s3Classes.length) { 292 | s3logger.errorAndThrow(Error, `It is an R object but with no classes defined [ ${String(obj)} ]`) 293 | } 294 | for (const s3Class of s3Classes) { 295 | const method = fns.get(s3Class) 296 | if (method) { 297 | return method.apply(o, argumentList.slice()) 298 | } 299 | } 300 | // 301 | // try default 302 | // 303 | const _default = fns.get($default); 304 | if (!_default) { 305 | const allClassNames = s3Classes.map(extractSymbolName).join(','); 306 | const errMsg = `No default defined for function: [${o.name}] for s3 classes: ${allClassNames}` 307 | s3logger.errorAndThrow(Error, errMsg) 308 | } 309 | return _default.apply(o, argumentList.slice()); 310 | } 311 | } // router end 312 | return new Proxy(fnStub, s3MethodRouter); 313 | } 314 | 315 | export const names = UseMethod('names'); 316 | export const labels = UseMethod('labels'); 317 | export const Rclass = UseMethod('Rclass'); 318 | export const attributes = UseMethod('attributes') 319 | export const print = UseMethod('print') 320 | 321 | Rclass[$default] = function (obj) { 322 | if (isR(obj)) { 323 | const explicit = obj[$attr][$class] 324 | const buildin = obj[$buildIn][$class] 325 | return unique([...explicit, ...buildin]); 326 | } 327 | } 328 | 329 | 330 | 331 | -------------------------------------------------------------------------------- /r-base-list.txt: -------------------------------------------------------------------------------- 1 | "-", 2 | "-.Date", 3 | "-.POSIXt", 4 | "!", 5 | "!.hexmode", 6 | "!.octmode", 7 | "!=", 8 | "$", 9 | "$.data.frame", "$.DLLInfo", "$.package_version", "$<-", 10 | "$<-.data.frame", "%%", "%*%", "%/%", "%in%", "%o%", "%x%", "&", 11 | "&&", "&.hexmode", "&.octmode", "(", "*", "*.difftime", "/", 12 | "/.difftime", ":", "::", ":::", "@", "@<-", "[", "[.AsIs", "[.data.frame", 13 | "[.Date", "[.difftime", "[.Dlist", "[.factor", "[.hexmode", "[.listof", 14 | "[.noquote", "[.numeric_version", "[.octmode", "[.POSIXct", "[.POSIXlt", 15 | "[.simple.list", "[.table", "[.warnings", "[[", "[[.data.frame", 16 | "[[.Date", "[[.factor", "[[.numeric_version", "[[.POSIXct", "[[<-", 17 | "[[<-.data.frame", "[[<-.factor", "[[<-.numeric_version", "[<-", 18 | "[<-.data.frame", "[<-.Date", "[<-.factor", "[<-.numeric_version", 19 | "[<-.POSIXct", "[<-.POSIXlt", "^", "{", "|", "|.hexmode", "|.octmode", 20 | "||", "~", "+", "+.Date", "+.POSIXt", "<", "<-", "<<-", "<=", 21 | "=", "==", ">", ">=", "abbreviate", "abs", "acos", "acosh", "addNA", 22 | "addTaskCallback", "agrep", "agrepl", "alist", "all", "all.equal", 23 | "all.equal.character", "all.equal.default", "all.equal.environment", 24 | "all.equal.envRefClass", "all.equal.factor", "all.equal.formula", 25 | "all.equal.language", "all.equal.list", "all.equal.numeric", 26 | "all.equal.POSIXt", "all.equal.raw", "all.names", "all.vars", 27 | "any", "anyDuplicated", "anyDuplicated.array", "anyDuplicated.data.frame", 28 | "anyDuplicated.default", "anyDuplicated.matrix", "anyNA", "anyNA.numeric_version", 29 | "anyNA.POSIXlt", "aperm", "aperm.default", "aperm.table", "append", 30 | "apply", "Arg", "args", "array", "arrayInd", "as.array", "as.array.default", 31 | "as.call", "as.character", "as.character.condition", "as.character.Date", 32 | "as.character.default", "as.character.error", "as.character.factor", 33 | "as.character.hexmode", "as.character.numeric_version", "as.character.octmode", 34 | "as.character.POSIXt", "as.character.srcref", "as.complex", "as.data.frame", 35 | "as.data.frame.array", "as.data.frame.AsIs", "as.data.frame.character", 36 | "as.data.frame.complex", "as.data.frame.data.frame", "as.data.frame.Date", 37 | "as.data.frame.default", "as.data.frame.difftime", "as.data.frame.factor", 38 | "as.data.frame.integer", "as.data.frame.list", "as.data.frame.logical", 39 | "as.data.frame.matrix", "as.data.frame.model.matrix", "as.data.frame.noquote", 40 | "as.data.frame.numeric", "as.data.frame.numeric_version", "as.data.frame.ordered", 41 | "as.data.frame.POSIXct", "as.data.frame.POSIXlt", "as.data.frame.raw", 42 | "as.data.frame.table", "as.data.frame.ts", "as.data.frame.vector", 43 | "as.Date", "as.Date.character", "as.Date.date", "as.Date.dates", 44 | "as.Date.default", "as.Date.factor", "as.Date.numeric", "as.Date.POSIXct", 45 | "as.Date.POSIXlt", "as.difftime", "as.double", "as.double.difftime", 46 | "as.double.POSIXlt", "as.environment", "as.expression", "as.expression.default", 47 | "as.factor", "as.function", "as.function.default", "as.hexmode", 48 | "as.integer", "as.list", "as.list.data.frame", "as.list.Date", 49 | "as.list.default", "as.list.environment", "as.list.factor", "as.list.function", 50 | "as.list.numeric_version", "as.list.POSIXct", "as.logical", "as.logical.factor", 51 | "as.matrix", "as.matrix.data.frame", "as.matrix.default", "as.matrix.noquote", 52 | "as.matrix.POSIXlt", "as.name", "as.null", "as.null.default", 53 | "as.numeric", "as.numeric_version", "as.octmode", "as.ordered", 54 | "as.package_version", "as.pairlist", "as.POSIXct", "as.POSIXct.date", 55 | "as.POSIXct.Date", "as.POSIXct.dates", "as.POSIXct.default", 56 | "as.POSIXct.numeric", "as.POSIXct.POSIXlt", "as.POSIXlt", "as.POSIXlt.character", 57 | "as.POSIXlt.date", "as.POSIXlt.Date", "as.POSIXlt.dates", "as.POSIXlt.default", 58 | "as.POSIXlt.factor", "as.POSIXlt.numeric", "as.POSIXlt.POSIXct", 59 | "as.qr", "as.raw", "as.single", "as.single.default", "as.symbol", 60 | "as.table", "as.table.default", "as.vector", "as.vector.factor", 61 | "asin", "asinh", "asNamespace", "asS3", "asS4", "assign", "atan", 62 | "atan2", "atanh", "attach", "attachNamespace", "attr", "attr.all.equal", 63 | "attr<-", "attributes", "attributes<-", "autoload", "autoloader", 64 | "backsolve", "baseenv", "basename", "besselI", "besselJ", "besselK", 65 | "besselY", "beta", "bindingIsActive", "bindingIsLocked", "bindtextdomain", 66 | "bitwAnd", "bitwNot", "bitwOr", "bitwShiftL", "bitwShiftR", "bitwXor", 67 | "body", "body<-", "bquote", "break", "browser", "browserCondition", 68 | "browserSetDebug", "browserText", "builtins", "by", "by.data.frame", 69 | "by.default", "bzfile", "c", "c.Date", "c.difftime", "c.noquote", 70 | "c.numeric_version", "c.POSIXct", "c.POSIXlt", "c.warnings", 71 | "call", "callCC", "capabilities", "casefold", "cat", "cbind", 72 | "cbind.data.frame", "ceiling", "char.expand", "character", "charmatch", 73 | "charToRaw", "chartr", "check_tzones", "chkDots", "chol", "chol.default", 74 | "chol2inv", "choose", "class", "class<-", "clearPushBack", "close", 75 | "close.connection", "close.srcfile", "close.srcfilealias", "closeAllConnections", 76 | "col", "colMeans", "colnames", "colnames<-", "colSums", "commandArgs", 77 | "comment", "comment<-", "complex", "computeRestarts", "conditionCall", 78 | "conditionCall.condition", "conditionMessage", "conditionMessage.condition", 79 | "conflicts", "Conj", "contributors", "cos", "cosh", "cospi", 80 | "crossprod", "Cstack_info", "cummax", "cummin", "cumprod", "cumsum", 81 | "curlGetHeaders", "cut", "cut.Date", "cut.default", "cut.POSIXt", 82 | "data.class", "data.frame", "data.matrix", "date", "debug", "debuggingState", 83 | "debugonce", "default.stringsAsFactors", "delayedAssign", "deparse", 84 | "det", "detach", "determinant", "determinant.matrix", "dget", 85 | "diag", "diag<-", "diff", "diff.Date", "diff.default", "diff.difftime", 86 | "diff.POSIXt", "difftime", "digamma", "dim", "dim.data.frame", 87 | "dim<-", "dimnames", "dimnames.data.frame", "dimnames<-", "dimnames<-.data.frame", 88 | "dir", "dir.create", "dir.exists", "dirname", "do.call", "dontCheck", 89 | "double", "dput", "dQuote", "drop", "droplevels", "droplevels.data.frame", 90 | "droplevels.factor", "dump", "duplicated", "duplicated.array", 91 | "duplicated.data.frame", "duplicated.default", "duplicated.matrix", 92 | "duplicated.numeric_version", "duplicated.POSIXlt", "duplicated.warnings", 93 | "dyn.load", "dyn.unload", "dynGet", "eapply", "eigen", "emptyenv", 94 | "enc2native", "enc2utf8", "encodeString", "Encoding", "Encoding<-", 95 | "endsWith", "enquote", "env.profile", "environment", "environment<-", 96 | "environmentIsLocked", "environmentName", "eval", "eval.parent", 97 | "evalq", "exists", "exp", "expand.grid", "expm1", "expression", 98 | "extSoftVersion", "F", "factor", "factorial", "fifo", "file", 99 | "file.access", "file.append", "file.choose", "file.copy", "file.create", 100 | "file.exists", "file.info", "file.link", "file.mode", "file.mtime", 101 | "file.path", "file.remove", "file.rename", "file.show", "file.size", 102 | "file.symlink", "Filter", "Find", "find.package", "findInterval", 103 | "findPackageEnv", "findRestart", "floor", "flush", "flush.connection", 104 | "for", "force", "forceAndCall", "formals", "formals<-", "format", 105 | "format.AsIs", "format.data.frame", "format.Date", "format.default", 106 | "format.difftime", "format.factor", "format.hexmode", "format.info", 107 | "format.libraryIQR", "format.numeric_version", "format.octmode", 108 | "format.packageInfo", "format.POSIXct", "format.POSIXlt", "format.pval", 109 | "format.summaryDefault", "formatC", "formatDL", "forwardsolve", 110 | "function", "gamma", "gc", "gc.time", "gcinfo", "gctorture", 111 | "gctorture2", "get", "get0", "getAllConnections", "getCallingDLL", 112 | "getCallingDLLe", "getConnection", "getDLLRegisteredRoutines", 113 | "getDLLRegisteredRoutines.character", "getDLLRegisteredRoutines.DLLInfo", 114 | "getElement", "geterrmessage", "getExportedValue", "getHook", 115 | "getLoadedDLLs", "getNamespace", "getNamespaceExports", "getNamespaceImports", 116 | "getNamespaceInfo", "getNamespaceName", "getNamespaceUsers", 117 | "getNamespaceVersion", "getNativeSymbolInfo", "getOption", "getRversion", 118 | "getSrcLines", "getTaskCallbackNames", "gettext", "gettextf", 119 | "getwd", "gl", "globalenv", "gregexpr", "grep", "grepl", "grepRaw", 120 | "grouping", "gsub", "gzcon", "gzfile", "I", "iconv", "iconvlist", 121 | "icuGetCollate", "icuSetCollate", "identical", "identity", "if", 122 | "ifelse", "Im", "importIntoEnv", "inherits", "integer", "interaction", 123 | "interactive", "intersect", "intToBits", "intToUtf8", "inverse.rle", 124 | "invisible", "invokeRestart", "invokeRestartInteractively", "is.array", 125 | "is.atomic", "is.call", "is.character", "is.complex", "is.data.frame", 126 | "is.double", "is.element", "is.environment", "is.expression", 127 | "is.factor", "is.finite", "is.function", "is.infinite", "is.integer", 128 | "is.language", "is.list", "is.loaded", "is.logical", "is.matrix", 129 | "is.na", "is.na.data.frame", "is.na.numeric_version", "is.na.POSIXlt", 130 | "is.na<-", "is.na<-.default", "is.na<-.factor", "is.na<-.numeric_version", 131 | "is.name", "is.nan", "is.null", "is.numeric", "is.numeric.Date", 132 | "is.numeric.difftime", "is.numeric.POSIXt", "is.numeric_version", 133 | "is.object", "is.ordered", "is.package_version", "is.pairlist", 134 | "is.primitive", "is.qr", "is.R", "is.raw", "is.recursive", "is.single", 135 | "is.symbol", "is.table", "is.unsorted", "is.vector", "isatty", 136 | "isBaseNamespace", "isdebugged", "isIncomplete", "isNamespace", 137 | "isNamespaceLoaded", "ISOdate", "ISOdatetime", "isOpen", "isRestart", 138 | "isS4", "isSeekable", "isSymmetric", "isSymmetric.matrix", "isTRUE", 139 | "jitter", "julian", "julian.Date", "julian.POSIXt", "kappa", 140 | "kappa.default", "kappa.lm", "kappa.qr", "kronecker", "l10n_info", 141 | "La.svd", "La_version", "labels", "labels.default", "lapply", 142 | "lazyLoad", "lazyLoadDBexec", "lazyLoadDBfetch", "lbeta", "lchoose", 143 | "length", "length.POSIXlt", "length<-", "length<-.factor", "lengths", 144 | "letters", "LETTERS", "levels", "levels.default", "levels<-", 145 | "levels<-.factor", "lfactorial", "lgamma", "libcurlVersion", 146 | "library", "library.dynam", "library.dynam.unload", "licence", 147 | "license", "list", "list.dirs", "list.files", "list2env", "load", 148 | "loadedNamespaces", "loadingNamespaceInfo", "loadNamespace", 149 | "local", "lockBinding", "lockEnvironment", "log", "log10", "log1p", 150 | "log2", "logb", "logical", "lower.tri", "ls", "make.names", "make.unique", 151 | "makeActiveBinding", "Map", "mapply", "margin.table", "mat.or.vec", 152 | "match", "match.arg", "match.call", "match.fun", "Math.data.frame", 153 | "Math.Date", "Math.difftime", "Math.factor", "Math.POSIXt", "matrix", 154 | "max", "max.col", "mean", "mean.Date", "mean.default", "mean.difftime", 155 | "mean.POSIXct", "mean.POSIXlt", "mem.limits", "memCompress", 156 | "memDecompress", "memory.profile", "merge", "merge.data.frame", 157 | "merge.default", "message", "mget", "min", "missing", "Mod", 158 | "mode", "mode<-", "month.abb", "month.name", "months", "months.Date", 159 | "months.POSIXt", "mostattributes<-", "names", "names.POSIXlt", 160 | "names<-", "names<-.POSIXlt", "namespaceExport", "namespaceImport", 161 | "namespaceImportClasses", "namespaceImportFrom", "namespaceImportMethods", 162 | "nargs", "nchar", "ncol", "NCOL", "Negate", "new.env", "next", 163 | "NextMethod", "ngettext", "nlevels", "noquote", "norm", "normalizePath", 164 | "nrow", "NROW", "numeric", "numeric_version", "nzchar", "objects", 165 | "oldClass", "oldClass<-", "OlsonNames", "on.exit", "open", "open.connection", 166 | "open.srcfile", "open.srcfilealias", "open.srcfilecopy", "Ops.data.frame", 167 | "Ops.Date", "Ops.difftime", "Ops.factor", "Ops.numeric_version", 168 | "Ops.ordered", "Ops.POSIXt", "options", "order", "ordered", "outer", 169 | "package_version", "packageEvent", "packageHasNamespace", "packageStartupMessage", 170 | "packBits", "pairlist", "parent.env", "parent.env<-", "parent.frame", 171 | "parse", "parseNamespaceFile", "paste", "paste0", "path.expand", 172 | "path.package", "pcre_config", "pi", "pipe", "pmatch", "pmax", 173 | "pmax.int", "pmin", "pmin.int", "polyroot", "pos.to.env", "Position", 174 | "pretty", "pretty.default", "prettyNum", "print", "print.AsIs", 175 | "print.by", "print.condition", "print.connection", "print.data.frame", 176 | "print.Date", "print.default", "print.difftime", "print.Dlist", 177 | "print.DLLInfo", "print.DLLInfoList", "print.DLLRegisteredRoutines", 178 | "print.factor", "print.function", "print.hexmode", "print.libraryIQR", 179 | "print.listof", "print.NativeRoutineList", "print.noquote", "print.numeric_version", 180 | "print.octmode", "print.packageInfo", "print.POSIXct", "print.POSIXlt", 181 | "print.proc_time", "print.restart", "print.rle", "print.simple.list", 182 | "print.srcfile", "print.srcref", "print.summary.table", "print.summaryDefault", 183 | "print.table", "print.warnings", "prmatrix", "proc.time", "prod", 184 | "prop.table", "provideDimnames", "psigamma", "pushBack", "pushBackLength", 185 | "q", "qr", "qr.coef", "qr.default", "qr.fitted", "qr.Q", "qr.qty", 186 | "qr.qy", "qr.R", "qr.resid", "qr.solve", "qr.X", "quarters", 187 | "quarters.Date", "quarters.POSIXt", "quit", "quote", "R.home", 188 | "R.version", "R.Version", "R.version.string", "R_system_version", 189 | "range", "range.default", "rank", "rapply", "raw", "rawConnection", 190 | "rawConnectionValue", "rawShift", "rawToBits", "rawToChar", "rbind", 191 | "rbind.data.frame", "rcond", "Re", "read.dcf", "readBin", "readChar", 192 | "readline", "readLines", "readRDS", "readRenviron", "Recall", 193 | "Reduce", "reg.finalizer", "regexec", "regexpr", "registerS3method", 194 | "registerS3methods", "regmatches", "regmatches<-", "remove", 195 | "removeTaskCallback", "rep", "rep.Date", "rep.factor", "rep.int", 196 | "rep.numeric_version", "rep.POSIXct", "rep.POSIXlt", "rep_len", 197 | "repeat", "replace", "replicate", "require", "requireNamespace", 198 | "restartDescription", "restartFormals", "retracemem", "return", 199 | "returnValue", "rev", "rev.default", "rle", "rm", "RNGkind", 200 | "RNGversion", "round", "round.Date", "round.POSIXt", "row", "row.names", 201 | "row.names.data.frame", "row.names.default", "row.names<-", "row.names<-.data.frame", 202 | "row.names<-.default", "rowMeans", "rownames", "rownames<-", 203 | "rowsum", "rowsum.data.frame", "rowsum.default", "rowSums", "sample", 204 | "sample.int", "sapply", "save", "save.image", "saveRDS", "scale", 205 | "scale.default", "scan", "search", "searchpaths", "seek", "seek.connection", 206 | "seq", "seq.Date", "seq.default", "seq.int", "seq.POSIXt", "seq_along", 207 | "seq_len", "sequence", "serialize", "set.seed", "setdiff", "setequal", 208 | "setHook", "setNamespaceInfo", "setSessionTimeLimit", "setTimeLimit", 209 | "setwd", "shell", "shell.exec", "showConnections", "shQuote", 210 | "sign", "signalCondition", "signif", "simpleCondition", "simpleError", 211 | "simpleMessage", "simpleWarning", "simplify2array", "sin", "single", 212 | "sinh", "sink", "sink.number", "sinpi", "slice.index", "socketConnection", 213 | "socketSelect", "solve", "solve.default", "solve.qr", "sort", 214 | "sort.default", "sort.int", "sort.list", "sort.POSIXlt", "source", 215 | "split", "split.data.frame", "split.Date", "split.default", "split.POSIXct", 216 | "split<-", "split<-.data.frame", "split<-.default", "sprintf", 217 | "sqrt", "sQuote", "srcfile", "srcfilealias", "srcfilecopy", "srcref", 218 | "standardGeneric", "startsWith", "stderr", "stdin", "stdout", 219 | "stop", "stopifnot", "storage.mode", "storage.mode<-", "strftime", 220 | "strptime", "strrep", "strsplit", "strtoi", "strtrim", "structure", 221 | "strwrap", "sub", "subset", "subset.data.frame", "subset.default", 222 | "subset.matrix", "substitute", "substr", "substr<-", "substring", 223 | "substring<-", "sum", "summary", "summary.connection", "summary.data.frame", 224 | "Summary.data.frame", "summary.Date", "Summary.Date", "summary.default", 225 | "Summary.difftime", "summary.factor", "Summary.factor", "summary.matrix", 226 | "Summary.numeric_version", "Summary.ordered", "summary.POSIXct", 227 | "Summary.POSIXct", "summary.POSIXlt", "Summary.POSIXlt", "summary.proc_time", 228 | "summary.srcfile", "summary.srcref", "summary.table", "suppressMessages", 229 | "suppressPackageStartupMessages", "suppressWarnings", "svd", 230 | "sweep", "switch", "sys.call", "sys.calls", "Sys.chmod", "Sys.Date", 231 | "sys.frame", "sys.frames", "sys.function", "Sys.getenv", "Sys.getlocale", 232 | "Sys.getpid", "Sys.glob", "Sys.info", "Sys.junction", "sys.load.image", 233 | "Sys.localeconv", "sys.nframe", "sys.on.exit", "sys.parent", 234 | "sys.parents", "Sys.readlink", "sys.save.image", "Sys.setenv", 235 | "Sys.setFileTime", "Sys.setlocale", "Sys.sleep", "sys.source", 236 | "sys.status", "Sys.time", "Sys.timezone", "Sys.umask", "Sys.unsetenv", 237 | "Sys.which", "system", "system.file", "system.time", "system2", 238 | "t", "T", "t.data.frame", "t.default", "table", "tabulate", "tan", 239 | "tanh", "tanpi", "tapply", "taskCallbackManager", "tcrossprod", 240 | "tempdir", "tempfile", "testPlatformEquivalence", "textConnection", 241 | "textConnectionValue", "tolower", "topenv", "toString", "toString.default", 242 | "toupper", "trace", "traceback", "tracemem", "tracingState", 243 | "transform", "transform.data.frame", "transform.default", "trigamma", 244 | "trimws", "trunc", "trunc.Date", "trunc.POSIXt", "truncate", 245 | "truncate.connection", "try", "tryCatch", "typeof", "unclass", 246 | "undebug", "union", "unique", "unique.array", "unique.data.frame", 247 | "unique.default", "unique.matrix", "unique.numeric_version", 248 | "unique.POSIXlt", "unique.warnings", "units", "units.difftime", 249 | "units<-", "units<-.difftime", "unix.time", "unlink", "unlist", 250 | "unloadNamespace", "unlockBinding", "unname", "unserialize", 251 | "unsplit", "untrace", "untracemem", "unz", "upper.tri", "url", 252 | "UseMethod", "utf8ToInt", "validEnc", "validUTF8", "vapply", 253 | "vector", "Vectorize", "version", "warning", "warnings", "weekdays", 254 | "weekdays.Date", "weekdays.POSIXt", "which", "which.max", "which.min", 255 | "while", "with", "with.default", "withCallingHandlers", "within", 256 | "within.data.frame", "within.list", "withRestarts", "withVisible", 257 | "write", "write.dcf", "writeBin", "writeChar", "writeLines", 258 | "xor", "xor.hexmode", "xor.octmode", "xpdrows.data.frame", "xtfrm", 259 | "xtfrm.AsIs", "xtfrm.Date", "xtfrm.default", "xtfrm.difftime", 260 | "xtfrm.factor", "xtfrm.numeric_version", "xtfrm.POSIXct", "xtfrm.POSIXlt", 261 | "xtfrm.Surv", "xzfile", "zapsmall") 262 | -------------------------------------------------------------------------------- /list-copy-paste.md: -------------------------------------------------------------------------------- 1 | # BASE 2 | 3 | 4 | ### operators 5 | 6 | |` list of operators`| 7 | |--------| 8 | |`base::[[`| 9 | |`base::::`| 10 | |`base::%%`| 11 | |`base::&&`| 12 | |`base::{`| 13 | |`base::|`| 14 | |`base::~`| 15 | |`base::[`| 16 | |`base::^`| 17 | |`base::!`| 18 | |`base::$`| 19 | |`base::&`| 20 | |`base::(`| 21 | |`base::*`| 22 | |`base::+`| 23 | |`base::-`| 24 | |`base::/`| 25 | |`base:::`| 26 | |`base::<`| 27 | |`base::=`| 28 | |`base::>`| 29 | |`base::<-`| 30 | |`base::<=`| 31 | |`base::==`| 32 | |`base::>=`| 33 | |`base::if` 34 | |`base::||`| 35 | |`base::!=`| 36 | |`base::[<-.`| 37 | |`base::[[.`| 38 | |`base::[[<-`| 39 | 40 | 41 | ### language 42 | ```R 43 | base::all.equal.formula 44 | base::getElement #Extract or Replace Parts of an Object 45 | base::is.single #Error in is.single(1e-06) : type "single" unimplemented in R 46 | base::is.null 47 | base::browserCondition 48 | base::get0 49 | base::isFALSE 50 | base::all.equal.character 51 | base::logical 52 | base::class<- 53 | base::as.null.default # coerce object to NULL 54 | base::summary.warnings 55 | base::intersect 56 | base::suppressMessages 57 | base::$<- # no idea what this is 58 | base::eval.parent 59 | base::UseMethod # S3 subsystem 60 | base::mem.limits # deprecated 61 | base::all.vars 62 | base::within 63 | base::<<- 64 | base::is.na<-.default 65 | base::R.version.string 66 | base::as.single.default 67 | base::@<- 68 | base::identical 69 | base::nargs 70 | base::is.R 71 | base::bitwNot 72 | base::is.primitive 73 | base::version 74 | base::print.warnings 75 | base::simpleWarning 76 | base::double 77 | base::print 78 | base::forceAndCall 79 | base::testPlatformEquivalence 80 | base::contributors 81 | base::unix.time 82 | base::print.Dlist # print description list 83 | base::Find 84 | base::all.equal.envRefClass 85 | base::bitwXor 86 | base::Map 87 | base::Mod 88 | base::objects 89 | base::search 90 | base::is.infinite 91 | base::getSrcLines 92 | base::dQuote 93 | base::bquote 94 | base::builtins 95 | base::length<- 96 | base::format.summaryDefault 97 | base::all.equal.numeric 98 | base::registerS3method 99 | base::environmentName 100 | base::parent.env 101 | base::environment<- 102 | base::as.call 103 | base::with 104 | base::emptyenv 105 | base::[.AsIs 106 | base::comment<- 107 | base::seq_len 108 | base::numeric 109 | base::formatDL #format descriptionlists 110 | base::mostattributes<- 111 | base::data.class 112 | base::memCompress 113 | base::make.names #example make.names(c("a and b", "a-and-b"), unique = TRUE) 114 | base::as.null 115 | base::storage.mode 116 | base::is.nan 117 | base::class 118 | 119 | base::pretty.default 120 | base::open.srcfilealias 121 | base::identity 122 | base::print.summaryDefault 123 | base::extSoftVersion 124 | base::open.srcfile 125 | base::all.equal.default 126 | base::summary 127 | base::packageStartupMessage 128 | base::sys.save.image 129 | base::invisible 130 | base::open.srcfile 131 | base::Recall 132 | base::load 133 | base::R.version # S compatibility 134 | base::R.Version 135 | base::within.list 136 | base::inherits 137 | base::comment 138 | base::|.hexmode 139 | base::setequal 140 | base::typeof 141 | base::seq 142 | base::try 143 | base::mget 144 | base::Sys.info 145 | base::xor 146 | base::%in% 147 | base::capabilities 148 | base::geterrmessage 149 | base::delayedAssign 150 | base::range 151 | base::getRversion 152 | base::structure 153 | base::mode 154 | base::&.octmode 155 | base::parent.env<- 156 | base::as.environment 157 | base::environment 158 | base::split #Divide into Groups and Reassemble 159 | base::asS3 160 | base::asS4 161 | base::with.default 162 | base::args 163 | base::srcfile 164 | base::tryCatch 165 | base::attr 166 | base::next #same as continue in for/do/while loops 167 | base::union 168 | base::invokeRestart #condition system 169 | base::bitwOr 170 | base::bindtextdomain # translate text messages 171 | base::ifelse #if else construct example: sqrt(ifelse(x >= 0, x, NA)) # no warning 172 | base::is.atomic #object is atomic or recursive 173 | base::body # manipulate the body of a function 174 | base::body<- 175 | base::rep.int 176 | base::local #evaluate an "expression class" 177 | base::expression #creates Unevaluated Expressions, it has class "expression" 178 | base::Reduce #FP "reduce" 179 | base::Negate 180 | base::is.expression 181 | base::deparse # expression deparsing 182 | base::sys.parent 183 | base::call 184 | base::is.object 185 | base::attributes<- 186 | base::[.hexmode 187 | base::bitwShiftR 188 | base::bitwShiftL 189 | base::RNGversion #older version of .RNGKind 190 | base::withVisible 191 | base::print.AsIs 192 | base::Filter 193 | base::single 194 | base::attr.all.equal 195 | base::dontCheck 196 | base::all.equal.list 197 | base::formals<- 198 | base::as.function.default 199 | base::is.finite 200 | base::is.na 201 | base::duplicated 202 | base::print.octmode 203 | base::summary.proc_time 204 | base::stopifnot 205 | base::force 206 | base::format 207 | base::NextMethod 208 | base::Vectorize # like "arrayrify" or "multiplex" 209 | base::is.numeric 210 | base::Im #(give imaginary part of a complex number) 211 | base::Re 212 | base::packageHasNamespace 213 | base::is.na<- 214 | base::is.name #alias for is.symbol 215 | base::as.name #alias for as.symbol 216 | base::as.symbol 217 | base::is.symbol 218 | base::I 219 | base::registerS3methods 220 | base::c 221 | base::F 222 | base::T 223 | base::as.logical 224 | base::browser 225 | base::is.double 226 | base::new.env 227 | base::while 228 | base::complex 229 | base::environmentIsLocked 230 | base::Sys.getenv 231 | 232 | base::as.complex 233 | base::all.equal.environment 234 | base::as.double 235 | base::findPackageEnv #find objects in package base_ 236 | base::getNamespaceImports 237 | base::match.arg 238 | base::all.names #get tokens(expr) from an expression_ 239 | base::enquote #quote expressions_ 240 | base::|.octmode #octal mode?_ 241 | base::warning #warning message_ 242 | base::suppressWarnings 243 | base::match.fun #extract function by name_ 244 | base::format.AsIs #note:"AsIs" is a class , format an R object , pretty print_ 245 | base::is.integer 246 | base::as.integer 247 | base::as.single #double single precision vectors_ 248 | base::is.function 249 | base::l10n_info #report localisation information_ 250 | base::integer 251 | base::pcre_config #find conversion of strings to/from encoding_ 252 | base::parent.frame 253 | base::Position 254 | base::isNamespace 255 | base::lockBinding #locking functions to environments_ 256 | base::message #simple diagnostic messages_ 257 | base::all.equal.language 258 | base::attr<- 259 | base::asNamespace 260 | base::eval 261 | base::do.call 262 | base::getNamespaceName 263 | base::all.equal 264 | base::round 265 | base::quote #no real counterpart in JS, its an expression, but not evaluated 266 | #Example: 267 | v <- quote(1+1) 268 | 2+eval(v) 269 | #-> [1] 4 270 | 271 | base::interaction 272 | #Example: 273 | > interaction(f23,f32, drop=F) 274 | [1] 1.1 1.2 1.3 2.4 2.5 275 | Levels: 1.1 2.1 1.2 2.2 1.3 2.3 1.4 2.4 1.5 2.5 276 | > interaction(f23,f32, drop=T) 277 | [1] 1.1 1.2 1.3 2.4 2.5 278 | Levels: 1.1 1.2 1.3 2.4 2.5 279 | ``` 280 | 281 | ### specials 282 | ``` 283 | base::lchoose 284 | base::choose 285 | base::trigamma 286 | base::lbeta 287 | base::beta 288 | base::lgamma 289 | base::gamma 290 | base::digamma 291 | base::factorial 292 | base::lfactorial 293 | base::besselI 294 | base::besselJ 295 | base::besselK 296 | base::besselY 297 | ``` 298 | 299 | ### version string management 300 | ```R 301 | base::regmatches<- 302 | base::as.package_version 303 | base::unique.default 304 | base::unique.numeric_version 305 | base::package_version 306 | base::c.numeric_version 307 | base::anyNA.numeric 308 | base::xtfrm.numeric_version 309 | base::is.na.numeric_version 310 | base::.decode_numeric_version 311 | base::format.numeric_version 312 | base::print.numeric_version 313 | base::Summary.numeric_version 314 | base::is.na<-.numeric_version 315 | base::[.numeric_version 316 | base::as.list.numeric_version 317 | base::Ops.numeric_version 318 | base::R_system_version 319 | base::as.character.numeric_version 320 | base::$.package_version 321 | base::$.package_version 322 | base::[<-.numeric_version 323 | base::[[<-.numeric_version 324 | base::.make_numeric_version 325 | base::duplicated.numeric 326 | base::numeric_version 327 | base::as.data.frame.numeric_version 328 | base::as.numeric_version 329 | base::[[.numeric_version 330 | base::is.package_version 331 | base::is.numeric_version 332 | base::rep.numeric_version 333 | base::evalq 334 | ``` 335 | 336 | ### subsetting, like [ but different 337 | ```R 338 | base::subset.default 339 | base::subset 340 | base::.subset2 341 | base::subset.matrix 342 | base::subset.data.frame 343 | ``` 344 | 345 | ### utf8ToInt 346 | ```R 347 | base::utf8ToInt 348 | ``` 349 | 350 | ### date and time classes POSIXt POSIXct POSIXlt 351 | ```R 352 | 353 | base::weekdays 354 | base::Sys.time 355 | base::julian 356 | base::quarters 357 | base::Sys.timezone 358 | base::Ops.POSIXt 359 | base::as.POSIXlt.default 360 | base::length.POSIXlt 361 | base::as.Date.POSIXct 362 | base::as.Date.POSIXlt 363 | base::weekdays.POSIXt 364 | base::[.POSIXct 365 | base::[.POSIXlt 366 | base::as.POSIXct.default 367 | base::mean.POSIXct 368 | base::as.POSIXct.POSIXlt 369 | base::mean.POSIXlt 370 | base::format.POSIXct 371 | base::format.POSIXlt 372 | base::Math.POSIXt 373 | base::xtfrm.POSIXct 374 | base::xtfrm.POSIXlt 375 | base::as.POSIXlt.numeric 376 | base::diff.POSIXt 377 | base::is.numeric.POSIXt 378 | base::anyNA.POSIXlt 379 | base::julian.POSIXt 380 | base::cut.POSIXt 381 | base::as.POSIXlt.Date 382 | base::[[.POSIXct 383 | base::[[.POSIXlt 384 | base::as.POSIXlt.POSIXct 385 | base::unique.POSIXlt 386 | base::as.list.POSIXct 387 | base::as.list.POSIXlt 388 | base::round.POSIXt 389 | base::duplicated.POSIXlt 390 | base::months.POSIXt 391 | base::+.POSIXt 392 | base::-.POSIXt 393 | base::as.character.POSIXt 394 | base::quarters.POSIXt 395 | base::summary.POSIXct 396 | base::summary.POSIXlt 397 | base::as.matrix.POSIXlt 398 | base::as.POSIXct 399 | base::as.POSIXlt 400 | base::is.na.POSIXlt 401 | base::rep.POSIXct 402 | base::rep.POSIXlt 403 | base::seq.POSIXt 404 | base::as.double.POSIXlt 405 | base::as.POSIXlt.character 406 | base::trunc.POSIXt 407 | base::all.equal.POSIXt 408 | base::sort.POSIXlt 409 | base::print.POSIXct 410 | base::print.POSIXlt 411 | base::length<-.POSIXct 412 | base::length<-.POSIXlt 413 | base::names.POSIXlt 414 | base::Summary.POSIXct 415 | base::Summary.POSIXlt 416 | base::c.POSIXct 417 | base::c.POSIXlt 418 | base::as.data.frame.POSIXct 419 | base::as.data.frame.POSIXlt 420 | base::as.POSIXlt.factor 421 | base::names<-.POSIXlt 422 | base::as.POSIXct.numeric 423 | base::[<-.POSIXct 424 | base::[<-.POSIXlt 425 | base::as.POSIXct.Date 426 | base::split.POSIXct 427 | ``` 428 | 429 | ### run length encoding (rle) 430 | 431 | ```R 432 | base::inverse.rle 433 | # x <- rev(rep(6:10, 1:5)) 434 | #rle(x) 435 | # -> lengths [1:5] 5 4 3 2 1 436 | # -> values [1:5] 10 9 8 7 6 437 | ``` 438 | 439 | ### base::memory.profile 440 | ```R 441 | > memory.profile() 442 | NULL symbol pairlist closure environment promise 443 | 1 7753 146453 3041 1079 6845 444 | language special builtin char logical integer 445 | 38286 45 680 9087 5467 26210 446 | double complex character ... any list 447 | 1292 1 39089 0 0 11843 448 | expression bytecode externalptr weakref raw S4 449 | 2 9505 1397 430 439 871 450 | ``` 451 | 452 | ### lapack 453 | 454 | ```R 455 | base::La_version #lapack version_ 456 | ``` 457 | 458 | ### QR decomposition 459 | ```R 460 | base::chol # lapack routine dpstrf 461 | base::is.qr 462 | base::chol2inv #inverse from choleski decomp 463 | base::qr.Q #reconstruct Q part of QR decomposition from `qr` object_ 464 | base::qr.R #reconstruct R part of QR decomposition from `qr` object_ 465 | base::qr.X 466 | base::qr.coef 467 | base::qr.default 468 | base::qr.qy 469 | base::qr.fitted 470 | base::qr.qty 471 | base::qr.resid 472 | base::as.qr 473 | base::qr.solve #same as solve(qr)_ 474 | base::qr 475 | # Examples: 476 | # A <- matrix(runif(12), 3) 477 | # b <- 1:3 478 | # qr.solve(A, b) 479 | # -> [1] 8.456735 4.233530 -5.860061 0.000000 480 | # solve(qr(A, LAPACK = TRUE), b) 481 | # ->[1] 8.456735 4.233530 -5.860061 0.000000 482 | base::solve.qr 483 | base::solve.default 484 | base::backsolve #wrapper for the level-3 BLAS routine 'dtrsm'. 485 | base::forwardsolve #wrapper for the level-3 BLAS routine 'dtrsm'. 486 | ``` 487 | 488 | ### Xapply 489 | ```R 490 | base::rapply #recursive version of lapply 491 | base::lapply 492 | base::apply 493 | base::vapply 494 | base::sapply 495 | base::mapply 496 | base::tapply 497 | base::eapply 498 | ``` 499 | 500 | ### io 501 | ```R 502 | 503 | base::textConnectionValue 504 | base::save 505 | base::scan 506 | base::sink.number 507 | base::dir.exists 508 | base::seek 509 | base::readRDS 510 | base::rawConnectionValue 511 | base::Sys.chmod 512 | base::sink 513 | base::list.files 514 | base::file.show 515 | base::bzfile 516 | base::summary.srcref #source files and codes 517 | base::normalizePath 518 | base::writeLines 519 | base::saveRDS 520 | base::curlGetHeaders 521 | base::Sys.readlink 522 | base::dir.create 523 | base::seek.connection 524 | base::pushBack 525 | base::srcfilecopy 526 | base::write.dcf 527 | base::file.link 528 | base::isOpen 529 | base::system.file 530 | base::file.size 531 | base::read.dcf 532 | base::showConnections 533 | base::print.function 534 | base::file.mtime 535 | base::setwd 536 | base::getwd 537 | base::as.expression 538 | base::summary.srcfile 539 | base::close.srcfilealias 540 | base::isIncomplete 541 | base::source 542 | base::readRenviron 543 | base::textConnection 544 | base::file.mode 545 | base::file.info 546 | base::xzfile 547 | base::writeChar 548 | base::readline 549 | base::Sys.glob 550 | base::stdin 551 | base::readLines 552 | base::dir 553 | base::pushBackLength 554 | base::lazyLoadDBexec 555 | base::close 556 | base::save.image 557 | base::Sys.setFileTime 558 | base::stderr 559 | base::flush 560 | base::unz 561 | base::url 562 | base::dirname 563 | base::oldClass<- #S-PLUS legacy? 564 | base::print.simple.list 565 | base::file.access 566 | base::stdout 567 | base::print.default 568 | base::print.connection 569 | base::basename 570 | base::file.append 571 | base::socketConnection 572 | base::getConnection 573 | base::write 574 | base::close.connection 575 | base::sys.source #parse and evaluate expressions from a file 576 | base::clearPushBack #push text back to a connection 577 | base::readChar 578 | base::file 579 | base::file.create 580 | base::isatty 581 | base::file.remove 582 | base::list.dirs 583 | base::truncate 584 | base::file.rename 585 | base::truncate.connection 586 | base::gzfile 587 | base::open.connection 588 | base::writeBin 589 | base::flush.connection 590 | base::isSeekable 591 | base::tempdir 592 | base::open 593 | base::fifo 594 | base::summary.connection 595 | base::file.choose 596 | base::closeAllConnections 597 | base::file.exists 598 | base::socketSelect 599 | base::dget 600 | base::getAllConnections 601 | base::pipe 602 | base::print.hexmode #print numbers in hex_ 603 | base::file.path 604 | base::memDecompress #compress or decompress in memory# 605 | base::lazyLoad #lazyload R objects# 606 | base::file.symlink 607 | base::dput #write object to file# 608 | base::tempfile #create named temporary file# 609 | base::mode<- #storage mode of an R object# 610 | base::rawConnection 611 | base::Sys.umask 612 | base::gzcon 613 | base::ls #show directory entries# 614 | base::readBin #read binary data# 615 | base::dump #text representation of R objects# 616 | base::unlink #deletes files# 617 | base::file.copy #copy a file# 618 | base::browserText #browser related, not a "browser" here is a user-feedback-console, like a prompt# 619 | ``` 620 | 621 | ### internal 622 | ```R 623 | base::sys.load.image 624 | base::getOption 625 | base::options 626 | base::.Options 627 | base::.cache_class 628 | base::.POSIXct 629 | base::.POSIXlt 630 | base::lazyLoadDBfetch 631 | base::.difftime 632 | base::.doSortWrap #only user-visible because of the special nature of the base namespace_ 633 | base::.NotYetImplemented 634 | base::.mapply 635 | base::.noGenerics 636 | base::.getRequiredPackages2 637 | base::.OptRequireMethods 638 | base::.makeMessage 639 | base::.packages 640 | base::.amatch_costs 641 | base::.readRDS 642 | base::.External.graphics 643 | base::.rowNamesDF<- 644 | base::.maskedMsg 645 | base::.colSums 646 | base::.Primitive 647 | base::.saveRDS 648 | base::.S3PrimitiveGenerics 649 | base::.AutoloadEnv 650 | base::.Devices 651 | base::.userHooksEnv 652 | base::.Library 653 | base::.ArgsEnv 654 | base::.popath 655 | base::.format.zeros #auxiliary function of 'prettyNum()' re-formats the zeros in a vector 'x' of formatted numbers_ 656 | base::.C_R_getTaskCallbackNames 657 | base::.detach 658 | base::.getRequiredPackages 659 | base::.doWrap 660 | base::.col 661 | base::.F_dchdc 662 | base::.isMethodsDispatchOn 663 | base::.mergeExportMethods 664 | base::.primTrace 665 | base::.Machine 666 | base::.rowMeans 667 | base::.Call 668 | base::.expand_R_libs_env_var 669 | base::.mergeImportMethods 670 | base::.knownS3Generics 671 | base::.deparseOpts 672 | base::.row 673 | base::.standard_regexps 674 | base::regexpr 675 | base::regexec 676 | base::.__H__.rbind 677 | base::.signalSimpleWarning 678 | base::.External2 679 | base::.Date 680 | base::.rowSums 681 | base::.methodsNamespace 682 | base::.NotYetUsed 683 | base::.First.sys 684 | base::.First.sys 685 | base::.F_dqrqy 686 | base::.F_dqrxb 687 | base::.F_dqrcf 688 | base::.Last.value 689 | base::.find.package 690 | base::.getNamespace 691 | base::.F_dqrqty 692 | base::.getNamespace 693 | base::.getNamespace 694 | base::.isOpen 695 | base::.F_dqrrsd 696 | base::.Traceback 697 | base::.Library.site 698 | base::.packageStartupMessage 699 | base::.Call.graphics 700 | base::.C_R_addTaskCallback 701 | base::.amatch_bounds 702 | base::.S3_methods_table 703 | base::.row_names_info 704 | base::.F_dqrdc2 705 | base::.leap.seconds 706 | base::.C_R_removeTaskCallback 707 | base::.libPaths 708 | base::.getNamespaceInfo 709 | base::.primUntrace 710 | base::.colMeans 711 | base::.dynLibs 712 | base::...length 713 | base::.__H__.cbind 714 | base::.External 715 | base::.BaseNamespaceEnv 716 | base::.Internal 717 | base::.Fortran 718 | base::.TAOCP1997init 719 | base::..deparseOpts 720 | base::.path.package 721 | base::.GenericArgsEnv 722 | base::.F_dtrco 723 | base::.kronecker 724 | base::.traceback 725 | base::.bincode 726 | base::.Deprecated 727 | base::.doSortWrap 728 | base::.rmpkg 729 | base::.Platform 730 | base::.__S3MethodsTable__. 731 | base::...elt 732 | base::.Script 733 | base::.doTrace 734 | base::.Device 735 | base::.tryResumeInterrupt 736 | base::.valid.factor 737 | base::.Defunct 738 | base::.set_row_names #prolly an internal 739 | base::.C 740 | base::.encode_numeric 741 | base::.handleSimpleError 742 | base::.GlobalEnv 743 | base::.gt 744 | base::.gtn 745 | ``` 746 | 747 | #### difftime 748 | ```R 749 | base::units.difftime 750 | base::xtfrm.difftime 751 | base::as.double.difftime 752 | base::length<-.difftime 753 | base::units<-.difftime 754 | base::*.difftime 755 | base::diff.difftime 756 | base::c.difftime 757 | base::format.difftime 758 | base::Math.difftime 759 | base::[.difftime 760 | base::as.difftime 761 | base::mean.difftime 762 | base::print.difftime 763 | base::difftime 764 | base::Ops.difftime 765 | base::as.data.frame.difftime 766 | base::/.difftime 767 | base::is.numeric. 768 | base::Summary.difftime 769 | ``` 770 | 771 | ### data.frames 772 | ```R 773 | base::transform 774 | base::by.default 775 | base::transform.default 776 | base::expand.grid 777 | base::merge 778 | base::unique #extract unique elements unique(c(1,2,2,3)) -> 1,2,3 779 | base::merge.default #merge 2 data frames 780 | base::row.names.default 781 | base::duplicated.default 782 | base::print.by 783 | base::as.data.frame.matrix #_coerce matrix to a data.frame_ 784 | base::dimnames.data.frame 785 | base::xpdrows.data.frame 786 | base::transform.data.frame 787 | base::is.data.frame 788 | base::as.data.frame.default 789 | base::as.data.frame.data.frame 790 | base::by.data.frame 791 | base::print.data.frame 792 | base::merge.data.frame 793 | base::Summary. 794 | base::is.na.data.frame 795 | base::as.data.frame.vector 796 | base::as.data.frame.table 797 | base::as.list.data.frame 798 | base::cbind.data.frame 799 | base::rowsum.data.frame 800 | base::Ops.data.frame 801 | base::summary. 802 | base::as.data.frame.character 803 | base::[<-.data.frame 804 | base::data.frame 805 | base::$<-.data.frame 806 | base::duplicated.data.frame 807 | base::as.data.frame 808 | base::anyDuplicated.data.frame 809 | base::as.data.frame.raw 810 | base::as.data.frame.AsIs 811 | base::split.data.frame 812 | base::row.names.data.frame 813 | base::dimnames<-.data.frame 814 | base::Math.data.frame 815 | base::[[<-.data.frame 816 | base::as.data.frame.factor 817 | base::[.data.frame 818 | base::as.data.frame.model.matrix 819 | base::unique.data.frame 820 | base::within.data.frame 821 | base::row.names<-.data.frame 822 | base::as.data.frame.ordered 823 | base::dim.data.frame 824 | base::t.data.frame 825 | base::as.data.frame.integer 826 | base::[[.data.frame 827 | base::as.data.frame.Date 828 | base::split<-.data.frame 829 | base::droplevels.data.frame 830 | base::as.data.frame.list 831 | base::as.data.frame.numeric 832 | base::$.data.frame 833 | base::as.data.frame.complex 834 | base::rbind.data.frame 835 | base::as.data.frame.logical 836 | base::as.data.frame.ts 837 | base::format.data.frame 838 | base::as.data.frame.noquote 839 | ``` 840 | 841 | ### aux 842 | ```R 843 | base::LETTERS 844 | base::parse #'parse' returns the parsed but unevaluated expressions in a list._ 845 | base::by #Function 'by' is an object-oriented wrapper for 'tapply' applied to data frames._ 846 | base::gc #garbage collection_ 847 | 848 | base::match #same as %in%_ 849 | ``` 850 | 851 | ### sorting 852 | ```R 853 | base::order #sort data_ 854 | base::sort #alias of order_ 855 | base::sort.list 856 | base::sort.int 857 | base::sort.default 858 | base::is.unsorted 859 | ``` 860 | 861 | ### list 862 | ```R 863 | base::is.pairlist 864 | base::as.pairlist 865 | base::as.list 866 | base::is.table 867 | base::as.list.default 868 | base::as.list.environment 869 | base::as.list.function 870 | base::pairlist 871 | base::attributes 872 | base::as.list.factor #S3 method "factor" -> "list" 873 | base::[.simple.list 874 | base::is.list 875 | base::unlist 876 | base::is.recursive #is an object list like or atomic_ 877 | base::as.function #convert object(list) to a function_ 878 | base::replicate #replicate is a wrapper for the common use of sapply_ 879 | ``` 880 | 881 | ### array (vector, matrix, array, table) 882 | ```R 883 | base::determinant 884 | base::unname 885 | base::row.names 886 | base::lengths 887 | base::dimnames<- 888 | base::pretty 889 | base::anyNA 890 | base::as.vector 891 | base::split<-.default 892 | base::length 893 | base::unsplit 894 | base::as.table.default 895 | base::is.matrix 896 | base::colSums 897 | base::%*% # matrix multiplication 898 | base::%/% #matrix A/x, example inverseA = diag(1:3)/matrix(runif(9),3) 899 | base::aperm 900 | base::xtfrm 901 | base::grouping 902 | base::as.matrix.default 903 | base::%o% # outer product 904 | base::%x% # kronecker (x,y) 905 | base::as.matrix 906 | base::split 907 | base::split<- 908 | base::diff.default 909 | base::is.vector 910 | base::iconvlist 911 | base::table 912 | base::xtfrm.default 913 | base::tabulate 914 | base::findInterval 915 | base::margin.table 916 | base::duplicated.matrix 917 | base::append 918 | base::mat.or.vec 919 | base::tanpi 920 | base::prmatrix 921 | base::dimnames 922 | base::chol.default 923 | base::anyDuplicated.default 924 | base::rep.factor 925 | base::outer 926 | base::as.table 927 | base::xtfrm.Surv 928 | base::rowsum.default 929 | base::tcrossprod 930 | base::crossprod 931 | base::all 932 | base::as.numeric 933 | base::any 934 | base::col 935 | base::det 936 | base::dim 937 | base::anyDuplicated.matrix 938 | base::rowSums 939 | base::summary.table 940 | base::list 941 | base::rownames<- 942 | base::max.col 943 | base::unique.matrix 944 | base::rep 945 | base::rev #reverse elements 946 | base::row 947 | base::rev.default 948 | base::as.matrix.noquote 949 | base::svd 950 | base::upper.tri 951 | base::isSymmetric.matrix 952 | base::dim<- 953 | base::droplevels 954 | base::determinant.matrix 955 | base::rowMeans 956 | base::matrix 957 | base::ncol 958 | base::lower.tri 959 | base::rbind 960 | base::cbind 961 | base::diag<- 962 | base::scale.default 963 | base::row.names<- 964 | base::aperm.table #array transposition 965 | base::norm #compute norm of an array 966 | base::isSymmetric 967 | base::sweep 968 | base::nrow 969 | base::[.table 970 | base::colnames 971 | base::labels 972 | base::labels.default 973 | base::rcond 974 | base::print.summary.table 975 | base::NCOL 976 | base::rep_len 977 | base::colnames<- 978 | base::names<- 979 | base::prop.table 980 | base::replace 981 | base::slice.index 982 | base::diag 983 | base::sequence #run `seq\_len` over a vector of values_ 984 | base::provideDimnames 985 | base::t.default #matrix transpose_ 986 | base::NROW #number of rows in an array_ 987 | base::summary.matrix 988 | base::La.svd #svd decomposition (la=lapack)_ 989 | base::prod #product of vectors_ 990 | base::drop #delete dimensions that have only 1 level_ 991 | base::eigen #spectral decomposition of matrix_ 992 | base::colMeans 993 | base::t 994 | base::unique.array 995 | base::as.data.frame.array 996 | base::arrayInd 997 | base::which 998 | base::duplicated. 999 | base::anyDuplicated.array 1000 | base::names 1001 | base::which 1002 | ### example 1003 | # which(LETTERS == "R") 1004 | # which(ll <- c(TRUE, FALSE, TRUE, NA, FALSE, FALSE, TRUE)) #> 1 3 7 1005 | # names(ll) <- letters[seq(ll)] 1006 | # which(ll) 1007 | # which((1:12)%%2 == 0) # which are even? 1008 | # which(1:10 > 3, arr.ind = TRUE) 1009 | 1010 | base::simplify2 1011 | base::as.array 1012 | base::is.array 1013 | base::as.array.default 1014 | base::aperm #array transposition_ 1015 | base::aperm.default 1016 | base::kronecker #kronecker product on arrays_ 1017 | base::as.matrix.data.frame 1018 | base::rowsum 1019 | ``` 1020 | 1021 | ### math 1022 | ```R 1023 | base::data.matrix 1024 | base::sign 1025 | base::sinh 1026 | base::acosh 1027 | base::Conj 1028 | base::tanh 1029 | base::sqrt 1030 | base::sample.int 1031 | base::signif 1032 | base::expm1 1033 | base::Arg 1034 | base::set.seed 1035 | base::jitter 1036 | base::unclass # remove class attributes 1037 | base::cummax 1038 | base::cummin 1039 | base::asinh 1040 | base::cumsum 1041 | base::[<- 1042 | base::format.pval 1043 | base::atan2 1044 | base::atanh 1045 | base::which.min 1046 | base::which.max 1047 | base::abs 1048 | base::cos 1049 | base::exp 1050 | base::is.complex 1051 | base::RNGkind 1052 | base::pmax.int 1053 | base::max 1054 | base::floor 1055 | base::min 1056 | base::log2 1057 | base::sin 1058 | base::acos 1059 | base::tan 1060 | base::sum 1061 | base::mean 1062 | base::asin 1063 | base::log10 1064 | base::log1p 1065 | base::trunc 1066 | base::cosh 1067 | base::cospi 1068 | base::ceiling 1069 | base::pi 1070 | base::pmin #vector based min_ 1071 | base::pmin.int 1072 | base::pmax 1073 | base::cumprod #cummulative sum, products and extremes_ 1074 | base::mean.default 1075 | base::setdiff 1076 | base::is.element 1077 | base::polyroot 1078 | base::RNGversion 1079 | ``` 1080 | 1081 | ### dates 1082 | ```R 1083 | base::strftime 1084 | base::units<- 1085 | base::OlsonNames 1086 | base::check_tzones 1087 | base::sinpi 1088 | base::units 1089 | base::month.abb 1090 | base::months 1091 | base::month.name #built in constants_ 1092 | base::split.Date 1093 | base::Summary.Date 1094 | base::rep.Date 1095 | base::diff.Date 1096 | base::is.numeric.Date 1097 | base::as.list.Date 1098 | base::length<-.Date 1099 | base::c.Date 1100 | base::ISOdate 1101 | base::-.Date 1102 | base::weekdays.Date 1103 | base::cut.Date 1104 | base::seq.Date 1105 | base::round.Date 1106 | base::mean.Date 1107 | base::as.Date.default 1108 | base::months.Date 1109 | base::as.Date.numeric 1110 | base::Sys.Date 1111 | base::print.Date 1112 | base::julian.Date 1113 | base::Math.Date 1114 | base::Ops.Date 1115 | base::as.Date.character 1116 | base::[.Date 1117 | base::format.Date 1118 | base::summary. 1119 | base::as.Date.factor 1120 | base::+.Date 1121 | base::xtfrm.Date 1122 | base::as.character.Date 1123 | base::quarters.Date 1124 | base::date 1125 | base::ISOdatetime 1126 | base::as.Date 1127 | base::trunc.Date 1128 | ``` 1129 | 1130 | ### string 1131 | ```R 1132 | base::R.home 1133 | base::exists 1134 | base::substitute 1135 | base::print.noquote 1136 | base::as.character.octmode 1137 | base::browserSetDebug 1138 | base::print.listof 1139 | base::[.octmode 1140 | 1141 | base::default.stringsAsFactors 1142 | base::pmatch 1143 | base::casefold 1144 | base::chartr 1145 | base::as.octmode 1146 | base::formatC 1147 | base::as.hexmode 1148 | base::packageEvent 1149 | base::make.unique 1150 | base::noquote 1151 | base::grep 1152 | base::strsplit 1153 | base::gsub 1154 | base::print.rle 1155 | base::format.octmode 1156 | base::enc2utf8 1157 | base::char.expand 1158 | base::enc2native 1159 | base::grepRaw 1160 | base::format.default 1161 | base::c.noquote 1162 | base::all.equal.raw 1163 | base::Sys.localeconv 1164 | base::!.hexmode 1165 | base::sprintf 1166 | base::abbreviate 1167 | base::grepl 1168 | base::&.hexmode 1169 | base::character 1170 | base::seq.int 1171 | base::storage.mode<- 1172 | base::gregexpr 1173 | base::ngettext 1174 | base::gettext 1175 | base::rawToChar 1176 | 1177 | base::sQuote 1178 | base::nchar 1179 | base::strptime 1180 | base::agrepl 1181 | base::substring<- 1182 | base::substr<- 1183 | base::agrep 1184 | base::Encoding<- 1185 | base::charToRaw 1186 | base::cat 1187 | base::is.raw 1188 | base::charmatch 1189 | base::rawShift 1190 | base::toString.default 1191 | base::strtrim 1192 | base::print.summary.warnings 1193 | base::log 1194 | base::rawToBits 1195 | base::gettextf 1196 | base::format.info 1197 | base::raw 1198 | base::paste0 #concat strings 1199 | base::intToUtf8 1200 | base::rle 1201 | base::sub # pattern match and replacement 1202 | base::!.octmode 1203 | base::is.character 1204 | base::intToBits 1205 | base::validUTF8 1206 | base::Sys.setlocale 1207 | base::shQuote 1208 | base::as.character 1209 | base::endsWith 1210 | base::format.hexmode 1211 | base::Sys.getlocale 1212 | base::unserialize 1213 | base::serialize 1214 | base::trimws 1215 | base::validEnc 1216 | base::encodeString 1217 | base::prettyNum 1218 | base::strwrap 1219 | base::tolower 1220 | base::iconv 1221 | base::packBits 1222 | base::strrep 1223 | base::substr 1224 | base::strtoi 1225 | base::toupper 1226 | base::paste 1227 | base::startsWith 1228 | base::as.character.hexmode 1229 | base::letters 1230 | base::Encoding 1231 | base::regmatches 1232 | base::substring 1233 | base::nzchar 1234 | base::as.raw 1235 | base::toString 1236 | ``` 1237 | 1238 | ### statistical helpers 1239 | ```R 1240 | base::rank #ranking of numbers_ 1241 | #example 1242 | # 1243 | # x=c(1,1.5,1.5,2,2.8) 1244 | # rank(x) 1245 | #-> [1] 1.0 2.5 2.5 4.0 5.0 1246 | base::xtfrm.AsIs 1247 | 1248 | ``` 1249 | 1250 | ### condition number of a matrix 1251 | ```R 1252 | base::kappa.qr 1253 | base::kappa.lm 1254 | base::kappa.default 1255 | base::kappa 1256 | base::.kappa_tri 1257 | ``` 1258 | 1259 | ### conditioning 1260 | ```R 1261 | base::restartFormals 1262 | base::conditionCall.condition 1263 | base::conditionCall 1264 | base::restartDescription 1265 | base::as.character.condition 1266 | base::simpleCondition 1267 | base::conditionMessage 1268 | base::as.character.error 1269 | base::withCallingHandlers 1270 | ``` 1271 | 1272 | ### logicals 1273 | ```R 1274 | base::as.logical.factor 1275 | base::isTRUE 1276 | base::is.logical 1277 | ``` 1278 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------