[R] Working With Variables Having Different Lengths

Rich Shepard rshepard at appl-ecosys.com
Mon Oct 24 18:37:06 CEST 2011


On Mon, 24 Oct 2011, David Winsemius wrote:

> You could also have saved the subsetted data, applied `factor` to the
> subsetted column and then used `xtabs`.
>
> temp <- subset(chemdata, <your subset criteria>, <your column selection>)
> temp$param <- factor(temp$param)
> (Now only levels that exist are in the temp version.)

David,

   Thank you. I have saved the subsetted values. I'll compare the above with
what I did.

   Perhaps because it's Monday the R help system is not working well. When I
type ?xtab or ?dcast I'm told no help is available. Had the same result with
?subset until I quit R, closed emacs, and started again. Quite strange.

Rich



More information about the R-help mailing list