Skip to content
Prev 239609 / 398500 Next

as.list

Dear Ivan,

Thanks a lot. I managed to create a list (KANE.LIST) out of my data  
set (KANE).

There is still the problem within the barplot function (non-numeric  
argument). There are no NA values and just the variable names are non- 
numeric...

Thanks
Sibylle

 > PA<-read.table("Biotree_partitioning.txt", header=TRUE)
 > KANE<-PA[PA$site=="KA"&PA$part=="NE",]
 > KANE.LISTs<-subset(KANE, select=c(5:9))
 > KANE.LIST<-as.list(KANE.LISTs)
 > names(KANE.LIST)<-colnames(KANE)[-c(1:4)]
 > for(i in colnames(KANE)[-c(1:4)]){
+ 	KANE.LIST[[i]]
+ 	}
 >
 > barplot(KANE.LIST, ylim=c(-20,20), col=as.numeric(KANE$diversity))
Error in -0.01 * height : non-numeric argument to binary operator
 >
 > KANE.LIST
$H5
  [1] -5.33 -1.17  3.17 -1.83 -1.17  2.50  5.33 -3.78 -8.69  0.33  
-2.83 -4.08

$H8
  [1] -19.58  -7.33   6.17  -3.83   8.17  21.33  16.67  -9.22 -23.94    
2.56 -15.00 -15.92

$S5
  [1] -2.75 12.17 16.17  5.00  5.50  7.33 10.56 14.00  4.11  7.33   
9.75  8.67

$S8
  [1] -11.96   2.50   3.00  -4.83  -9.33   3.17   6.00   4.33  -7.08   
-4.56   4.08 -12.08

$C8
  [1] -0.23 -0.07  0.09  0.03  0.09  0.22  0.13 -0.07 -0.22  0.01  
-0.19 -0.15

 > KANE
    site part plot diversity    H5     H8    S5     S8    C8
1    KA   NE    3         2 -5.33 -19.58 -2.75 -11.96 -0.23
2    KA   NE    6         2 -1.17  -7.33 12.17   2.50 -0.07
3    KA   NE    7         2  3.17   6.17 16.17   3.00  0.09
4    KA   NE   10         2 -1.83  -3.83  5.00  -4.83  0.03
5    KA   NE   12         2 -1.17   8.17  5.50  -9.33  0.09
6    KA   NE   16         2  2.50  21.33  7.33   3.17  0.22
7    KA   NE    4         3  5.33  16.67 10.56   6.00  0.13
8    KA   NE    5         3 -3.78  -9.22 14.00   4.33 -0.07
9    KA   NE    9         3 -8.69 -23.94  4.11  -7.08 -0.22
10   KA   NE   15         3  0.33   2.56  7.33  -4.56  0.01
11   KA   NE    2         4 -2.83 -15.00  9.75   4.08 -0.19
12   KA   NE    8         4 -4.08 -15.92  8.67 -12.08 -0.15
On 27.10.2010, at 15:26, Ivan Calandra wrote: