Hi,

Unlike on an atomic matrix, as.vector() doesn't drop the "dim"
attribute of matrix or array of type "list":

  m <- matrix(list(), nrow=2, ncol=3)
  m
  #      [,1] [,2] [,3]
  # [1,] NULL NULL NULL
  # [2,] NULL NULL NULL

  as.vector(m)
  #      [,1] [,2] [,3]
  # [1,] NULL NULL NULL
  # [2,] NULL NULL NULL

  is.vector(as.vector(m))
  # [1] FALSE

Thanks,
H.

--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to