Re: [R] Naming dimnames in an array using the results of an expression

2012-05-23 Thread Dr Bob Phillips
Wonderful! Thanks very much for this: the step I'd clearly missed was to 1. put the rownames/colnames in a list object 2. *name* these with the titles separately ... allowing the expression to be evaluated names(dn)<-c(names(result[[1]]),names(result[[1]][2])) 3. apply this to the array Ta v m

Re: [R] Naming dimnames in an array using the results of an expression

2012-05-22 Thread R. Michael Weylandt
I think you may be making this too hard, but before I venture a guess, what does your "result" object look like -- can you dput() it for us? Looking at the line you tried: dimnames(diag.data)<-list(names(result[1])=rownames(diag.data),names(result[[1]][2])=colnames(diag.data)) there seems to be

[R] Naming dimnames in an array using the results of an expression

2012-05-22 Thread Dr Bob Phillips
dear all i'm struggling with naming in an array diag.data is one of a series of 2x2 diagnostic testing arrays, with 'Outcome' columns (true/false) and 'Test' rows (High-risk, Low-risk), drawn from a larger list object of 'results' i can hard-code the names of the array using dimnames; diag.dat