[R] Casting "character" to "Date" using the "as" function

2010-02-23 Thread david.schruth
Hello, I'm trying to write a function which, among other things, attempts to convert variables of type 'character' into various other classes like 'integer', 'numeric', 'character' & "Date", depending on the class of a second parameter to this same function. Converting from character to Date is

[R] producing a master table from list of tables

2009-12-31 Thread david.schruth
Hello, I'm trying to construct an overall summary table from a list of tables. my.list <- list(x=c('a','b','a','b','c'), y=c ('a','d','c','a','b','d'),z=c('d','d','c')) my.table.list <- lapply(my.list, table) normally this might be really easy: master.table <- table(unlist(my.list)) But as it

Re: [R] producing a master table from list of tables

2009-12-31 Thread david.schruth
t; Is this what you wanted? > > untable <- function(tab) rep(names(tab), as.vector(tab)) > lapply(my.table.list, untable) > $x > [1] "a" "a" "b" "b" "c" > > $y > [1] "a" "a" "b" "c"

[R] contour( ..., method='edge') incompatible with xlim & ylim

2009-02-11 Thread david.schruth
Hello, A colleague of mine in our oceanography lab has pointed out a slightly annoying imperfection with the contour plotting function. It appears that the 'edge' option for the 'method' parameter doesn't work very well (or at all?) when xlim and ylim are also set. The following code should rec