Displaying 2 results from an estimated 2 matches for "keep_class".
2009 Feb 22
2
Semantics of sequences in R
...x), names(y) ) )
# if arg evaluation gives error, return "Err", else its value
if_err <-
function(expr)
{ if (class(try(expr,silent = TRUE)) == "try-error") "Err"
else expr }
# {} needed so else will parse properly
# does f(x) have the same class as x?
keep_class <-
function(f)
function(x)
if_err( all(class(x) == class(f(x))))
seqtest <- function(seq)
{
lseq <- length(seq)
gouter(
list(
is.vector = is.vector,
is.list = is.list,
is.pairlist = is.pairlist,
`c_keep?` = keep_...
2009 Feb 22
2
Semantics of sequences in R
...x), names(y) ) )
# if arg evaluation gives error, return "Err", else its value
if_err <-
function(expr)
{ if (class(try(expr,silent = TRUE)) == "try-error") "Err"
else expr }
# {} needed so else will parse properly
# does f(x) have the same class as x?
keep_class <-
function(f)
function(x)
if_err( all(class(x) == class(f(x))))
seqtest <- function(seq)
{
lseq <- length(seq)
gouter(
list(
is.vector = is.vector,
is.list = is.list,
is.pairlist = is.pairlist,
`c_keep?` = keep_...