Skip to content

Drop a part of an array\list\vector?

2 messages · Idgarad, David Winsemius

#
On Jan 7, 2010, at 1:15 PM, Idgarad wrote:

            
The data type returned by summary appears to be  ....  a table, ...   
which means it can be indexed as would be a matrix:


 > summary(data.frame( a= c(TRUE, FALSE, TRUE), b= c(TRUE,TRUE,TRUE),  
cc =c("a", "b" , "c") ))
      a              b           cc
  Mode :logical   Mode:logical   a:1
  FALSE:1         TRUE:3         b:1
  TRUE :2         NA's:0         c:1
  NA's :0

 > str(summary(data.frame( a= c(TRUE, FALSE, TRUE), b=  
c(TRUE,TRUE,TRUE), cc =c("a", "b" , "c") )))
  'table' chr [1:4, 1:3] "Mode :logical  " "FALSE:1        " "TRUE : 
2        " "NA's :0        " ...
  - attr(*, "dimnames")=List of 2
   ..$ : chr [1:4] "" "" "" ""
   ..$ : chr [1:3] "    a" "   b" "cc"

 > summary(data.frame( a= c(TRUE, FALSE, TRUE), b= c(TRUE,TRUE,TRUE),  
cc =c("a", "b" , "c") ))[, 1:2]
      a                b
  "Mode :logical  " "Mode:logical  "
  "FALSE:1        " "TRUE:3        "
  "TRUE :2        " "NA's:0        "
  "NA's :0        " NA

Although there appear to be some underlying print-issues.