I think I solved the problem =)
My dataset is an .arff file. So I read my data into R via read.arff.
I tried the following:
Export the dataframe to an txt-file and import it once again in R via 
read.table.
With the new dataset if works fine. Maybe the error comes from the 
variable-names. I attached a txt-file containing the str(traindat.bin) output 
from the data.frame, which I import via read.arff

Cheers,
TIM


-----Ursprüngliche Nachricht-----
Von: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] 
Gesendet: Friday, January 23, 2009 11:03 AM
An: Häring, Tim (LWF)
Betreff: Re: AW: [R] dimnames in pkg "ipred"



Häring, Tim (LWF) wrote:
> OK, the information I send to the list were rather sparse. Sorry for that!
> I just tried the command with the recent Version of R and ipred. The error 
> message is the same.
> I want to create a classification model. My data consist of 5414 observations 
> and 98 variables whereof 33 are numeric, the remainder are binary nominal 
> (factor) variables. My output SOIL_UNIT is a factor variable with 82 levels.
> 
> I hope this are enough information to understand the problem.

What does str(traindat.bin) tell you? Is it a data.frame?
Can you reduce the data.frame in a way (less variables and observations) 
so that you can send the rest by e-mail and we can see the error?

Uwe Ligges


> Cheers,
> TIM
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] 
> Gesendet: Thursday, January 22, 2009 6:49 PM
> An: Häring, Tim (LWF)
> Cc: r-help@r-project.org
> Betreff: Re: [R] dimnames in pkg "ipred"
> 
> 
> 
> Häring, Tim (LWF) wrote:
>> Hello List,
>>
>>  
>>
>> I`m trying to make prediction using a bagged tree with the package ipred. I 
>> tried to follow the manual but I`m getting an error message. Also browsing 
>> through the list-archive I didn`t find any hint. 
>>
>> Maybe someone can help me?
>>
>>  
>>
>> selbag <- bagging(SOIL_UNIT ~., data=traindat.bin, coob=TRUE)
>>
>> Error in dimnames(X) <- list(dn[[1L]], unlist(collabs, use.names = FALSE)) : 
>>
>>   length of 'dimnames' [2] not equal to array extent
>>
>>  
>>
>> I´m using R 2.7.2 on Win XP and the latest version of ipred.
> 
> 
> Please do read the posting guide.
> 
> - We do not have "traindat.bin", hence cannot reproduce your problem
> - Does it happen with recent versions of R and ipred?
> 
> Best,
> Uwe Ligges
> 
> 
> 
> 
>>  
>>
>> Thanks a lot.
>>
>> TIM
>>
>>  
>>
>> -------------------------------------------------------------------------------
>>  
>>
>> Dipl.-Geogr. Tim Häring
>>
>> Sachgebiet Standort und Bodenschutz (SG 2.1)
>>
>> Bayerische Landesanstalt für Wald und Forstwirtschaft
>>
>> Am Hochanger 11
>>
>> D-85354 Freising
>>
>>
>>
>> Tel.: +49-(0)8161/71-4769
>>
>> E-Mail: tim.haer...@lwf.bayern.de
>>
>> http://www.lwf.bayern.de
>>
>>
>>
>>
>>
>>
>>      [[alternative HTML version deleted]]
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> ______________________________________________
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> str(traindat.bin)
'data.frame':   5414 obs. of  98 variables:
 $ SOIL_UNIT                                         : Factor w/ 82 levels 
"17b","19a","19b",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Allgaeuschichten                        : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Anmooriger_Boden                        : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Aptychenschichten                       : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Bachschuttkegel                         : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Baustein-Schichten                      : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Baustein-Schichten_Nagelfluh            : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Bergschlipf                             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Bergsturz                               : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Bunte_Hornsteinschichten                : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Bunte_Mergel                            : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Bunter_Liaskalk                         : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Cenoman                                 : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Cenoman_Breccie                         : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Cenoman_Kalksandstein                   : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Cenoman_Mergel                          : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Deutenhausener_Schichten                : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Gewaesser                               : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Haellritzer_Serie                       : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Hangschutt_Verwitterungsdecke           : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Hauptdolomit                            : Factor w/ 2 levels 
"f","t": 2 1 1 1 1 1 1 1 2 1 ...
 $ GEOL_UNIT=Hauptdolomit_Asphaltschiefer            : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Hochmoortorf                            : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Jungmoraene                             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Kalktuff                                : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Kieselkalke_des_Lias_Dogger             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Koessener_Schichten                     : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Kuenstliche_Aufschuettung               : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Liebensteiner_Kalk_Sandkalk             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Moor_anmooriges_Gelaende                : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Oberraetkalk                            : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Partnachkalk                            : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Piesenkopf-Serie                        : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Plattenkalk                             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Postglazialer_Schotter                  : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Quarzit-Serie                           : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Raeto-Lias-Riffkalk                     : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Raibler_Schichten                       : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Raibler_Schichten_Rauhwacke_Kalk_Dolomit: Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 2 ...
 $ GEOL_UNIT=Raibler_Schichten_Sandstein             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Riss-Moraene                            : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Seetonlagen                             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Spaetglazialer_Schotter                 : Factor w/ 2 levels 
"f","t": 1 2 2 2 2 2 2 2 1 1 ...
 $ GEOL_UNIT=Steigbach-Schichten                     : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Talboden                                : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Tannheimer_Schichten                    : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Tonmergel-Schichten                     : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Uebergangsmoortorf                      : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Unternogg-Schichten                     : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Weissach-Schichten                      : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Wettersteinkalk                         : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Zementmergel-Serie                      : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ GEOL_UNIT=Ziegspitzschichten                      : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Holozaen                               : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Keuper                                 : Factor w/ 2 levels 
"f","t": 2 1 1 1 1 1 1 1 2 2 ...
 $ STRAT_UNIT=Lias                                   : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Malm                                   : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Muschelkak                             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=NoData                                 : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Oberkreide                             : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Oligozaen                              : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Raet                                   : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Riss                                   : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Unterkreide                            : Factor w/ 2 levels 
"f","t": 1 1 1 1 1 1 1 1 1 1 ...
 $ STRAT_UNIT=Wuerm                                  : Factor w/ 2 levels 
"f","t": 1 2 2 2 2 2 2 2 1 1 ...
 $ DEM10                                             : num  1419 1326 1150 840 
1356 ...
 $ SLOPE                                             : num  30.65 17.28 29.27 
3.97 17.78 ...
 $ ASPECT                                            : num  166.4 60.8 151.1 
114.7 33 ...
 $ CURV                                              : num  0.033201 -0.0065 
0.000901 -0.005399 -0.000099 ...
 $ PLCUR                                             : num  0.011466 -0.003976 
-0.000126 -0.002333 0.000863 ...
 $ PRCUR                                             : num  0.021735 -0.002524 
0.001027 -0.003065 -0.000962 ...
 $ MRVBF                                             : num  0 0.00006 0 
0.719245 0.000062 ...
 $ MRRTF                                             : num  0 0.000004 0 
0.227922 0.000005 ...
 $ CONVI                                             : num  7.4512 -5.8687 
0.0127 -7.2982 1.8009 ...
 $ CONVI5                                            : num  -43.6 -53 -52.6 
-61.8 -54.8 ...
 $ CONVI10                                           : num  -49.3 -47.8 -60.7 
-49.2 -45.9 ...
 $ CAREA                                             : num  1601 39283 2750 968 
20714 ...
 $ CSLOPE                                            : num  0.6058 0.5599 
0.6445 0.0692 0.5718 ...
 $ CHEIGHT                                           : num  118.1 223.9 94.4 
4.4 221.2 ...
 $ TWI                                               : num  5.6 9.44 6.2 7.24 
8.77 ...
 $ LSFAC                                             : num  14.658 12.106 
15.518 0.462 10.835 ...
 $ SWI                                               : num  7.9 11.71 8.47 13.7 
11.02 ...
 $ SWI_CAREA                                         : num  1668 40233 2786 968 
20742 ...
 $ SWI_CSLOPE                                        : num  0.6067 0.5601 
0.6441 0.0692 0.5717 ...
 $ SWI_MCA                                           : num  1668 40233 2786 
77505 20742 ...
 $ FLWPATH                                           : num  11.3 12 11.6 10.9 
12 ...
 $ VERTDIST                                          : num  33.45 5.18 35.94 
6.55 9.07 ...
 $ INSOL                                             : num  1767 1300 1796 1533 
1178 ...
 $ INSOLDUR                                          : num  3270 2930 3450 3590 
2960 3070 3220 3390 3300 2430 ...
 $ DEMGAUSS                                          : num  1418 1330 1150 840 
1357 ...
 $ SLOPEGAUSS                                        : num  0.5384 0.3414 
0.5497 0.0658 0.3318 ...
 $ CAREAGAUSS                                        : num  7656 64433 2929 
1239 49424 ...
 $ TWIGAUSS                                          : num  6.43 8.54 6.11 7.06 
8.44 ...
 $ ODISTGAUSS                                        : num  126.5 83.8 157.6 
151.2 107.8 ...
 $ VERTDISTGA                                        : num  31.85 8.61 35.74 
6.72 11.07 ...
 $ INSOLGAUSS                                        : num  1694 1326 1785 1488 
1280 ...
 $ TEMPANNREZ                                        : num  3.7 4.23 5.06 6.7 
4.05 ...
 $ PANNREZ                                           : num  1830 1839 1727 1697 
1836 ...
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to