File: b.R

package info (click to toggle)
r-base 4.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 112,924 kB
  • sloc: ansic: 291,338; fortran: 111,889; javascript: 14,798; yacc: 6,154; sh: 5,689; makefile: 5,239; tcl: 4,562; perl: 963; objc: 791; f90: 758; asm: 258; java: 31; sed: 1
file content (12 lines) | stat: -rw-r--r-- 346 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
## a function w/o "{ .. }"  .. this is all about keeping parse data:
g <- function(x) # comment g()
    if(x) TRUE

## with "{ .. }"
h <- function(x) { # argument x
    if(is.atomic(x))
        x # atomic vector
    else list(if(length(x)) x[[1]], # <-- "nothing" when length zero
              le = length(x), cl = class(x)) # something else
}