MarcAntoineFabre / metrumrg

Automatically exported from code.google.com/p/metrumrg
0 stars 0 forks source link

suggested functions #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
is.defined ... opposite of is.na
%crosses%  ... english syntax for crosses a,b

guts <- function (x, ...)   UseMethod("guts")

# adapted from utils:::head.data.frame
guts.data.frame <- function (x, n = 6L, ...) 
{
  stopifnot(length(n) == 1L)
  n <- if (n < 0L) 
    max(nrow(x) + n, 0L)
  else min(n, nrow(x))
  ii <- sample(seq_len(x), n)
  x[ii, , drop = FALSE]
}
#per Jim Rogers.  In lieu of 'guts', perhaps: slice, chunk, torso, sample, etc.

Original issue reported on code.google.com by bergs...@gmail.com on 30 Jul 2012 at 7:16

GoogleCodeExporter commented 8 years ago
@ 5.22

Original comment by bergs...@gmail.com on 18 Sep 2012 at 7:44