[R] Need Help with Dendrogram and DataFrame Leaf names

ngottlieb at marinercapital.com ngottlieb at marinercapital.com
Fri Jun 15 15:42:32 CEST 2007


I having problem with dendrogram leaf names when I read a tab delimited
file into dataframe;

I have a text file, tab delimited, using read.table into a data frame as
follows:
>  test1<-read.table("c:\\R\\data\\Tremont4.txt", header=TRUE, sep="\t")

When I do this the "test1" data frame is picking up my first column
names as
part of the data and not the case names, the leafs are the numbers on
the left 1-13
As opposed to the text names to the right. 

Example Output from displaying dataframe:
> test1
                 row.names X1.31.2004 X2.29.2004 X3.31.2004 X4.30.2004
X5.31.2004 X6.30.2004 X7.31.2004 X8.31.2004 X9.30.2004 X10.31.2004
1     ConvertibleArbitrage      0.014      0.003      0.004      0.005
-0.013     -0.008     -0.002      0.003     -0.001      -0.003
2       DedicatedShortBias     -0.017      0.003     -0.026      0.042
0.008     -0.013      0.081      0.013     -0.019      -0.018
3          EmergingMarkets      0.025      0.014      0.018     -0.033
-0.018      0.009     -0.001      0.018      0.023       0.024
4            MarketNeutral      0.008      0.008     -0.001     -0.003
0.002      0.008      0.003      0.021      0.005       0.000
5              EventDriven      0.022      0.010      0.005      0.005
0.001      0.010      0.000      0.005      0.013       0.012
6               Distressed      0.024      0.009      0.006      0.007
0.003      0.011      0.005      0.006      0.012       0.019
7  EventdriveMultiStrategy      0.020      0.011      0.003      0.005
-0.001      0.009     -0.003      0.004      0.014       0.007
8            RiskArbitrage      0.008      0.005      0.007     -0.006
0.004      0.003     -0.015      0.002      0.006       0.009
9     FixedIncomeArbitrage      0.012      0.009     -0.005      0.013
0.006      0.007      0.007     -0.004     -0.008       0.011
10             GlobalMacro      0.015      0.012      0.010      0.001
0.001      0.005      0.008     -0.008     -0.005       0.012
11         LongShortEquity      0.020      0.018      0.002     -0.014
-0.004      0.007     -0.014      0.001      0.024       0.014
12          ManagedFutures      0.011      0.069     -0.009     -0.065
-0.011     -0.028     -0.020     -0.015      0.020       0.048
13          Multi-Strategy      0.016      0.004      0.004      0.003
-0.001      0.001     -0.003      0.004      0.006       0.006

Input file looks like this:
row.names	            1/31/2004	  2/29/2004	3/31/2004
4/30/2004	5/31/2004	6/30/2004	7/31/2004
8/31/2004
ConvertibleArbitrage	0.014  	 0.003	0.004	       0.005	-0.013
-0.008	-0.002	0.003
DedicatedShortBias	-0.017	 0.003	-0.026	0.042	       0.008
-0.013	0.081	      0.013
EmergingMarkets	      0.025	       0.014	0.018	     -0.033
-0.018	      0.009	     -0.001	      0.018
MarketNeutral	      0.008	       0.008	-0.001	-0.003	0.002
0.008	      0.003	      0.021
Etc...

Would appreciate why the read.table into dataframe sees the text as part
of the data oand
Not the observation names and is making the numbers the leaf names and
observation names.


Thanks for any help,
Neil Gottlieb
--------------------------------------------------------

 
 
This information is being sent at the recipient's request or...{{dropped}}



More information about the R-help mailing list