misc {oosp}R Documentation

if and for statement constructs

Description

The ifst function (if something) returns true if an object is non-null and has length > 0. The if0 and if1 functions return true if an object has length 0 or 1 respectively. The iter function produces an integer vector from min to n, if n >= min, and a zero length vector otherwise. Instead of if (n > 0) for (i in 1:n) ...commands..., we can write for (i in iter (n) ) ...commands... .The itobj function is similar to iter, except that the vector is 1:length (obj).

Usage

ifst (obj)
if0 (obj)
if1 (obj)
iter (n, min=1)
itobj (obj)

Arguments

obj
n
min

[Package oosp version 0.2.3 Index]